Files
nixpkgs/pkgs/by-name/gp/gpclient/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

65 lines
1.4 KiB
Nix

{
rustPlatform,
glib-networking,
gpauth,
makeWrapper,
openconnect,
openssl,
perl,
pkg-config,
vpnc-scripts,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
pname = "gpclient";
version = "2.4.1";
src = fetchFromGitHub {
owner = "yuezk";
repo = "GlobalProtect-openconnect";
rev = "v${version}";
hash = "sha256-MY4JvftrC6sR8M0dFvnGZOkvHIhPRcyct9AG/8527gw=";
};
inherit (gpauth) meta;
buildAndTestSubdir = "apps/gpclient";
cargoHash = "sha256-8LSGuRnWRWeaY6t25GdZ2y4hGIJ+mP3UBXRjcvPuD6U=";
nativeBuildInputs = [
perl
makeWrapper
pkg-config
];
buildInputs = [
gpauth
openconnect
openssl
glib-networking
];
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
'';
preFixup = ''
wrapProgram "$out/bin/gpclient" \
--prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules
'';
postFixup = ''
substituteInPlace $out/share/applications/gpgui.desktop \
--replace-fail /usr/bin/gpclient gpclient
'';
}