2021-02-13 14:23:35 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, bash-completion
|
2021-02-13 14:23:35 +00:00
|
|
|
, pkg-config
|
|
|
|
, meson
|
2022-09-30 11:47:45 +00:00
|
|
|
, mesonEmulatorHook
|
2021-02-13 14:23:35 +00:00
|
|
|
, ninja
|
|
|
|
, fetchFromGitLab
|
|
|
|
, libgudev
|
|
|
|
, glib
|
2021-12-06 16:07:01 +00:00
|
|
|
, polkit
|
2022-05-18 14:49:53 +00:00
|
|
|
, dbus
|
2021-02-13 14:23:35 +00:00
|
|
|
, gobject-introspection
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsNoGuiHook
|
2021-02-13 14:23:35 +00:00
|
|
|
, gettext
|
|
|
|
, gtk-doc
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_412
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, upower
|
2021-12-06 16:07:01 +00:00
|
|
|
, umockdev
|
2021-02-13 14:23:35 +00:00
|
|
|
, systemd
|
2021-04-05 15:23:46 +00:00
|
|
|
, python3
|
2021-12-06 16:07:01 +00:00
|
|
|
, nixosTests
|
2021-02-13 14:23:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "power-profiles-daemon";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.21";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
outputs = [ "out" "devdoc" ];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
2024-02-29 20:09:43 +00:00
|
|
|
owner = "upower";
|
2021-02-13 14:23:35 +00:00
|
|
|
repo = "power-profiles-daemon";
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-5JbMbz38SeNEkVKFjJLxeUHiOrx+QCaK/vXgRPbzwzY=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
gettext
|
|
|
|
gtk-doc
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_412
|
|
|
|
libxml2 # for xmllint for stripping GResources
|
|
|
|
libxslt # for xsltproc for building docs
|
|
|
|
gobject-introspection
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsNoGuiHook
|
2022-09-30 11:47:45 +00:00
|
|
|
# checkInput but cheked for during the configuring
|
2023-11-16 04:20:00 +00:00
|
|
|
(python3.pythonOnBuildForHost.withPackages (ps: with ps; [
|
2022-09-30 11:47:45 +00:00
|
|
|
pygobject3
|
|
|
|
dbus-python
|
|
|
|
python-dbusmock
|
2024-04-21 15:54:59 +00:00
|
|
|
argparse-manpage
|
|
|
|
shtab
|
2022-09-30 11:47:45 +00:00
|
|
|
]))
|
|
|
|
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
bash-completion
|
2021-02-13 14:23:35 +00:00
|
|
|
libgudev
|
|
|
|
systemd
|
|
|
|
upower
|
|
|
|
glib
|
2021-12-06 16:07:01 +00:00
|
|
|
polkit
|
2024-02-29 20:09:43 +00:00
|
|
|
# for cli tool
|
|
|
|
(python3.withPackages (ps: [
|
|
|
|
ps.pygobject3
|
|
|
|
]))
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
checkInputs = [
|
|
|
|
umockdev
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
umockdev
|
|
|
|
dbus
|
|
|
|
];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
|
|
|
"-Dgtk_doc=true"
|
2024-04-21 15:54:59 +00:00
|
|
|
"-Dpylint=disabled"
|
|
|
|
"-Dzshcomp=${placeholder "out"}/share/zsh/site-functions"
|
2022-09-30 11:47:45 +00:00
|
|
|
"-Dtests=${lib.boolToString (stdenv.buildPlatform.canExecute stdenv.hostPlatform)}"
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Only need to wrap the Python tool (powerprofilectl)
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
patchShebangs --build \
|
|
|
|
tests/integration-test.py \
|
|
|
|
tests/unittest_inspector.py
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
patchShebangs --host \
|
|
|
|
src/powerprofilesctl
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapGApp "$out/bin/powerprofilesctl"
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
nixos = nixosTests.power-profiles-daemon;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://gitlab.freedesktop.org/hadess/power-profiles-daemon";
|
|
|
|
description = "Makes user-selected power profiles handling available over D-Bus";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "powerprofilesctl";
|
2021-02-13 14:23:35 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl3Plus;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ mvnetbiz picnoir ];
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
}
|