Commit 1246e83b authored by Anthony ROUSSEL's avatar Anthony ROUSSEL
Browse files

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

parent 8b9ca93a
Loading
Loading
Loading
Loading
+76 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, gettext
, libnl
, ncurses
, pciutils
, pkg-config
, zlib
, autoreconfHook
, autoconf-archive
, nix-update-script
, testers
, powertop
, xorg
{
  lib,
  stdenv,
  autoconf-archive,
  autoreconfHook,
  fetchFromGitHub,
  gettext,
  libnl,
  ncurses,
  nix-update-script,
  pciutils,
  pkg-config,
  powertop,
  testers,
  xorg,
  zlib,
}:

stdenv.mkDerivation rec {
@@ -21,20 +22,34 @@ stdenv.mkDerivation rec {

  src = fetchFromGitHub {
    owner = "fenrus75";
    repo = pname;
    rev = "v${version}";
    repo = "powertop";
    rev = "refs/tags/v${version}";
    hash = "sha256-53jfqt0dtMqMj3W3m6ravUTzApLQcljDHfdXejeZa4M=";
  };

  outputs = [ "out" "man" ];
  outputs = [
    "out"
    "man"
  ];

  nativeBuildInputs = [ pkg-config autoreconfHook autoconf-archive ];
  buildInputs = [ gettext libnl ncurses pciutils zlib ];
  nativeBuildInputs = [
    autoconf-archive
    autoreconfHook
    pkg-config
  ];

  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"
    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 = {
@@ -52,7 +67,10 @@ stdenv.mkDerivation rec {
    description = "Analyze power consumption on Intel-based laptops";
    mainProgram = "powertop";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ fpletz anthonyroussel ];
    maintainers = with maintainers; [
      fpletz
      anthonyroussel
    ];
    platforms = platforms.linux;
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -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