at 23.11-beta 56 lines 1.8 kB view raw
1{ lib, stdenv, fetchurl, coreutils, gnugrep, util-linux, kmod 2, procps, kbd, dbus }: 3 4let 5 6 binPath = lib.makeBinPath 7 [ coreutils gnugrep util-linux kmod procps kbd dbus ]; 8 9 sbinPath = lib.makeSearchPathOutput "bin" "sbin" 10 [ procps ]; 11 12in 13 14stdenv.mkDerivation rec { 15 pname = "pm-utils"; 16 version = "1.4.1"; 17 18 src = fetchurl { 19 url = "https://pm-utils.freedesktop.org/releases/pm-utils-${version}.tar.gz"; 20 sha256 = "02qc6zaf7ams6qcc470fwb6jvr4abv3lrlx16clqpn36501rkn4f"; 21 }; 22 23 configureFlags = [ "--sysconfdir=/etc" ]; 24 25 preConfigure = 26 '' 27 # Install the manpages (xmlto isn't really needed). 28 substituteInPlace man/Makefile.in --replace '@HAVE_XMLTO_TRUE@' "" 29 30 # Set the PATH properly. 31 substituteInPlace pm/pm-functions.in --replace '/sbin:/usr/sbin:/bin:/usr/bin' '$PATH:${binPath}:${sbinPath}' 32 33 substituteInPlace src/pm-action.in --replace 'tr ' '${coreutils}/bin/tr ' 34 35 substituteInPlace pm/sleep.d/00logging --replace /bin/uname "$(type -P uname)" 36 37 substituteInPlace pm/sleep.d/90clock --replace /sbin/hwclock hwclock 38 ''; 39 40 postInstall = 41 '' 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} 48 ''; 49 50 meta = { 51 homepage = "https://pm-utils.freedesktop.org/wiki/"; 52 description = "A small collection of scripts that handle suspend and resume on behalf of HAL"; 53 license = lib.licenses.gpl2; 54 platforms = lib.platforms.linux; 55 }; 56}