1 { lib, stdenv, fetchurl, coreutils, gnugrep, util-linux, kmod
6 binPath = lib.makeBinPath
7 [ coreutils gnugrep util-linux kmod procps kbd dbus ];
9 sbinPath = lib.makeSearchPathOutput "bin" "sbin"
14 stdenv.mkDerivation rec {
19 url = "https://pm-utils.freedesktop.org/releases/pm-utils-${version}.tar.gz";
20 sha256 = "02qc6zaf7ams6qcc470fwb6jvr4abv3lrlx16clqpn36501rkn4f";
23 configureFlags = [ "--sysconfdir=/etc" ];
27 # Install the manpages (xmlto isn't really needed).
28 substituteInPlace man/Makefile.in --replace '@HAVE_XMLTO_TRUE@' ""
30 # Set the PATH properly.
31 substituteInPlace pm/pm-functions.in --replace '/sbin:/usr/sbin:/bin:/usr/bin' '$PATH:${binPath}:${sbinPath}'
33 substituteInPlace src/pm-action.in --replace 'tr ' '${coreutils}/bin/tr '
35 substituteInPlace pm/sleep.d/00logging --replace /bin/uname "$(type -P uname)"
37 substituteInPlace pm/sleep.d/90clock --replace /sbin/hwclock hwclock
42 # Remove some hooks that have doubtful usefulness. See
43 # http://zinc.canonical.com/~cking/power-benchmarking/pm-utils-results/results.txt.
44 # In particular, journal-commit breaks things if you have
45 # read-only bind mounts, since it ends up remounting the
46 # underlying filesystem read-only.
47 rm $out/lib/pm-utils/power.d/{journal-commit,readahead}
51 homepage = "https://pm-utils.freedesktop.org/wiki/";
52 description = "Small collection of scripts that handle suspend and resume on behalf of HAL";
53 license = lib.licenses.gpl2Plus;
54 platforms = lib.platforms.linux;