mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 08:36:41 +01:00
Merge pull request #93276 from xtruder/pkgs/protonvpn-linux-gui/init
protonvpn-gui: init at 2.1.1
This commit is contained in:
commit
5e6bc32cbb
4 changed files with 112 additions and 69 deletions
|
@ -1,36 +0,0 @@
|
||||||
{ lib, fetchFromGitHub, python3Packages, openvpn, dialog, iptables }:
|
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
|
||||||
pname = "protonvpn-cli-ng";
|
|
||||||
version = "2.2.4";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "protonvpn";
|
|
||||||
repo = "${pname}";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "08yca0a0prrnrc7ir7ajd56yxvxpcs4m1k8f5kf273f5whgr7wzw";
|
|
||||||
};
|
|
||||||
|
|
||||||
propagatedBuildInputs = (with python3Packages; [
|
|
||||||
requests
|
|
||||||
docopt
|
|
||||||
setuptools
|
|
||||||
jinja2
|
|
||||||
pythondialog
|
|
||||||
]) ++ [
|
|
||||||
dialog
|
|
||||||
openvpn
|
|
||||||
iptables
|
|
||||||
];
|
|
||||||
|
|
||||||
# No tests
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Linux command-line client for ProtonVPN";
|
|
||||||
homepage = "https://github.com/protonvpn/protonvpn-cli-ng";
|
|
||||||
maintainers = with maintainers; [ jtcoolen jefflabonte ];
|
|
||||||
license = licenses.gpl3;
|
|
||||||
platforms = platforms.unix;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,43 +1,36 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, makeWrapper, coreutils
|
{ lib, fetchFromGitHub, python3Packages, openvpn, dialog, iptables }:
|
||||||
, openvpn, python, dialog, wget, update-resolv-conf }:
|
|
||||||
|
|
||||||
let
|
python3Packages.buildPythonApplication rec {
|
||||||
expectedUpdateResolvPath = "/etc/openvpn/update-resolv-conf";
|
pname = "protonvpn-linux-cli";
|
||||||
actualUpdateResolvePath = "${update-resolv-conf}/libexec/openvpn/update-resolv-conf";
|
version = "2.2.4";
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
name = "protonvpn-cli";
|
|
||||||
version = "1.1.2";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "ProtonVPN";
|
owner = "protonvpn";
|
||||||
repo = "protonvpn-cli";
|
repo = "linux-cli";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0xvflr8zf267n3dv63nkk4wjxhbckw56sqmyca3krf410vrd7zlv";
|
sha256 = "08yca0a0prrnrc7ir7ajd56yxvxpcs4m1k8f5kf273f5whgr7wzw";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
propagatedBuildInputs = (with python3Packages; [
|
||||||
|
requests
|
||||||
|
docopt
|
||||||
|
setuptools
|
||||||
|
jinja2
|
||||||
|
pythondialog
|
||||||
|
]) ++ [
|
||||||
|
dialog
|
||||||
|
openvpn
|
||||||
|
iptables
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
# No tests
|
||||||
mkdir -p "$out/bin"
|
doCheck = false;
|
||||||
substituteInPlace protonvpn-cli.sh \
|
|
||||||
--replace ${expectedUpdateResolvPath} ${actualUpdateResolvePath} \
|
|
||||||
--replace \$UID 0 \
|
|
||||||
--replace /etc/resolv.conf /dev/null \
|
|
||||||
--replace \
|
|
||||||
" echo \"Connecting...\"" \
|
|
||||||
" sed -ri 's@${expectedUpdateResolvPath}@${actualUpdateResolvePath}@g' \"\$openvpn_config\"; echo \"Connecting...\""
|
|
||||||
cp protonvpn-cli.sh "$out/bin/protonvpn-cli"
|
|
||||||
wrapProgram $out/bin/protonvpn-cli \
|
|
||||||
--prefix PATH : ${lib.makeBinPath [ coreutils openvpn python dialog wget update-resolv-conf ]}
|
|
||||||
ln -s "$out/bin/protonvpn-cli" "$out/bin/pvpn"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with lib; {
|
||||||
description = "ProtonVPN Command-Line Tool";
|
description = "Linux command-line client for ProtonVPN";
|
||||||
homepage = "https://github.com/ProtonVPN/protonvpn-cli";
|
homepage = "https://github.com/protonvpn/linux-cli";
|
||||||
maintainers = with maintainers; [ caugner ];
|
maintainers = with maintainers; [ jtcoolen jefflabonte ];
|
||||||
license = licenses.mit;
|
license = licenses.gpl3;
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
86
pkgs/applications/networking/protonvpn-gui/default.nix
Normal file
86
pkgs/applications/networking/protonvpn-gui/default.nix
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
{ lib, fetchFromGitHub, makeDesktopItem, makeWrapper, imagemagick
|
||||||
|
, python3Packages, wrapGAppsHook, protonvpn-cli, gtk3, pango
|
||||||
|
, gobject-introspection, libnotify, libappindicator-gtk3
|
||||||
|
, procps, openvpn }:
|
||||||
|
|
||||||
|
let
|
||||||
|
extraPath = lib.makeBinPath [ procps openvpn ];
|
||||||
|
|
||||||
|
in python3Packages.buildPythonApplication rec {
|
||||||
|
pname = "protonvpn-linux-gui";
|
||||||
|
version = "2.1.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";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ wrapGAppsHook makeWrapper imagemagick ];
|
||||||
|
|
||||||
|
propagatedBuildInputs = (with python3Packages; [
|
||||||
|
pygobject3
|
||||||
|
pycairo
|
||||||
|
requests
|
||||||
|
configparser
|
||||||
|
]) ++ [
|
||||||
|
protonvpn-cli
|
||||||
|
gtk3
|
||||||
|
gobject-introspection
|
||||||
|
libnotify
|
||||||
|
libappindicator-gtk3
|
||||||
|
];
|
||||||
|
|
||||||
|
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'
|
||||||
|
'';
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Linux GUI for ProtonVPN, written in Python.";
|
||||||
|
homepage = "https://github.com/ProtonVPN/linux-gui";
|
||||||
|
maintainers = with maintainers; [ offline ];
|
||||||
|
license = licenses.gpl3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
|
@ -22244,7 +22244,7 @@ in
|
||||||
|
|
||||||
protonvpn-cli = callPackage ../applications/networking/protonvpn-cli { };
|
protonvpn-cli = callPackage ../applications/networking/protonvpn-cli { };
|
||||||
|
|
||||||
protonvpn-cli-ng = callPackage ../applications/networking/protonvpn-cli-ng { };
|
protonvpn-gui = callPackage ../applications/networking/protonvpn-gui { };
|
||||||
|
|
||||||
ps2client = callPackage ../applications/networking/ps2client { };
|
ps2client = callPackage ../applications/networking/ps2client { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue