1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, python
5, meson
6, ninja
7, psutil
8, pygobject3
9, gtk3
10, gobject-introspection
11, xapp
12, polkit
13, gitUpdater
14}:
15
16buildPythonPackage rec {
17 pname = "xapp";
18 version = "21";
19
20 format = "other";
21
22 src = fetchFromGitHub {
23 owner = "linuxmint";
24 repo = "python-xapp";
25 rev = "refs/tags/master.mint${version}";
26 hash = "sha256-Kvhp+biZ+KK9FYma/8cUEaQCHPKMLjOO909kbyMLQ3o=";
27 };
28
29 nativeBuildInputs = [
30 meson
31 ninja
32 ];
33
34 propagatedBuildInputs = [
35 psutil
36 pygobject3
37 gtk3
38 gobject-introspection
39 xapp
40 polkit
41 ];
42
43 postPatch = ''
44 substituteInPlace "xapp/os.py" --replace "/usr/bin/pkexec" "${polkit}/bin/pkexec"
45 '';
46
47 postInstall = ''
48 # This is typically set by pipInstallHook/eggInstallHook,
49 # so we have to do so manually when using meson.
50 # https://github.com/NixOS/nixpkgs/issues/175227
51 export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
52 '';
53
54 doCheck = false;
55 pythonImportsCheck = [ "xapp" ];
56
57 passthru.updateScript = gitUpdater {
58 ignoredVersions = "^master.*";
59 };
60
61 meta = with lib; {
62 homepage = "https://github.com/linuxmint/python-xapp";
63 description = "Cross-desktop libraries and common resources for python";
64 license = licenses.lgpl2;
65 platforms = platforms.linux;
66 maintainers = teams.cinnamon.members;
67 };
68}