2022-02-25 21:55:29 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapGAppsHook
|
2022-05-27 14:08:50 +00:00
|
|
|
, gdk-pixbuf
|
2022-02-25 21:55:29 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, imagemagick
|
2022-05-27 14:08:50 +00:00
|
|
|
, librsvg
|
2022-02-25 21:55:29 +00:00
|
|
|
, pango
|
|
|
|
, webkitgtk
|
|
|
|
# Python libs
|
|
|
|
, protonvpn-nm-lib
|
|
|
|
, psutil
|
|
|
|
# Optionals
|
|
|
|
, withIndicator ? true
|
|
|
|
, libappindicator-gtk3 }:
|
2020-07-14 20:44:55 +00:00
|
|
|
|
2022-02-25 21:55:29 +00:00
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "protonvpn-gui";
|
2022-05-27 16:32:15 +00:00
|
|
|
version = "1.9.0";
|
2020-07-14 20:44:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-23 04:40:39 +00:00
|
|
|
owner = "ProtonVPN";
|
|
|
|
repo = "linux-app";
|
2022-05-27 16:32:15 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-+YLrIhe7kzQHPRk/3D1r56ESS1BdDxP1PFeNIg/kGLw=";
|
2020-07-14 20:44:55 +00:00
|
|
|
};
|
|
|
|
|
2021-10-23 04:40:39 +00:00
|
|
|
nativeBuildInputs = [
|
2022-05-27 14:08:50 +00:00
|
|
|
gdk-pixbuf
|
2022-02-25 21:55:29 +00:00
|
|
|
gobject-introspection
|
|
|
|
imagemagick
|
|
|
|
wrapGAppsHook
|
2021-10-23 04:40:39 +00:00
|
|
|
];
|
2020-07-14 20:44:55 +00:00
|
|
|
|
2022-02-25 21:55:29 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-10-23 04:40:39 +00:00
|
|
|
protonvpn-nm-lib
|
|
|
|
psutil
|
|
|
|
];
|
2020-07-14 20:44:55 +00:00
|
|
|
|
2021-10-23 04:40:39 +00:00
|
|
|
buildInputs = [
|
2022-02-25 21:55:29 +00:00
|
|
|
# To avoid enabling strictDeps = false (#56943)
|
|
|
|
gobject-introspection
|
2022-05-27 14:08:50 +00:00
|
|
|
librsvg
|
2022-02-25 21:55:29 +00:00
|
|
|
pango
|
|
|
|
webkitgtk
|
|
|
|
] ++ lib.optionals withIndicator [ libappindicator-gtk3 ];
|
2020-07-14 20:44:55 +00:00
|
|
|
|
2022-02-25 21:55:29 +00:00
|
|
|
postInstall = ''
|
2021-10-23 04:40:39 +00:00
|
|
|
# Setting icons
|
2020-07-14 20:44:55 +00:00
|
|
|
for size in 16 32 48 64 72 96 128 192 512 1024; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
2021-10-23 04:40:39 +00:00
|
|
|
convert -resize $size'x'$size \
|
|
|
|
protonvpn_gui/assets/icons/protonvpn-logo.png \
|
|
|
|
$out/share/icons/hicolor/$size'x'$size/apps/protonvpn.png
|
2020-07-14 20:44:55 +00:00
|
|
|
done
|
2021-10-23 04:40:39 +00:00
|
|
|
|
|
|
|
install -Dm644 protonvpn.desktop -t $out/share/applications/
|
|
|
|
substituteInPlace $out/share/applications/protonvpn.desktop \
|
|
|
|
--replace 'protonvpn-logo' protonvpn
|
2020-07-14 20:44:55 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-23 04:40:39 +00:00
|
|
|
# Project has a dummy test
|
2021-02-05 08:38:20 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-07-14 20:44:55 +00:00
|
|
|
meta = with lib; {
|
2022-02-25 21:55:29 +00:00
|
|
|
description = "Official ProtonVPN Linux app";
|
2021-10-23 04:40:39 +00:00
|
|
|
homepage = "https://github.com/ProtonVPN/linux-app";
|
2022-02-25 21:55:29 +00:00
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
2021-10-08 16:23:34 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-07-14 20:44:55 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|