biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / protonvpn-nm-lib / default.nix
blob1f35c5aba5b6bda1d3cae9b571a74830a9b4b475
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   pythonOlder,
6   substituteAll,
7   dbus-python,
8   distro,
9   jinja2,
10   keyring,
11   proton-client,
12   pygobject3,
13   pyxdg,
14   systemd,
15   ncurses,
16   networkmanager,
17   pkgs-systemd,
18   python,
19   xdg-utils,
22 buildPythonPackage rec {
23   pname = "protonvpn-nm-lib";
24   version = "3.16.0";
25   format = "setuptools";
26   disabled = pythonOlder "3.7";
28   src = fetchFromGitHub {
29     owner = "ProtonVPN";
30     repo = pname;
31     rev = "refs/tags/${version}";
32     hash = "sha256-n3jfBHMYqyQZgvFFJcylNbTWZ3teuqhdelTfpNrwWuA=";
33   };
35   propagatedBuildInputs = [
36     dbus-python
37     distro
38     jinja2
39     keyring
40     proton-client
41     pygobject3
42     pyxdg
43     systemd
44     ncurses
45     networkmanager
46     pkgs-systemd
47     xdg-utils
48   ];
50   patches = [
51     (substituteAll {
52       src = ./0001-Patching-GIRepository.patch;
53       networkmanager_path = "${networkmanager}/lib/girepository-1.0";
54     })
55   ];
57   postPatch = ''
58     substituteInPlace protonvpn_nm_lib/core/dbus/dbus_reconnect.py \
59       --replace "exec_start = python_interpreter_path + \" \" + python_service_path" "exec_start = \"$out/bin/protonvpn_reconnector.py\""
60   '';
62   postInstall = ''
63     makeWrapper ${python.interpreter} $out/bin/protonvpn_reconnector.py \
64       --add-flags $out/${python.sitePackages}/protonvpn_nm_lib/daemon/dbus_daemon_reconnector.py \
65       --prefix PYTHONPATH : "$PYTHONPATH"
66   '';
68   # Checks cannot be run in the sandbox
69   # "Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory"
70   doCheck = false;
72   pythonImportsCheck = [ "protonvpn_nm_lib" ];
74   meta = with lib; {
75     description = "ProtonVPN NetworkManager Library intended for every ProtonVPN service user";
76     mainProgram = "protonvpn_reconnector.py";
77     homepage = "https://github.com/ProtonVPN/protonvpn-nm-lib";
78     license = licenses.gpl3Only;
79     maintainers = [ ];
80     platforms = platforms.linux;
81   };