depot/pkgs/by-name/po/powertop/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

76 lines
1.5 KiB
Nix

{
lib,
stdenv,
autoconf-archive,
autoreconfHook,
fetchFromGitHub,
gettext,
libnl,
ncurses,
nix-update-script,
pciutils,
pkg-config,
powertop,
testers,
xorg,
zlib,
}:
stdenv.mkDerivation rec {
pname = "powertop";
version = "2.15";
src = fetchFromGitHub {
owner = "fenrus75";
repo = "powertop";
rev = "refs/tags/v${version}";
hash = "sha256-53jfqt0dtMqMj3W3m6ravUTzApLQcljDHfdXejeZa4M=";
};
outputs = [
"out"
"man"
];
nativeBuildInputs = [
autoconf-archive
autoreconfHook
pkg-config
];
buildInputs = [
gettext
libnl
ncurses
pciutils
zlib
];
postPatch = ''
substituteInPlace src/main.cpp --replace-fail "/sbin/modprobe" "modprobe"
substituteInPlace src/calibrate/calibrate.cpp --replace-fail "/usr/bin/xset" "${lib.getExe xorg.xset}"
substituteInPlace src/tuning/bluetooth.cpp --replace-fail "/usr/bin/hcitool" "hcitool"
'';
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = powertop;
command = "powertop --version";
inherit version;
};
};
meta = with lib; {
inherit (src.meta) homepage;
changelog = "https://github.com/fenrus75/powertop/releases/tag/v${version}";
description = "Analyze power consumption on Intel-based laptops";
mainProgram = "powertop";
license = licenses.gpl2Only;
maintainers = with maintainers; [
fpletz
anthonyroussel
];
platforms = platforms.linux;
};
}