globalprotect-openconnect: add core logic and packages for 2.x releases

The GUI of GlobalProtect-openconnect is unfree software, while the CLI is
licensed as GPLv3-only. This packaging work focuses on the CLI, and
components required for the CLI.

Link: https://github.com/yuezk/GlobalProtect-openconnect
Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
This commit is contained in:
Rahul Rameshbabu 2024-06-01 14:31:11 -07:00 committed by Rahul Rameshbabu
parent b6a158f7e4
commit 156fe9a898
No known key found for this signature in database
GPG Key ID: FF247B3E5411387B
3 changed files with 95 additions and 1 deletions

View File

@ -473,7 +473,10 @@
- The `isync` package has been updated to version `1.5.0`, which introduces some breaking changes. See the [compatibility concerns](https://sourceforge.net/projects/isync/files/isync/1.5.0/) for more details.
- Legacy package `globalprotect-openconnect` 1.x and related module
`globalprotect-vpn` were dropped.
`globalprotect-vpn` were dropped. Two new packages `gpauth` and `gpclient`
from the 2.x version of the GlobalProtect-openconnect project are added in its
place. The GUI components related to the project are non-free and not
packaged.
## Other Notable Changes {#sec-release-24.11-notable-changes}

View File

@ -0,0 +1,50 @@
{
rustPlatform,
lib,
fetchFromGitHub,
libsoup,
openssl,
pkg-config,
perl,
webkitgtk,
}:
rustPlatform.buildRustPackage rec {
pname = "gpauth";
version = "2.3.7";
src = fetchFromGitHub {
owner = "yuezk";
repo = "GlobalProtect-openconnect";
rev = "v${version}";
hash = "sha256-Zr888II65bUjrbStZfD0AYCXKY6VdKVJHQhbKwaY3is=";
};
buildAndTestSubdir = "apps/gpauth";
cargoHash = "sha256-AuYw8CC0bMJzIJJQXhcQajQ4SACz4aKv6rG4HMq7U18=";
nativeBuildInputs = [
perl
pkg-config
];
buildInputs = [
libsoup
openssl
webkitgtk
];
meta = with lib; {
changelog = "https://github.com/${src.owner}/${src.repo}/blob/${src.rev}/changelog.md";
description = "A CLI for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method";
longDescription = ''
A CLI for GlobalProtect VPN, based on OpenConnect, supports the SSO
authentication method. Inspired by gp-saml-gui.
The CLI version is always free and open source in this repo. It has almost
the same features as the GUI version.
'';
homepage = "https://github.com/${src.owner}/${src.repo}";
license = with licenses; [ gpl3Only ];
maintainers = with maintainers; [ binary-eater ];
};
}

View File

@ -0,0 +1,41 @@
{
rustPlatform,
gpauth,
openconnect,
openssl,
perl,
vpnc-scripts,
}:
rustPlatform.buildRustPackage rec {
pname = "gpclient";
inherit (gpauth) version src meta;
buildAndTestSubdir = "apps/gpclient";
cargoHash = "sha256-aJYFBvVrj1n2+9WLLBH5WTRRzTle19LsdJ2DielJYik=";
nativeBuildInputs = [ perl ];
buildInputs = [
gpauth
openconnect
openssl
];
preConfigure = ''
substituteInPlace crates/gpapi/src/lib.rs \
--replace-fail /usr/bin/gpauth ${gpauth}/bin/gpauth
substituteInPlace crates/common/src/vpn_utils.rs \
--replace-fail /usr/sbin/vpnc-script ${vpnc-scripts}/bin/vpnc-script
'';
postInstall = ''
mkdir -p $out/share/applications
cp packaging/files/usr/share/applications/gpgui.desktop $out/share/applications/gpgui.desktop
'';
postFixup = ''
substituteInPlace $out/share/applications/gpgui.desktop \
--replace-fail /usr/bin/gpclient $out/bin/gpclient
'';
}