fix: match Nix installer paths to packaged helpers

This commit is contained in:
Kevin Yue committed 2026-10-02 01:47:28 +08:00
1 parent b750cfbf16
commit dcdedf3e8b
1 file changed
+24 -13
+24 -13
View File
@@ -143,13 +143,14 @@
--replace-fail /usr/bin/gpclient $out/bin/gpclient --replace-fail /usr/bin/gpclient $out/bin/gpclient
substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \ substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \
--replace-fail /usr/bin/gpservice $out/bin/gpservice \ --replace-fail /usr/bin/gpservice $out/bin/gpservice
--replace-fail /usr/libexec/gpclient/gp-vpnc-script-installer ${prebuiltFiles}/libexec/gpclient/gp-vpnc-script-installer
if [ -f ${prebuiltFiles}/libexec/gpclient/gp-hip-script-installer ]; then for installer in gp-vpnc-script-installer gp-hip-script-installer; do
substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \ if [ -x "${prebuiltFiles}/libexec/gpclient/$installer" ]; then
--replace-fail /usr/libexec/gpclient/gp-hip-script-installer ${prebuiltFiles}/libexec/gpclient/gp-hip-script-installer substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \
fi --replace-fail "/usr/libexec/gpclient/$installer" "${prebuiltFiles}/libexec/gpclient/$installer"
fi
done
if [ -f $out/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down ]; then if [ -f $out/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down ]; then
substituteInPlace $out/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \ substituteInPlace $out/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
@@ -324,11 +325,15 @@
done < <(${pkgs.coreutils}/bin/env --null) done < <(${pkgs.coreutils}/bin/env --null)
gui_path="/run/wrappers/bin:''${PATH:-}" gui_path="/run/wrappers/bin:''${PATH:-}"
systemd_run_args+=( systemd_run_args+=("--setenv=PATH=$gui_path")
"--setenv=PATH=$gui_path" for helper in \
"--setenv=GP_VPNC_SCRIPT_INSTALLER_BINARY=${prebuiltFiles}/libexec/gpclient/gp-vpnc-script-installer" GP_VPNC_SCRIPT_INSTALLER_BINARY=gp-vpnc-script-installer \
"--setenv=GP_HIP_SCRIPT_INSTALLER_BINARY=${prebuiltFiles}/libexec/gpclient/gp-hip-script-installer" GP_HIP_SCRIPT_INSTALLER_BINARY=gp-hip-script-installer; do
) helper_path="${prebuiltFiles}/libexec/gpclient/''${helper#*=}"
if [ -x "$helper_path" ]; then
systemd_run_args+=("--setenv=''${helper%%=*}=$helper_path")
fi
done
exec ${pkgs.systemd}/bin/systemd-run \ exec ${pkgs.systemd}/bin/systemd-run \
"''${systemd_run_args[@]}" \ "''${systemd_run_args[@]}" \
@@ -347,8 +352,14 @@
runScript = "/usr/bin/${binaryName}"; runScript = "/usr/bin/${binaryName}";
profile = '' profile = ''
export PATH=/run/wrappers/bin:$PATH export PATH=/run/wrappers/bin:$PATH
export GP_VPNC_SCRIPT_INSTALLER_BINARY='${prebuiltFiles}/libexec/gpclient/gp-vpnc-script-installer' for helper in \
export GP_HIP_SCRIPT_INSTALLER_BINARY='${prebuiltFiles}/libexec/gpclient/gp-hip-script-installer' GP_VPNC_SCRIPT_INSTALLER_BINARY=gp-vpnc-script-installer \
GP_HIP_SCRIPT_INSTALLER_BINARY=gp-hip-script-installer; do
helper_path="${prebuiltFiles}/libexec/gpclient/''${helper#*=}"
if [ -x "$helper_path" ]; then
export "''${helper%%=*}=$helper_path"
fi
done
${extraProfile} ${extraProfile}
''; '';
extraBwrapArgs = [ extraBwrapArgs = [