68 lines
1.5 KiB
Nix
68 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
python,
|
|
buildPythonPackage,
|
|
cargo,
|
|
rustPlatform,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "proton-vpn-local-agent";
|
|
version = "1.4.5";
|
|
pyproject = false;
|
|
withDistOutput = false;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ProtonVPN";
|
|
repo = "python-proton-vpn-local-agent";
|
|
rev = version;
|
|
hash = "sha256-njulvM8CNURy5Gy8thOT08y4cq9T68Ktl6wlfvg5I4w=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit
|
|
pname
|
|
version
|
|
src
|
|
sourceRoot
|
|
;
|
|
hash = "sha256-RrMhkOZyG0JBEk+ikRpQtsNVR6Jt94u71+srQ6qMq5U=";
|
|
};
|
|
|
|
sourceRoot = "${src.name}/python-proton-vpn-local-agent";
|
|
|
|
cargoBuildType = "release";
|
|
nativeBuildInputs = [
|
|
cargo
|
|
rustPlatform.cargoSetupHook
|
|
rustPlatform.cargoBuildHook
|
|
];
|
|
|
|
cargoCheckType = "release";
|
|
nativeCheckInputs = [
|
|
rustPlatform.cargoCheckHook
|
|
];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
# manually install the python binding
|
|
mkdir -p $out/${python.sitePackages}/proton/vpn/
|
|
cp ./target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/libpython_proton_vpn_local_agent.so $out/${python.sitePackages}/proton/vpn/local_agent.so
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
pythonImportsCheck = [ "proton.vpn.local_agent" ];
|
|
|
|
meta = {
|
|
description = "Proton VPN local agent written in Rust with Python bindings";
|
|
homepage = "https://github.com/ProtonVPN/python-proton-vpn-local-agent";
|
|
license = lib.licenses.gpl3Only;
|
|
platforms = lib.platforms.linux;
|
|
maintainers = with lib.maintainers; [ sebtm ];
|
|
};
|
|
}
|