Commit d74677b6 authored by Doron Behar's avatar Doron Behar
Browse files

cpufrequtils: perform minimal Makefile substitution & use makeFlags

Also, use multiple outputs
parent ba4d8748
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -15,18 +15,35 @@ stdenv.mkDerivation rec {
    hash = "sha256-AFOgcYPQaUg70GJhS8YcuAgMV32mHN9+ExsGThoa8Yg=";
  };

  patchPhase = ''
    sed -e "s@= /usr/bin/@= @g" \
      -e "s@/usr/@$out/@" \
      -i Makefile
  postPatch = ''
    substituteInPlace Makefile \
      --replace-fail /usr/bin/install install
  '';

  makeFlags = [
    "bindir=$(out)/bin"
    "sbindir=$(out)/sbin"
    "mandir=$(man)/man"
    "includedir=$(dev)/include"
    "libdir=$(lib)/lib"
    "localedir=$(out)/share/locale"
    "docdir=$(man)/share/doc/packages/cpufrequtils"
    "confdir=$(out)/etc/"
  ];

  buildInputs = [
    stdenv.cc.libc.linuxHeaders
    libtool
    gettext
  ];

  outputs = [
    "out"
    "lib"
    "dev"
    "man"
  ];

  meta = {
    description = "Tools to display or change the CPU governor settings";
    homepage = "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html";