2021-02-13 14:23:35 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, pkg-config
|
|
|
|
, meson
|
2022-09-30 11:47:45 +00:00
|
|
|
, mesonEmulatorHook
|
2021-02-13 14:23:35 +00:00
|
|
|
, ninja
|
|
|
|
, fetchFromGitLab
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchpatch
|
2021-02-13 14:23:35 +00:00
|
|
|
, 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
|
|
|
|
, 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
|
|
|
, wrapGAppsNoGuiHook
|
|
|
|
, nixosTests
|
2021-02-13 14:23:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "power-profiles-daemon";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.13";
|
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";
|
|
|
|
owner = "hadess";
|
|
|
|
repo = "power-profiles-daemon";
|
|
|
|
rev = version;
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-ErHy+shxZQ/aCryGhovmJ6KmAMt9OZeQGDbHIkC0vUE=";
|
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
|
2021-12-06 16:07:01 +00:00
|
|
|
wrapGAppsNoGuiHook
|
|
|
|
python3.pkgs.wrapPython
|
2022-09-30 11:47:45 +00:00
|
|
|
# checkInput but cheked for during the configuring
|
|
|
|
(python3.pythonForBuild.withPackages (ps: with ps; [
|
|
|
|
pygobject3
|
|
|
|
dbus-python
|
|
|
|
python-dbusmock
|
|
|
|
]))
|
|
|
|
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libgudev
|
|
|
|
systemd
|
|
|
|
upower
|
|
|
|
glib
|
2021-12-06 16:07:01 +00:00
|
|
|
polkit
|
|
|
|
python3 # for cli tool
|
2023-02-02 18:25:31 +00:00
|
|
|
# Duplicate from nativeCheckInputs until https://github.com/NixOS/nixpkgs/issues/161570 is solved
|
2022-08-12 12:06:08 +00:00
|
|
|
umockdev
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
# for cli tool
|
|
|
|
pythonPath = [
|
|
|
|
python3.pkgs.pygobject3
|
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"
|
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;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
|
|
|
|
|
|
|
|
# Avoid double wrapping
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
patchShebangs --build \
|
|
|
|
tests/integration-test.py \
|
|
|
|
tests/unittest_inspector.py
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postCheck = ''
|
|
|
|
# Do not contaminate the wrapper with test dependencies.
|
|
|
|
unset GI_TYPELIB_PATH
|
|
|
|
unset XDG_DATA_DIRS
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Avoid double wrapping
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
# Make Python libraries available
|
|
|
|
wrapPythonProgramsIn "$out/bin" "$pythonPath"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl3Plus;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ mvnetbiz ];
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
}
|