Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

110 lines
2.4 KiB
Nix

{
lib,
fetchFromGitHub,
fetchpatch,
buildPythonApplication,
appstream-glib,
dbus-python,
desktop-file-utils,
gettext,
glib,
gobject-introspection,
gtk3,
hicolor-icon-theme,
libappindicator,
libhandy,
meson,
ninja,
pkg-config,
pygobject3,
pyxdg,
systemd,
wrapGAppsHook3,
}:
buildPythonApplication rec {
pname = "cpupower-gui";
version = "1.0.0";
# This packages doesn't have a setup.py
format = "other";
src = fetchFromGitHub {
owner = "vagnum08";
repo = pname;
rev = "v${version}";
sha256 = "05lvpi3wgyi741sd8lgcslj8i7yi3wz7jwl7ca3y539y50hwrdas";
};
patches = [
# Fix build with 0.61, can be removed on next update
# https://hydra.nixos.org/build/171052557/nixlog/1
(fetchpatch {
url = "https://github.com/vagnum08/cpupower-gui/commit/97f8ac02fe33e412b59d3f3968c16a217753e74b.patch";
sha256 = "XYnpm03kq8JLMjAT73BMCJWlzz40IAuHESm715VV6G0=";
})
# Fixes https://github.com/vagnum08/cpupower-gui/issues/86
(fetchpatch {
url = "https://github.com/vagnum08/cpupower-gui/commit/22ea668aa4ecf848149ea4c150aa840a25dc6ff8.patch";
sha256 = "sha256-Mri7Af1Y79lt2pvZl4DQSvrqSLIJLIjzyXwMPFEbGVI=";
})
];
nativeBuildInputs = [
appstream-glib
desktop-file-utils # needed for update-desktop-database
gettext
glib # needed for glib-compile-schemas
gobject-introspection # need for gtk namespace to be available
hicolor-icon-theme # needed for postinstall script
meson
ninja
pkg-config
wrapGAppsHook3
# Python packages
dbus-python
libappindicator
pygobject3
pyxdg
];
buildInputs = [
glib
gtk3
libhandy
];
propagatedBuildInputs = [
dbus-python
libappindicator
pygobject3
pyxdg
];
mesonFlags = [
"-Dsystemddir=${placeholder "out"}/lib/systemd"
];
preConfigure = ''
patchShebangs build-aux/meson/postinstall.py
'';
strictDeps = false;
dontWrapGApps = true;
makeWrapperArgs = [ "\${gappsWrapperArgs[@]}" ];
postFixup = ''
wrapPythonProgramsIn $out/lib "$out $propagatedBuildInputs"
'';
meta = with lib; {
description = "Change the frequency limits of your cpu and its governor";
mainProgram = "cpupower-gui";
homepage = "https://github.com/vagnum08/cpupower-gui/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ unode ];
};
}