diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/os-specific/linux/powertop | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/powertop')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/powertop/default.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/powertop/default.nix b/nixpkgs/pkgs/os-specific/linux/powertop/default.nix new file mode 100644 index 000000000000..5ec708dd69fd --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/powertop/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchurl, fetchpatch, gettext, libnl, ncurses, pciutils, pkgconfig, zlib }: + +stdenv.mkDerivation rec { + name = "powertop-${version}"; + version = "2.9"; + + src = fetchurl { + url = "https://01.org/sites/default/files/downloads/powertop/powertop-v${version}.tar.gz"; + sha256 = "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"; + }; + + outputs = [ "out" "man" ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ gettext libnl ncurses pciutils zlib ]; + + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ( + fetchpatch { + name = "strerror_r.patch"; + url = "https://git.alpinelinux.org/cgit/aports/plain/main/powertop/strerror_r.patch?id=3b9214d436f1611f297b01f72469d66bfe729d6e"; + sha256 = "1kzddhcrb0n2iah4lhgxwwy4mkhq09ch25jjngyq6pdj6pmfkpfw"; + } + ); + + postPatch = '' + substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe" + substituteInPlace src/calibrate/calibrate.cpp --replace "/usr/bin/xset" "xset" + ''; + + meta = with stdenv.lib; { + description = "Analyze power consumption on Intel-based laptops"; + homepage = https://01.org/powertop; + license = licenses.gpl2; + maintainers = with maintainers; [ chaoflow fpletz ]; + platforms = platforms.linux; + }; +} |