biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / networking / protonvpn-gui / legacy.nix
blob7464a279cf8a9a8c0f0ad6cfba59dd0ea333fdb8
1 { lib
2 , buildPythonApplication
3 , fetchFromGitHub
4 , setuptools
5 , wrapGAppsHook
6 , gdk-pixbuf
7 , glib-networking
8 , gobject-introspection
9 , imagemagick
10 , librsvg
11 , pango
12 , python3
13 , webkitgtk
14 # Python libs
15 , protonvpn-nm-lib
16 , psutil
17 # Optionals
18 , withIndicator ? true
19 , libappindicator-gtk3 }:
21 buildPythonApplication rec {
22   pname = "protonvpn-gui";
23   version = "1.12.0";
24   pyproject = true;
26   src = fetchFromGitHub {
27     owner = "ProtonVPN";
28     repo = "linux-app";
29     rev = "refs/tags/${version}";
30     sha256 = "sha256-MPS4d/yNkccsc/j85h7/4k4xL8uSCvhj/9JWPa7ezLY=";
31   };
33   nativeBuildInputs = [
34     gdk-pixbuf
35     gobject-introspection
36     imagemagick
37     setuptools
38     wrapGAppsHook
39   ];
41   propagatedBuildInputs = [
42     glib-networking # needed for the login captcha
43     protonvpn-nm-lib
44     psutil
45   ];
47   buildInputs = [
48     librsvg
49     pango
50     webkitgtk
51   ] ++ lib.optionals withIndicator [ libappindicator-gtk3 ];
53   postInstall = ''
54     # Setting icons
55     for size in 16 32 48 64 72 96 128 192 512 1024; do
56       mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
57       convert -resize $size'x'$size \
58         protonvpn_gui/assets/icons/protonvpn-logo.png \
59         $out/share/icons/hicolor/$size'x'$size/apps/protonvpn.png
60     done
62     install -Dm644 protonvpn.desktop -t $out/share/applications/
63     chmod 644 $out/${python3.sitePackages}/protonvpn_gui/assets/icons/plus-server.png
64     substituteInPlace $out/share/applications/protonvpn.desktop \
65       --replace 'protonvpn-logo' protonvpn
66   '';
68   # Project has a dummy test
69   doCheck = false;
71   meta = with lib; {
72     description = "Official ProtonVPN Linux app";
73     homepage = "https://github.com/ProtonVPN/linux-app";
74     maintainers = with maintainers; [ wolfangaukang ];
75     license = licenses.gpl3Plus;
76     mainProgram = "protonvpn";
77     platforms = platforms.linux;
78   };