2022-02-25 21:55:29 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapGAppsHook
|
2022-05-27 15:08:50 +01:00
|
|
|
, gdk-pixbuf
|
2022-02-25 21:55:29 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, imagemagick
|
2022-05-27 15:08:50 +01: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 21:44:55 +01:00
|
|
|
|
2022-02-25 21:55:29 +00:00
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "protonvpn-gui";
|
2022-06-07 20:03:11 +01:00
|
|
|
version = "1.10.0";
|
2020-07-14 21:44:55 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-23 05:40:39 +01:00
|
|
|
owner = "ProtonVPN";
|
|
|
|
repo = "linux-app";
|
2022-06-07 20:03:11 +01:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "sha256-6IRkJKtdQQ9Yixb9CkT3tGNY0MYFZyvz1/6buZo5eYU=";
|
2020-07-14 21:44:55 +01:00
|
|
|
};
|
|
|
|
|
2021-10-23 05:40:39 +01:00
|
|
|
nativeBuildInputs = [
|
2022-05-27 15:08:50 +01:00
|
|
|
gdk-pixbuf
|
2022-02-25 21:55:29 +00:00
|
|
|
gobject-introspection
|
|
|
|
imagemagick
|
|
|
|
wrapGAppsHook
|
2021-10-23 05:40:39 +01:00
|
|
|
];
|
2020-07-14 21:44:55 +01:00
|
|
|
|
2022-02-25 21:55:29 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-10-23 05:40:39 +01:00
|
|
|
protonvpn-nm-lib
|
|
|
|
psutil
|
|
|
|
];
|
2020-07-14 21:44:55 +01:00
|
|
|
|
2021-10-23 05:40:39 +01:00
|
|
|
buildInputs = [
|
2022-02-25 21:55:29 +00:00
|
|
|
# To avoid enabling strictDeps = false (#56943)
|
|
|
|
gobject-introspection
|
2022-05-27 15:08:50 +01:00
|
|
|
librsvg
|
2022-02-25 21:55:29 +00:00
|
|
|
pango
|
|
|
|
webkitgtk
|
|
|
|
] ++ lib.optionals withIndicator [ libappindicator-gtk3 ];
|
2020-07-14 21:44:55 +01:00
|
|
|
|
2022-02-25 21:55:29 +00:00
|
|
|
postInstall = ''
|
2021-10-23 05:40:39 +01:00
|
|
|
# Setting icons
|
2020-07-14 21:44:55 +01: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 05:40:39 +01: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 21:44:55 +01:00
|
|
|
done
|
2021-10-23 05:40:39 +01:00
|
|
|
|
|
|
|
install -Dm644 protonvpn.desktop -t $out/share/applications/
|
|
|
|
substituteInPlace $out/share/applications/protonvpn.desktop \
|
|
|
|
--replace 'protonvpn-logo' protonvpn
|
2020-07-14 21:44:55 +01:00
|
|
|
'';
|
|
|
|
|
2021-10-23 05:40:39 +01:00
|
|
|
# Project has a dummy test
|
2021-02-05 08:38:20 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-07-14 21:44:55 +01:00
|
|
|
meta = with lib; {
|
2022-02-25 21:55:29 +00:00
|
|
|
description = "Official ProtonVPN Linux app";
|
2021-10-23 05:40:39 +01:00
|
|
|
homepage = "https://github.com/ProtonVPN/linux-app";
|
2022-02-25 21:55:29 +00:00
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
2021-10-08 17:23:34 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2020-07-14 21:44:55 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|