depot/third_party/nixpkgs/pkgs/development/python-modules/proton-vpn-killswitch-network-manager/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

58 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, gobject-introspection
, setuptools
, networkmanager
, proton-vpn-killswitch
, proton-vpn-logger
, pycairo
, pygobject3
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "proton-vpn-killswitch-network-manager";
version = "0.4.3";
pyproject = true;
src = fetchFromGitHub {
owner = "ProtonVPN";
repo = "python-proton-vpn-killswitch-network-manager";
rev = "refs/tags/v${version}";
hash = "sha256-kN41b6OZ2YXoBsmNZD3NrX4uJChSmm6DVP+5LYwiZMw=";
};
nativeBuildInputs = [
# Solves ImportError: cannot import name NM, introspection typelib not found
gobject-introspection
setuptools
];
propagatedBuildInputs = [
# Needed here for the NM namespace
networkmanager
proton-vpn-killswitch
proton-vpn-logger
pycairo
pygobject3
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "--cov=proton.vpn.killswitch.backend.linux.networkmanager --cov-report=html --cov-report=term" ""
'';
pythonImportsCheck = [ "proton.vpn.killswitch.backend.linux.networkmanager" ];
nativeCheckInputs = [
pytestCheckHook
];
meta = with lib; {
description = "Implementation of the proton-vpn-killswitch interface using Network Manager";
homepage = "https://github.com/ProtonVPN/python-proton-vpn-killswitch-network-manager";
license = licenses.gpl3Only;
maintainers = with maintainers; [ wolfangaukang ];
};
}