Unverified Commit ebe3ab4a authored by Gergő Gutyina's avatar Gergő Gutyina Committed by GitHub
Browse files

gpauth, gpclient: 2.4.6 -> 2.5.0; don't install .desktop on darwin; add...

gpauth, gpclient: 2.4.6 -> 2.5.0; don't install .desktop on darwin; add booxter as maintainer (#470816)
parents 077802fe 7e0afac3
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -7,22 +7,24 @@
  perl,
  webkitgtk_4_1,
  stdenv,
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
  pname = "gpauth";
  version = "2.4.6";
  version = "2.5.0";

  src = fetchFromGitHub {
    owner = "yuezk";
    repo = "GlobalProtect-openconnect";
    rev = "v${version}";
    hash = "sha256-AxerhMQBgEgeecKAhedokMdpra1C9iqhutPrdAQng6Q=";
    tag = "v${version}";
    hash = "sha256-dxRqf5iOlgJegeAqtTwoVqNHXU3eOse5eMYFknhAh2M=";
    fetchSubmodules = true;
  };

  buildAndTestSubdir = "apps/gpauth";

  cargoHash = "sha256-oPnBpwE8bdYgve1Dh64WNjWXClSRoHL5PVwrB1ovU6Y=";
  cargoHash = "sha256-VkDq98Y6uBSal7m4V9vjW1XermOPOWulo3Jo34QFRsA=";

  nativeBuildInputs = [
    perl
@@ -35,6 +37,8 @@ rustPlatform.buildRustPackage rec {
    webkitgtk_4_1
  ];

  passthru.updateScript = nix-update-script { };

  meta = {
    changelog = "https://github.com/${src.owner}/${src.repo}/blob/${src.rev}/changelog.md";
    description = "CLI for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method";
@@ -49,6 +53,7 @@ rustPlatform.buildRustPackage rec {
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [
      binary-eater
      booxter
      m1dugh
    ];
    platforms = with lib.platforms; linux ++ darwin;
+26 −11
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  glib-networking,
  stdenv,
  gpauth,
  makeWrapper,
  openconnect,
  autoconf,
  automake,
  libtool,
  openssl,
  perl,
  pkg-config,
@@ -13,6 +17,10 @@
  cairo,
  atk,
  gtk3,
  libxml2,
  p11-kit,
  lz4,
  gnutls,
}:

rustPlatform.buildRustPackage {
@@ -31,10 +39,14 @@ rustPlatform.buildRustPackage {
    perl
    makeWrapper
    pkg-config

    # used to build vendored openconnect
    autoconf
    automake
    libtool
  ];
  buildInputs = [
    gpauth
    openconnect
    openssl
    glib-networking
    glib
@@ -42,16 +54,24 @@ rustPlatform.buildRustPackage {
    cairo
    atk
    gtk3

    # used for vendored openconnect
    libxml2
    lz4
    p11-kit
    gnutls
  ];

  preConfigure = ''
    substituteInPlace crates/gpapi/src/lib.rs \
  postPatch = ''
    substituteInPlace crates/common/src/constants.rs \
      --replace-fail /usr/bin/gpauth ${gpauth}/bin/gpauth
    substituteInPlace crates/common/src/vpn_utils.rs \
    substituteInPlace crates/openconnect/src/vpn_utils.rs \
      --replace-fail /usr/sbin/vpnc-script ${vpnc-scripts}/bin/vpnc-script
    substituteInPlace packaging/files/usr/share/applications/gpgui.desktop \
      --replace-fail /usr/bin/gpclient gpclient
  '';

  postInstall = ''
  postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
    mkdir -p $out/share/applications
    cp packaging/files/usr/share/applications/gpgui.desktop $out/share/applications/gpgui.desktop
  '';
@@ -60,9 +80,4 @@ rustPlatform.buildRustPackage {
    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
  '';
}