Unverified Commit 3aebc5e7 authored by Anthony's avatar Anthony Committed by GitHub
Browse files

proton-vpn-cli: init at 0.1.2 (#473395)

parents f076ecb4 32433fc6
Loading
Loading
Loading
Loading
+71 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  python3Packages,
  gobject-introspection,
  libnotify,
  wrapGAppsNoGuiHook,
}:

python3Packages.buildPythonApplication rec {
  pname = "proton-vpn-cli";
  version = "0.1.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ProtonVPN";
    repo = "proton-vpn-cli";
    tag = "v${version}";
    hash = "sha256-Hn7xLb7VWa2dlsrQnjnRgv+8UntOwDak9+rV1HF7k80=";
  };

  nativeBuildInputs = [
    # Needed for the NM namespace
    gobject-introspection
    wrapGAppsNoGuiHook
  ];

  buildInputs = [
    libnotify # gir typelib is used
  ];

  build-system = with python3Packages; [
    setuptools
  ];

  dependencies = with python3Packages; [
    click
    dbus-fast
    packaging
    proton-core
    proton-keyring-linux
    proton-vpn-api-core
    proton-vpn-local-agent
  ];

  dontWrapGApps = true;

  preFixup = ''
    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
  '';

  preCheck = ''
    # Needed for Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
    export XDG_RUNTIME_DIR=$(mktemp -d)
  '';

  nativeCheckInputs = with python3Packages; [
    pytestCheckHook
    pytest-asyncio
    pytest-cov-stub
  ];

  meta = {
    description = "Official ProtonVPN CLI Linux app";
    homepage = "https://github.com/ProtonVPN/proton-vpn-cli";
    license = lib.licenses.gpl3Plus;
    mainProgram = "protonvpn";
    maintainers = with lib.maintainers; [ anthonyroussel ];
  };
}
+16 −8
Original line number Diff line number Diff line
@@ -3,23 +3,23 @@
  python3Packages,
  fetchFromGitHub,
  gobject-introspection,
  wrapGAppsHook3,
  libnotify,
  withIndicator ? true,
  libappindicator-gtk3,
  libayatana-appindicator,
  libnotify,
  wrapGAppsHook3,
  withIndicator ? true,
}:

python3Packages.buildPythonApplication rec {
  pname = "protonvpn-gui";
  version = "4.13.0";
  version = "4.13.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ProtonVPN";
    repo = "proton-vpn-gtk-app";
    tag = "v${version}";
    hash = "sha256-1T8gh0aKYiVnkr4SLg2a5Hcc8FQn8llofCXxeZGwd8I=";
    hash = "sha256-pfk7ttQp7nWpGWqBWny9VdSktpB7RoBJIcF/pF6gAfA=";
  };

  nativeBuildInputs = [
@@ -49,7 +49,6 @@ python3Packages.buildPythonApplication rec {
    proton-keyring-linux
    proton-vpn-api-core
    proton-vpn-local-agent
    proton-vpn-network-manager
    pycairo
    pygobject3
  ];
@@ -72,10 +71,18 @@ python3Packages.buildPythonApplication rec {
  preCheck = ''
    # Needed for Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
    export XDG_RUNTIME_DIR=$(mktemp -d)
  '';

  # Gets a segmentation fault after the widgets test
  doCheck = false;
  nativeCheckInputs = with python3Packages; [
    pytestCheckHook
    pytest-cov-stub
  ];

  disabledTestPaths = [
    # Segmentation fault during widgets tests
    "tests/unit/widgets"
  ];

  meta = {
    description = "Proton VPN GTK app for Linux";
@@ -84,6 +91,7 @@ python3Packages.buildPythonApplication rec {
    platforms = lib.platforms.linux;
    mainProgram = "protonvpn-app";
    maintainers = with lib.maintainers; [
      anthonyroussel
      sebtm
      rapiteanu
    ];
+43 −12
Original line number Diff line number Diff line
@@ -2,35 +2,56 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  aiohttp,
  cryptography,
  distro,
  fido2,
  setuptools,
  gobject-introspection,
  iproute2,
  jinja2,
  networkmanager,
  proton-core,
  proton-vpn-local-agent,
  pycairo,
  pygobject3,
  pynacl,
  aiohttp,
  pyopenssl,
  pytest-asyncio,
  pytest-cov-stub,
  pytestCheckHook,
  pyxdg,
  requests,
  sentry-sdk,
  pyxdg,
  distro,
  pytestCheckHook,
  pytest-cov-stub,
  setuptools,
}:

buildPythonPackage rec {
  pname = "proton-vpn-api-core";
  version = "4.13.2";
  version = "4.14.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ProtonVPN";
    repo = "python-proton-vpn-api-core";
    rev = "v${version}";
    hash = "sha256-oFTlN/mi4TACmqbebKirYdqDEYzUejK4SKbKgFWONDo=";
    hash = "sha256-xyCjzcSasLGm2DMMViI1wpzcLd0mmaBvIyI1HrtW+Gg=";
  };

  postPatch = ''
    substituteInPlace proton/vpn/backend/networkmanager/killswitch/wireguard/killswitch_connection_handler.py \
      --replace-fail '["/usr/sbin/ip", "route"]' '["${iproute2}/bin/ip", "route"]'
  '';

  nativeBuildInputs = [
    # Needed to recognize the NM namespace
    gobject-introspection
  ];

  propagatedBuildInputs = [
    # Needed here for the NM namespace
    networkmanager
  ];

  build-system = [
    setuptools
  ];
@@ -40,18 +61,27 @@ buildPythonPackage rec {
    distro
    fido2
    jinja2
    pynacl
    proton-core
    sentry-sdk
    proton-vpn-local-agent
    pycairo
    pygobject3
    pynacl
    pyxdg
    sentry-sdk
  ];

  pythonImportsCheck = [
    "proton.vpn.core"
    "proton.vpn.backend.networkmanager.core"
    "proton.vpn.backend.networkmanager.killswitch.default"
    "proton.vpn.backend.networkmanager.killswitch.wireguard"
    "proton.vpn.backend.networkmanager.protocol.openvpn"
    "proton.vpn.backend.networkmanager.protocol.wireguard"
    "proton.vpn.connection"
    "proton.vpn.core"
    "proton.vpn.killswitch.interface"
    "proton.vpn.logging"
    "proton.vpn.session"
    "proton.vpn.split_tunneling"
  ];

  nativeCheckInputs = [
@@ -63,7 +93,7 @@ buildPythonPackage rec {
    pytest-cov-stub
  ];

  # Needed for `pythonImportsCheck`, `preCheck` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
  # Needed for `pythonImportsCheck`, `postInstall` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
  postInstall = ''
    # Needed for Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
@@ -88,6 +118,7 @@ buildPythonPackage rec {
    license = lib.licenses.gpl3Only;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [
      anthonyroussel
      sebtm
      rapiteanu
    ];
+69 −0
Original line number Diff line number Diff line
@@ -2,88 +2,68 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  gobject-introspection,
  apt,
  iproute2,
  setuptools,
  networkmanager,
  bcc,
  dbus-fast,
  packaging,
  proton-core,
  proton-vpn-api-core,
  proton-vpn-local-agent,
  pycairo,
  pygobject3,
  pyxdg,
  psutil,
  pytest-asyncio,
  pytestCheckHook,
  pytest-cov-stub,
  pytestCheckHook,
  setuptools,
  systemd-python,
}:

buildPythonPackage rec {
  pname = "proton-vpn-network-manager";
  pname = "proton-vpn-daemon";
  version = "0.13.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ProtonVPN";
    repo = "python-proton-vpn-network-manager";
    repo = "proton-vpn-daemon";
    tag = "v${version}";
    hash = "sha256-VMaj85oFxLkloR6hdeRHwVTBl44Mx5WEjOl9FnLf8+w=";
    hash = "sha256-0CqMGyaHjMktM3N1MfrELprZQZqJD1w/mFaOJvJApZQ=";
  };

  nativeBuildInputs = [
    # Needed to recognize the NM namespace
    gobject-introspection
  ];

  build-system = [
    setuptools
  ];

  dependencies = [
    # Needed here for the NM namespace
    networkmanager
    bcc
    dbus-fast
    packaging
    proton-core
    proton-vpn-api-core
    proton-vpn-local-agent
    pycairo
    pygobject3
    pyxdg
    psutil
    systemd-python
  ];

  postPatch = ''
    substituteInPlace proton/vpn/backend/linux/networkmanager/killswitch/wireguard/killswitch_connection_handler.py \
      --replace '/usr/sbin/ip' '${iproute2}/bin/ip'
    substituteInPlace proton/vpn/backend/linux/networkmanager/killswitch/wireguard/wgkillswitch.py \
      --replace '/usr/bin/apt' '${apt}/bin/apt'
  # Needed for `pythonImportsCheck`, `postBuild` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
  postBuild = ''
    # Needed for Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
    export XDG_RUNTIME_DIR=$(mktemp -d)
  '';

  pythonImportsCheck = [
    "proton.vpn.backend.linux.networkmanager"
    "proton.vpn.backend.linux.networkmanager.killswitch.default"
    "proton.vpn.backend.linux.networkmanager.killswitch.wireguard"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
    pytest-asyncio
    pytest-cov-stub
  ];

  # Needed for `pythonImportsCheck`, `preCheck` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
  preCheck = ''
    # Needed for Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
    export XDG_RUNTIME_DIR=$(mktemp -d)
  '';
  pythonImportsCheck = [
    "proton.vpn.daemon"
    "proton.vpn.daemon.split_tunneling"
  ];

  meta = {
    description = "Provides the necessary functionality for other ProtonVPN components to interact with NetworkManager";
    homepage = "https://github.com/ProtonVPN/python-proton-vpn-network-manager";
    description = "Daemons for Proton VPN Linux client";
    homepage = "https://github.com/ProtonVPN/proton-vpn-daemon";
    license = lib.licenses.gpl3Only;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [
      sebtm
      rapiteanu
    ];
    maintainers = with lib.maintainers; [ anthonyroussel ];
  };
}
+3 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ buildPythonPackage rec {

  src = fetchFromGitHub {
    owner = "ProtonVPN";
    repo = "python-proton-vpn-local-agent";
    repo = "local-agent-rs";
    rev = version;
    hash = "sha256-rk3wi6q0UDuwh5yhLBqdLYsJxVqhlI+Yc7HZsiAU1Y8=";
  };
@@ -65,10 +65,11 @@ buildPythonPackage rec {

  meta = {
    description = "Proton VPN local agent written in Rust with Python bindings";
    homepage = "https://github.com/ProtonVPN/python-proton-vpn-local-agent";
    homepage = "https://github.com/ProtonVPN/local-agent-rs";
    license = lib.licenses.gpl3Only;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [
      anthonyroussel
      sebtm
      rapiteanu
    ];
Loading