protonvpn-gui: build new official client
This commit is contained in:
parent
a26ebd9835
commit
352785051d
@ -1,90 +1,54 @@
|
|||||||
{ lib, fetchFromGitHub, makeDesktopItem, makeWrapper, imagemagick
|
{ lib, fetchFromGitHub, gobject-introspection, imagemagick,
|
||||||
, python3Packages, wrapGAppsHook, protonvpn-cli, gtk3, pango
|
wrapGAppsHook, python3Packages, gtk3, networkmanager, webkitgtk }:
|
||||||
, gobject-introspection, libnotify, libappindicator-gtk3
|
|
||||||
, procps, openvpn }:
|
|
||||||
|
|
||||||
let
|
python3Packages.buildPythonApplication rec {
|
||||||
extraPath = lib.makeBinPath [ procps openvpn ];
|
|
||||||
|
|
||||||
in python3Packages.buildPythonApplication rec {
|
|
||||||
pname = "protonvpn-linux-gui";
|
pname = "protonvpn-linux-gui";
|
||||||
version = "2.1.1";
|
version = "1.4.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "protonvpn";
|
owner = "ProtonVPN";
|
||||||
repo = "linux-gui";
|
repo = "linux-app";
|
||||||
rev = "v${version}";
|
rev = version;
|
||||||
sha256 = "avo5/2eq53HSHCnnjtxrsmpURtHvxmLZn2BxActImGY=";
|
sha256 = "sha256-08gXEKm8udgNltRdqvAMFL0pDCWZu/kfl1xGQtZPBCc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
strictDeps = false;
|
||||||
name = "ProtonVPN";
|
|
||||||
desktopName = "ProtonVPN GUI";
|
|
||||||
type = "Application";
|
|
||||||
exec = "protonvpn-gui";
|
|
||||||
icon = "protonvpn";
|
|
||||||
categories = "Network;";
|
|
||||||
terminal = "false";
|
|
||||||
};
|
|
||||||
|
|
||||||
trayDesktopItem = makeDesktopItem {
|
nativeBuildInputs = [
|
||||||
name = "ProtonVPN Tray";
|
gobject-introspection imagemagick wrapGAppsHook
|
||||||
desktopName = "ProtonVPN Tray";
|
];
|
||||||
type = "Application";
|
|
||||||
exec = "protonvpn-tray";
|
|
||||||
icon = "protonvpn";
|
|
||||||
categories = "Network;";
|
|
||||||
terminal = "false";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ wrapGAppsHook makeWrapper imagemagick ];
|
propagatedBuildInputs = with python3Packages; [
|
||||||
|
protonvpn-nm-lib
|
||||||
|
psutil
|
||||||
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = (with python3Packages; [
|
buildInputs = [
|
||||||
pygobject3
|
gtk3 networkmanager webkitgtk
|
||||||
pycairo
|
];
|
||||||
requests
|
|
||||||
configparser
|
|
||||||
]) ++ [
|
|
||||||
protonvpn-cli
|
|
||||||
gtk3
|
|
||||||
gobject-introspection
|
|
||||||
libnotify
|
|
||||||
libappindicator-gtk3
|
|
||||||
];
|
|
||||||
|
|
||||||
prePatch = ''
|
postFixup = ''
|
||||||
# if pkexec is used, we want to have more time to enter password
|
# Setting icons
|
||||||
substituteInPlace linux_gui/services/login_service.py --replace 'timeout=8' 'timeout=30'
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
# wrap binaries with extra required path
|
|
||||||
wrapProgram "$out/bin/protonvpn-tray" --prefix PATH ":" ${extraPath}
|
|
||||||
wrapProgram "$out/bin/protonvpn-gui" --prefix PATH ":" ${extraPath}
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# create icons
|
|
||||||
for size in 16 32 48 64 72 96 128 192 512 1024; do
|
for size in 16 32 48 64 72 96 128 192 512 1024; do
|
||||||
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
||||||
convert -resize "$size"x"$size" \
|
convert -resize $size'x'$size \
|
||||||
linux_gui/resources/img/logo/protonvpn_logo.png \
|
protonvpn_gui/assets/icons/protonvpn-logo.png \
|
||||||
$out/share/icons/hicolor/"$size"x"$size"/apps/protonvpn.png
|
$out/share/icons/hicolor/$size'x'$size/apps/protonvpn.png
|
||||||
done
|
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;
|
doCheck = false;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Linux GUI for ProtonVPN, written in Python";
|
description = "Linux GUI for ProtonVPN, written in Python";
|
||||||
homepage = "https://github.com/ProtonVPN/linux-gui";
|
homepage = "https://github.com/ProtonVPN/linux-app";
|
||||||
maintainers = with maintainers; [ offline ];
|
maintainers = with maintainers; [ offline wolfangaukang ];
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
mainProgram = "protonvpn-gui";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user