Unverified Commit 156fe9a8 authored by Rahul Rameshbabu's avatar Rahul Rameshbabu Committed by Rahul Rameshbabu
Browse files

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: default avatarRahul Rameshbabu <sergeantsagara@protonmail.com>
parent b6a158f7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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}

+50 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+41 −0
Original line number Diff line number Diff line
{
  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
  '';
}