nixpkgs/pkgs/os-specific/linux/powertop/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.4 KiB
Nix
Raw Normal View History

2023-01-06 06:52:49 +03:00
{ lib
, stdenv
, fetchFromGitHub
, gettext
, libnl
, ncurses
, pciutils
, pkg-config
, zlib
, autoreconfHook
, autoconf-archive
, nix-update-script
, testers
, powertop
2023-04-16 15:38:02 +03:00
, xorg
2023-01-06 06:52:49 +03:00
}:
stdenv.mkDerivation rec {
pname = "powertop";
2023-01-06 06:51:44 +03:00
version = "2.15";
2013-01-15 21:43:53 +04:00
2021-07-28 23:19:32 +03:00
src = fetchFromGitHub {
owner = "fenrus75";
repo = pname;
rev = "v${version}";
2023-01-06 06:51:44 +03:00
hash = "sha256-53jfqt0dtMqMj3W3m6ravUTzApLQcljDHfdXejeZa4M=";
};
outputs = [ "out" "man" ];
2023-01-06 06:51:44 +03:00
nativeBuildInputs = [ pkg-config autoreconfHook autoconf-archive ];
2016-10-13 23:01:59 +03:00
buildInputs = [ gettext libnl ncurses pciutils zlib ];
postPatch = ''
substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe"
2023-04-16 15:38:02 +03:00
substituteInPlace src/calibrate/calibrate.cpp --replace "/usr/bin/xset" "${lib.getExe xorg.xset}"
substituteInPlace src/tuning/bluetooth.cpp --replace "/usr/bin/hcitool" "hcitool"
'';
2023-01-06 06:51:44 +03:00
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = powertop;
command = "powertop --version";
inherit version;
};
};
meta = with lib; {
2023-01-06 06:51:44 +03:00
inherit (src.meta) homepage;
changelog = "https://github.com/fenrus75/powertop/releases/tag/v${version}";
description = "Analyze power consumption on Intel-based laptops";
license = licenses.gpl2Only;
maintainers = with maintainers; [ fpletz anthonyroussel ];
2016-10-13 23:01:59 +03:00
platforms = platforms.linux;
};
}