vere: remove dependency on nix-store path for static darwin binary

Poached from @eglaysher's work in #3380.
This commit is contained in:
Brendan Hay 2020-11-04 20:47:33 +01:00
parent 9e1f75da64
commit 8d0a65bb6e
No known key found for this signature in database
GPG Key ID: 80E915C54A7C457D

View File

@ -54,6 +54,12 @@ in stdenv.mkDerivation {
mkdir -p $out/bin
cp ./build/urbit $out/bin/urbit
cp ./build/urbit-worker $out/bin/urbit-worker
'' + lib.optionalString (stdenv.isDarwin && enableStatic) ''
# Hack stolen from //nixpkgs/pkgs/stdenv/darwin/portable-libsystem.sh
find "$out/bin" -exec \
install_name_tool -change \
${stdenv.cc.libc}/lib/libSystem.B.dylib \
/usr/lib/libSystem.B.dylib {} \;
'';
CFLAGS = [ (if enableDebug then "-O0" else "-O3") "-g" ]