geph: fix scripts and dependencies in env
This commit is contained in:
@@ -2,16 +2,21 @@
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
makeBinaryWrapper,
|
||||
pkg-config,
|
||||
openssl,
|
||||
rust-jemalloc-sys-unprefixed,
|
||||
sqlite,
|
||||
bash,
|
||||
coreutils,
|
||||
iproute2,
|
||||
iptables,
|
||||
nix-update-script,
|
||||
}:
|
||||
let
|
||||
binPath = lib.makeBinPath [
|
||||
bash
|
||||
coreutils
|
||||
iproute2
|
||||
iptables
|
||||
];
|
||||
@@ -32,9 +37,16 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
postPatch = ''
|
||||
substituteInPlace binaries/geph5-client/src/vpn/*.sh \
|
||||
--replace-fail 'PATH=' 'PATH=${binPath}:'
|
||||
|
||||
substituteInPlace binaries/geph5-client/src/vpn/linux.rs \
|
||||
--replace-fail 'Command::new("sh")' 'Command::new("${bash}/bin/sh")' \
|
||||
--replace-fail '/usr/bin/env ' '${lib.getExe' coreutils "env"} '
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
nativeBuildInputs = [
|
||||
makeBinaryWrapper
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
@@ -64,6 +76,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
"--skip=tests::ping_pong"
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
for program in $out/bin/*; do
|
||||
wrapProgram "$program" --prefix PATH : ${binPath}
|
||||
done
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [
|
||||
"--version-regex"
|
||||
|
||||
Reference in New Issue
Block a user