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