2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, coreutils, gnugrep, util-linux, kmod
|
2020-04-24 23:36:52 +00:00
|
|
|
, procps, kbd, dbus }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
binPath = lib.makeBinPath
|
2020-11-24 20:58:05 +00:00
|
|
|
[ coreutils gnugrep util-linux kmod procps kbd dbus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
sbinPath = lib.makeSearchPathOutput "bin" "sbin"
|
2020-04-24 23:36:52 +00:00
|
|
|
[ procps ];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-09-26 12:46:18 +00:00
|
|
|
pname = "pm-utils";
|
|
|
|
version = "1.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-09-26 12:46:18 +00:00
|
|
|
url = "https://pm-utils.freedesktop.org/releases/pm-utils-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "02qc6zaf7ams6qcc470fwb6jvr4abv3lrlx16clqpn36501rkn4f";
|
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [ "--sysconfdir=/etc" ];
|
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
# Install the manpages (xmlto isn't really needed).
|
|
|
|
substituteInPlace man/Makefile.in --replace '@HAVE_XMLTO_TRUE@' ""
|
|
|
|
|
|
|
|
# Set the PATH properly.
|
|
|
|
substituteInPlace pm/pm-functions.in --replace '/sbin:/usr/sbin:/bin:/usr/bin' '$PATH:${binPath}:${sbinPath}'
|
|
|
|
|
|
|
|
substituteInPlace src/pm-action.in --replace 'tr ' '${coreutils}/bin/tr '
|
|
|
|
|
|
|
|
substituteInPlace pm/sleep.d/00logging --replace /bin/uname "$(type -P uname)"
|
|
|
|
|
|
|
|
substituteInPlace pm/sleep.d/90clock --replace /sbin/hwclock hwclock
|
|
|
|
'';
|
|
|
|
|
|
|
|
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}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://pm-utils.freedesktop.org/wiki/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Small collection of scripts that handle suspend and resume on behalf of HAL";
|
2024-06-24 18:47:55 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|