top-level/stage.nix: add static overlay
Adds the static overlay that can be used to build Nixpkgs statically. Can be used like: nix build pkgsStatic.hello Not all packages build, as some rely on dynamic linking.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# Make /nix/store/...-libSystem “portable” for static built binaries.
|
||||
# This just rewrites everything in $1/bin to use the
|
||||
# /usr/lib/libSystem.B.dylib that is provided on every macOS system.
|
||||
|
||||
fixupOutputHooks+=('fixLibsystemRefs $prefix')
|
||||
|
||||
fixLibsystemRefs() {
|
||||
find "$1/bin" \
|
||||
-exec install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
|
||||
}
|
||||
Reference in New Issue
Block a user