python312Packages.types-aiobotocore: 2.15.2 -> 2.15.2.post3 (#361801)
[NixPkgs.git] / pkgs / by-name / cp / cpu-energy-meter / package.nix
blob7ddbf8f6d283acb3970e240a2332e301e0062327
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , libcap
5 }:
6 stdenv.mkDerivation rec {
7   pname = "cpu-energy-meter";
8   version = "1.2";
10   src = fetchFromGitHub {
11     owner = "sosy-lab";
12     repo = "cpu-energy-meter";
13     rev = version;
14     hash = "sha256-QW65Z8mRYLHcyLeOtNAHjwPNWAUP214wqIYclK+whFw=";
15   };
17   postPatch = ''
18     substituteInPlace Makefile \
19       --replace "DESTDIR :=" "DESTDIR := $out" \
20       --replace "PREFIX := /usr/local" "PREFIX :="
21   '';
23   buildInputs = [ libcap ];
25   env.NIX_CFLAGS_COMPILE = "-fcommon";
27   postInstall = ''
28     install -Dm444 -t $out/etc/udev/rules.d $src/debian/additional_files/59-msr.rules
29   '';
31   meta = with lib; {
32     description = "Tool for measuring energy consumption of Intel CPUs";
33     homepage = "https://github.com/sosy-lab/cpu-energy-meter";
34     changelog = "https://github.com/sosy-lab/cpu-energy-meter/blob/main/CHANGELOG.md";
35     maintainers = with maintainers; [ lorenzleutgeb ];
36     license = licenses.bsd3;
37     platforms = [ "x86_64-linux" ];
38     mainProgram = "cpu-energy-meter";
39   };