mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-20 06:56:17 -05:00
Remove linux-only component from darwin build (#633)
* feat: remove linux-only component from darwin build * fix: rewrite paths after copy files
This commit is contained in:
1 parent
0f7d065628
commit
66f48b3ff6
1 file changed
+38
-24
@@ -90,11 +90,12 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
rewriteSourceInstallPaths = ''
|
rewriteSourceInstallPaths = ''
|
||||||
substituteInPlace $out/share/applications/gpgui.desktop \
|
|
||||||
--replace-fail /usr/bin/gpclient /run/current-system/sw/bin/gpclient
|
|
||||||
|
|
||||||
substituteInPlace $out/libexec/gpclient/hipreport.sh \
|
substituteInPlace $out/libexec/gpclient/hipreport.sh \
|
||||||
--replace-fail /usr/bin/gpclient $out/bin/gpclient
|
--replace-fail /usr/bin/gpclient $out/bin/gpclient
|
||||||
|
''
|
||||||
|
+ lib.optionalString pkgs.stdenv.isLinux ''
|
||||||
|
substituteInPlace $out/share/applications/gpgui.desktop \
|
||||||
|
--replace-fail /usr/bin/gpclient /run/current-system/sw/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
|
||||||
@@ -136,10 +137,21 @@
|
|||||||
|
|
||||||
fromSource = naersk'.buildPackage {
|
fromSource = naersk'.buildPackage {
|
||||||
inherit pname version src;
|
inherit pname version src;
|
||||||
|
name = "globalprotect-openconnect";
|
||||||
|
|
||||||
# Must be set to true to avoid issues with the Tauri build process
|
# Must be set to true to avoid issues with the Tauri build process
|
||||||
singleStep = true;
|
singleStep = true;
|
||||||
|
|
||||||
|
cargoBuildOptions =
|
||||||
|
old:
|
||||||
|
old
|
||||||
|
++ lib.optionals pkgs.stdenv.isDarwin [
|
||||||
|
"-p"
|
||||||
|
"gpclient"
|
||||||
|
"-p"
|
||||||
|
"gpauth"
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = linuxBuildInputs;
|
buildInputs = linuxBuildInputs;
|
||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
@@ -167,25 +179,32 @@
|
|||||||
|
|
||||||
substituteInPlace crates/common/src/constants.rs \
|
substituteInPlace crates/common/src/constants.rs \
|
||||||
--replace-fail /usr/bin/gpclient $out/bin/gpclient \
|
--replace-fail /usr/bin/gpclient $out/bin/gpclient \
|
||||||
--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/
|
--replace-fail /opt/homebrew/ $out/
|
||||||
|
''
|
||||||
|
+ lib.optionalString pkgs.stdenv.isLinux ''
|
||||||
|
substituteInPlace crates/common/src/constants.rs \
|
||||||
|
--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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
cp -r packaging/files/usr/libexec $out/libexec
|
||||||
|
''
|
||||||
|
+ lib.optionalString pkgs.stdenv.isLinux ''
|
||||||
# Copy the prebuilt gpgui binary to the output bin directory
|
# Copy the prebuilt gpgui binary to the output bin directory
|
||||||
cp ${gpgui}/gpgui $out/bin/gpgui
|
cp ${gpgui}/gpgui $out/bin/gpgui
|
||||||
chmod +x $out/bin/gpgui
|
chmod +x $out/bin/gpgui
|
||||||
|
|
||||||
cp -r packaging/files/usr/share $out/share
|
cp -r packaging/files/usr/share $out/share
|
||||||
cp -r packaging/files/usr/lib $out/lib
|
cp -r packaging/files/usr/lib $out/lib
|
||||||
cp -r packaging/files/usr/libexec $out/libexec
|
|
||||||
|
|
||||||
${rewriteSourceInstallPaths}
|
|
||||||
${installNixosPolkitRule}
|
${installNixosPolkitRule}
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
|
${rewriteSourceInstallPaths}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -225,11 +244,7 @@
|
|||||||
binaryName:
|
binaryName:
|
||||||
pkgs.buildFHSEnv {
|
pkgs.buildFHSEnv {
|
||||||
name = binaryName;
|
name = binaryName;
|
||||||
targetPkgs =
|
targetPkgs = pkgs: [ prebuiltFiles ] ++ linuxBuildInputs ++ linuxRuntimeDependencies;
|
||||||
pkgs:
|
|
||||||
[ prebuiltFiles ]
|
|
||||||
++ linuxBuildInputs
|
|
||||||
++ linuxRuntimeDependencies;
|
|
||||||
runScript = "/usr/bin/${binaryName}";
|
runScript = "/usr/bin/${binaryName}";
|
||||||
profile = ''
|
profile = ''
|
||||||
export PATH=/run/wrappers/bin:$PATH
|
export PATH=/run/wrappers/bin:$PATH
|
||||||
@@ -358,17 +373,16 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
# For `nix build`
|
# For `nix build`
|
||||||
packages =
|
packages = {
|
||||||
{
|
fromSource = fromSource;
|
||||||
fromSource = fromSource;
|
}
|
||||||
}
|
// lib.optionalAttrs pkgs.stdenv.isLinux {
|
||||||
// lib.optionalAttrs pkgs.stdenv.isLinux {
|
default = prebuilt;
|
||||||
default = prebuilt;
|
prebuilt = prebuilt;
|
||||||
prebuilt = prebuilt;
|
}
|
||||||
}
|
// lib.optionalAttrs (!pkgs.stdenv.isLinux) {
|
||||||
// lib.optionalAttrs (!pkgs.stdenv.isLinux) {
|
default = fromSource;
|
||||||
default = fromSource;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
apps.default = {
|
apps.default = {
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|||||||
Reference in new issue
Block a user