summaryrefslogtreecommitdiffstats
path: root/pkgs/stdenv/darwin
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-12-04 21:17:22 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2018-12-04 21:56:03 -0600
commit6d90a8b8948185a3118faf183f29f4b8de294675 (patch)
tree06d034804c746bd863638cdeb08b63cc75cfb92d /pkgs/stdenv/darwin
parent53a67891ab1fefd3aceed07f173cdd33f549fc70 (diff)
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.
Diffstat (limited to 'pkgs/stdenv/darwin')
-rw-r--r--pkgs/stdenv/darwin/portable-libsystem.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/stdenv/darwin/portable-libsystem.sh b/pkgs/stdenv/darwin/portable-libsystem.sh
new file mode 100644
index 000000000000..27ae790fb5ab
--- /dev/null
+++ b/pkgs/stdenv/darwin/portable-libsystem.sh
@@ -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 {} \;
+}