mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
57 lines
1.7 KiB
Nix
57 lines
1.7 KiB
Nix
{ lib, stdenv, fetchurl, coreutils, gnugrep, util-linux, kmod
|
|
, procps, kbd, dbus }:
|
|
|
|
let
|
|
|
|
binPath = lib.makeBinPath
|
|
[ coreutils gnugrep util-linux kmod procps kbd dbus ];
|
|
|
|
sbinPath = lib.makeSearchPathOutput "bin" "sbin"
|
|
[ procps ];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pm-utils";
|
|
version = "1.4.1";
|
|
|
|
src = fetchurl {
|
|
url = "https://pm-utils.freedesktop.org/releases/pm-utils-${version}.tar.gz";
|
|
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/";
|
|
description = "Small collection of scripts that handle suspend and resume on behalf of HAL";
|
|
license = lib.licenses.gpl2Plus;
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|