feat: add HIP report generation functionality and related dependencies

This commit is contained in:
Kevin Yue committed 2025-12-22 23:16:31 +08:00
1 parent f398ccadb7
commit 7d87442f73
49 files changed
+2757 -1176

No files matched your search

+24 -4
View File
@@ -4,6 +4,7 @@
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
self.submodules = true;
};
outputs =
@@ -37,7 +38,7 @@
gpgui = pkgs.fetchzip {
url = "https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v${version}/gpgui_${cpu}.bin.tar.xz";
hash = "sha256-Cvy/ca2Q4LdxX7Z9KzuQy6t6FDMcaSyyyjF/YCnZeeM=";
hash = "sha256-cHjGq2dywjo7fBxcGxnSrGnyh+AbEN1yEQ+Ps1uXIBI=";
};
in
{
@@ -53,7 +54,14 @@
buildInputs =
with pkgs;
[
openconnect
vpnc-scripts
libxml2
zlib
lz4
gnutls
p11-kit
nettle
gmp
]
++ lib.optionals stdenv.isLinux [
glib
@@ -64,7 +72,12 @@
nativeBuildInputs =
with pkgs;
[ ]
[
autoconf
automake
libtool
pkg-config
]
++ lib.optionals stdenv.isLinux [
autoPatchelfHook
];
@@ -82,6 +95,7 @@
postPatch = ''
substituteInPlace crates/openconnect/src/vpn_utils.rs \
--replace-fail /etc/vpnc/vpnc-script ${pkgs.vpnc-scripts}/bin/vpnc-script \
--replace-fail /usr/libexec/gpclient/hipreport.sh $out/libexec/gpclient/hipreport.sh \
--replace-fail /usr/lib/openconnect/hipreport.sh ${pkgs.openconnect}/libexec/openconnect/hipreport.sh
substituteInPlace crates/common/src/constants.rs \
@@ -89,7 +103,8 @@
--replace-fail /usr/bin/gpservice $out/bin/gpservice \
--replace-fail /usr/bin/gpgui-helper $out/bin/gpgui-helper \
--replace-fail /usr/bin/gpgui $out/bin/gpgui \
--replace-fail /usr/bin/gpauth $out/bin/gpauth
--replace-fail /usr/bin/gpauth $out/bin/gpauth \
--replace-fail /opt/homebrew/ $out/
'';
};
@@ -100,6 +115,7 @@
cp -r packaging/files/usr/share $out/share
cp -r packaging/files/usr/lib $out/lib
cp -r packaging/files/usr/libexec $out/libexec
# Change the `/usr/bin/gpclient` path in the desktop file
substituteInPlace $out/share/applications/gpgui.desktop \
@@ -108,9 +124,13 @@
substituteInPlace $out/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
--replace-fail /usr/bin/gpclient $out/bin/gpclient
substituteInPlace $out/libexec/gpclient/hipreport.sh \
--replace-fail /usr/bin/gpclient $out/bin/gpclient
# Change the `/usr/bin/gpservice` path in the polkit policy file
substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \
--replace-fail /usr/bin/gpservice $out/bin/gpservice
'';
};