summary refs log tree commit diff
path: root/pkgs/applications/networking/protonvpn-gui/default.nix
diff options
context:
space:
mode:
authorP. R. d. O <d.ol.rod@protonmail.com>2021-10-22 22:40:39 -0600
committerP. R. d. O <d.ol.rod@protonmail.com>2021-10-22 22:40:39 -0600
commit352785051db92287d13222db57ae2e8a342535bb (patch)
treec68900623a3df2d6664dfb1fcab75f436235a631 /pkgs/applications/networking/protonvpn-gui/default.nix
parenta26ebd9835c9df9fbe392ad4f041161a0942f3f4 (diff)
downloadnixpkgs-352785051db92287d13222db57ae2e8a342535bb.tar
nixpkgs-352785051db92287d13222db57ae2e8a342535bb.tar.gz
nixpkgs-352785051db92287d13222db57ae2e8a342535bb.tar.bz2
nixpkgs-352785051db92287d13222db57ae2e8a342535bb.tar.lz
nixpkgs-352785051db92287d13222db57ae2e8a342535bb.tar.xz
nixpkgs-352785051db92287d13222db57ae2e8a342535bb.tar.zst
nixpkgs-352785051db92287d13222db57ae2e8a342535bb.zip
protonvpn-gui: build new official client
Diffstat (limited to 'pkgs/applications/networking/protonvpn-gui/default.nix')
-rw-r--r--pkgs/applications/networking/protonvpn-gui/default.nix98
1 files changed, 31 insertions, 67 deletions
diff --git a/pkgs/applications/networking/protonvpn-gui/default.nix b/pkgs/applications/networking/protonvpn-gui/default.nix
index ee92f4727c7..1bbf3d6554f 100644
--- a/pkgs/applications/networking/protonvpn-gui/default.nix
+++ b/pkgs/applications/networking/protonvpn-gui/default.nix
@@ -1,90 +1,54 @@
-{ lib, fetchFromGitHub, makeDesktopItem, makeWrapper, imagemagick
-, python3Packages, wrapGAppsHook, protonvpn-cli, gtk3, pango
-, gobject-introspection, libnotify, libappindicator-gtk3
-, procps, openvpn }:
+{ lib, fetchFromGitHub, gobject-introspection, imagemagick,
+wrapGAppsHook, python3Packages, gtk3, networkmanager, webkitgtk }:
 
-let
-  extraPath = lib.makeBinPath [ procps openvpn ];
-
-in python3Packages.buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   pname = "protonvpn-linux-gui";
-  version = "2.1.1";
+  version = "1.4.1";
 
   src = fetchFromGitHub {
-    owner = "protonvpn";
-    repo = "linux-gui";
-    rev = "v${version}";
-    sha256 = "avo5/2eq53HSHCnnjtxrsmpURtHvxmLZn2BxActImGY=";
-  };
-
-  desktopItem = makeDesktopItem {
-    name = "ProtonVPN";
-    desktopName = "ProtonVPN GUI";
-    type = "Application";
-    exec = "protonvpn-gui";
-    icon = "protonvpn";
-    categories = "Network;";
-    terminal = "false";
-  };
-
-  trayDesktopItem = makeDesktopItem {
-    name = "ProtonVPN Tray";
-    desktopName = "ProtonVPN Tray";
-    type = "Application";
-    exec = "protonvpn-tray";
-    icon = "protonvpn";
-    categories = "Network;";
-    terminal = "false";
+    owner = "ProtonVPN";
+    repo = "linux-app";
+    rev = version;
+    sha256 = "sha256-08gXEKm8udgNltRdqvAMFL0pDCWZu/kfl1xGQtZPBCc=";
   };
 
-  nativeBuildInputs = [ wrapGAppsHook makeWrapper imagemagick ];
-
-  propagatedBuildInputs = (with python3Packages; [
-      pygobject3
-      pycairo
-      requests
-      configparser
-    ]) ++ [
-      protonvpn-cli
-      gtk3
-      gobject-introspection
-      libnotify
-      libappindicator-gtk3
-    ];
+  strictDeps = false;
 
-  prePatch = ''
-    # if pkexec is used, we want to have more time to enter password
-    substituteInPlace linux_gui/services/login_service.py --replace 'timeout=8' 'timeout=30'
-  '';
+  nativeBuildInputs = [
+    gobject-introspection imagemagick wrapGAppsHook
+  ];
 
-  postInstall = ''
-    # wrap binaries with extra required path
-    wrapProgram "$out/bin/protonvpn-tray" --prefix PATH ":" ${extraPath}
-    wrapProgram "$out/bin/protonvpn-gui" --prefix PATH ":" ${extraPath}
+  propagatedBuildInputs = with python3Packages; [
+    protonvpn-nm-lib
+    psutil
+  ];
 
-    # install desktop files
-    mkdir -p $out/share/applications
-    cp "$desktopItem/share/applications/ProtonVPN.desktop" $out/share/applications/protonvpn-gui.desktop
-    cp "$trayDesktopItem/share/applications/ProtonVPN Tray.desktop" $out/share/applications/protonvpn-tray.desktop
+  buildInputs = [
+    gtk3 networkmanager webkitgtk
+  ];
 
-    # create icons
+  postFixup = ''
+    # Setting icons
     for size in 16 32 48 64 72 96 128 192 512 1024; do
       mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
-      convert -resize "$size"x"$size" \
-        linux_gui/resources/img/logo/protonvpn_logo.png \
-        $out/share/icons/hicolor/"$size"x"$size"/apps/protonvpn.png
+      convert -resize $size'x'$size \
+        protonvpn_gui/assets/icons/protonvpn-logo.png \
+        $out/share/icons/hicolor/$size'x'$size/apps/protonvpn.png
     done
+
+    install -Dm644 protonvpn.desktop -t $out/share/applications/
+    substituteInPlace $out/share/applications/protonvpn.desktop \
+      --replace 'protonvpn-logo' protonvpn
   '';
 
-  # no tests
+  # Project has a dummy test
   doCheck = false;
 
   meta = with lib; {
     description = "Linux GUI for ProtonVPN, written in Python";
-    homepage = "https://github.com/ProtonVPN/linux-gui";
-    maintainers = with maintainers; [ offline ];
+    homepage = "https://github.com/ProtonVPN/linux-app";
+    maintainers = with maintainers; [ offline wolfangaukang ];
     license = licenses.gpl3Plus;
     platforms = platforms.linux;
-    mainProgram = "protonvpn-gui";
   };
 }