powertop: migrate to pkgs/by-name, format with nixfmt-rfc-style

This commit is contained in:
Anthony ROUSSEL 2024-09-17 21:26:51 +02:00
parent 8b9ca93a74
commit 1246e83b48
3 changed files with 76 additions and 60 deletions

View File

@ -0,0 +1,76 @@
{
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;
};
}

View File

@ -1,58 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, gettext
, libnl
, ncurses
, pciutils
, pkg-config
, zlib
, autoreconfHook
, autoconf-archive
, nix-update-script
, testers
, powertop
, xorg
}:
stdenv.mkDerivation rec {
pname = "powertop";
version = "2.15";
src = fetchFromGitHub {
owner = "fenrus75";
repo = pname;
rev = "v${version}";
hash = "sha256-53jfqt0dtMqMj3W3m6ravUTzApLQcljDHfdXejeZa4M=";
};
outputs = [ "out" "man" ];
nativeBuildInputs = [ pkg-config autoreconfHook autoconf-archive ];
buildInputs = [ gettext libnl ncurses pciutils zlib ];
postPatch = ''
substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe"
substituteInPlace src/calibrate/calibrate.cpp --replace "/usr/bin/xset" "${lib.getExe xorg.xset}"
substituteInPlace src/tuning/bluetooth.cpp --replace "/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;
};
}

View File

@ -26619,8 +26619,6 @@ with pkgs;
dnsdist = callPackage ../servers/dns/dnsdist { };
powertop = callPackage ../os-specific/linux/powertop { };
pps-tools = callPackage ../os-specific/linux/pps-tools { };
procps = if stdenv.isLinux