2016-04-22 08:40:57 +01:00
|
|
|
{ stdenv, fetchurl, coreutils, gnugrep, utillinux, kmod
|
2018-07-17 21:11:16 +01:00
|
|
|
, procps, kbd, dbus }:
|
2011-07-25 01:28:18 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2016-04-13 13:53:51 +01:00
|
|
|
binPath = stdenv.lib.makeBinPath
|
2018-07-17 21:11:16 +01:00
|
|
|
[ coreutils gnugrep utillinux kmod procps kbd dbus ];
|
2011-07-25 01:28:18 +01:00
|
|
|
|
2016-04-14 16:14:28 +01:00
|
|
|
sbinPath = stdenv.lib.makeSearchPathOutput "bin" "sbin"
|
2011-07-25 01:28:18 +01:00
|
|
|
[ procps ];
|
2013-01-24 11:49:27 +00:00
|
|
|
|
|
|
|
in
|
2009-09-25 22:43:25 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2011-07-25 01:28:18 +01:00
|
|
|
name = "pm-utils-1.4.1";
|
2009-09-25 22:43:25 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://pm-utils.freedesktop.org/releases/${name}.tar.gz";
|
2011-07-25 01:28:18 +01:00
|
|
|
sha256 = "02qc6zaf7ams6qcc470fwb6jvr4abv3lrlx16clqpn36501rkn4f";
|
2009-09-25 22:43:25 +01:00
|
|
|
};
|
|
|
|
|
2009-09-26 18:09:51 +01:00
|
|
|
configureFlags = "--sysconfdir=/etc";
|
|
|
|
|
2009-09-25 22:43:25 +01:00
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
# Install the manpages (xmlto isn't really needed).
|
|
|
|
substituteInPlace man/Makefile.in --replace '@HAVE_XMLTO_TRUE@' ""
|
|
|
|
|
2011-07-25 01:28:18 +01:00
|
|
|
# Set the PATH properly.
|
|
|
|
substituteInPlace pm/pm-functions.in --replace '/sbin:/usr/sbin:/bin:/usr/bin' '$PATH:${binPath}:${sbinPath}'
|
2009-09-26 18:09:51 +01:00
|
|
|
|
2011-07-25 01:28:18 +01:00
|
|
|
substituteInPlace src/pm-action.in --replace 'tr ' '${coreutils}/bin/tr '
|
2013-01-24 11:49:27 +00:00
|
|
|
|
2009-09-26 18:09:51 +01:00
|
|
|
substituteInPlace pm/sleep.d/00logging --replace /bin/uname "$(type -P uname)"
|
2011-09-14 05:06:43 +01:00
|
|
|
|
|
|
|
substituteInPlace pm/sleep.d/90clock --replace /sbin/hwclock hwclock
|
2009-09-25 22:43:25 +01:00
|
|
|
'';
|
|
|
|
|
2013-01-24 11:49:27 +00:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
# Remove some hooks that have doubtful usefulness. See
|
|
|
|
# http://zinc.canonical.com/~cking/power-benchmarking/pm-utils-results/results.txt.
|
|
|
|
# In particular, journal-commit breaks things if you have
|
|
|
|
# read-only bind mounts, since it ends up remounting the
|
|
|
|
# underlying filesystem read-only.
|
|
|
|
rm $out/lib/pm-utils/power.d/{journal-commit,readahead}
|
|
|
|
'';
|
|
|
|
|
2009-09-25 22:43:25 +01:00
|
|
|
meta = {
|
2017-08-22 19:50:04 +01:00
|
|
|
homepage = https://pm-utils.freedesktop.org/wiki/;
|
2009-09-25 22:43:25 +01:00
|
|
|
description = "A small collection of scripts that handle suspend and resume on behalf of HAL";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2013-01-24 11:51:21 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-09-25 22:43:25 +01:00
|
|
|
};
|
|
|
|
}
|