summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-08-28 21:14:59 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-08-28 23:25:11 +0200
commit5a28fd660a3f6eff6e6b53ecf787577ae271201a (patch)
treebc0c213e243dd4e5ea8d0c928eaa4b72bc5e6e59
parentcc1bfbd9a7f0fe7f7c4f0dec81990b5ce7d6cff3 (diff)
downloadnixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.tar
nixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.tar.gz
nixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.tar.bz2
nixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.tar.lz
nixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.tar.xz
nixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.tar.zst
nixlib-5a28fd660a3f6eff6e6b53ecf787577ae271201a.zip
darwin-frameworks: move fixup setup-hook
-rw-r--r--pkgs/build-support/setup-hooks/fix-darwin-frameworks.sh31
-rw-r--r--pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh33
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 33 insertions, 33 deletions
diff --git a/pkgs/build-support/setup-hooks/fix-darwin-frameworks.sh b/pkgs/build-support/setup-hooks/fix-darwin-frameworks.sh
deleted file mode 100644
index cf8416c0838d..000000000000
--- a/pkgs/build-support/setup-hooks/fix-darwin-frameworks.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-# On macOS, frameworks are linked to the system CoreFoundation but
-# dynamic libraries built with nix use a pure version of CF this
-# causes segfaults for binaries that depend on it at runtime.  This
-# can be solved in two ways.
-# 1. Rewrite references to the pure CF using this setup hook, this
-# works for the simple case but this can still cause problems if other
-# dependencies (eg. python) use the pure CF.
-# 2. Create a wrapper for the binary that sets DYLD_FRAMEWORK_PATH to
-# /System/Library/Frameworks.  This will make everything load the
-# system's CoreFoundation framework while still keeping the
-# dependencies pure for other packages.
-
-fixupOutputHooks+=('fixDarwinFrameworksIn $prefix')
-
-fixDarwinFrameworks() {
-    local systemPrefix='/System/Library/Frameworks'
-
-    for fn in "$@"; do
-        if [ -L "$fn" ]; then continue; fi
-        echo "$fn: fixing dylib"
-
-        for framework in $(otool -L "$fn" | awk '/CoreFoundation\.framework/ {print $1}'); do
-          install_name_tool -change "$framework" "$systemPrefix/CoreFoundation.framework/Versions/A/CoreFoundation" "$fn" >&2
-        done
-    done
-}
-
-fixDarwinFrameworksIn() {
-    local dir="$1"
-    fixDarwinFrameworks $(find "$dir" -name "*.dylib")
-}
diff --git a/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
index 9d96a4adbaa1..04d8e878f4f7 100644
--- a/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
+++ b/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
@@ -1,3 +1,36 @@
+# On macOS, frameworks are linked to the system CoreFoundation but
+# dynamic libraries built with nix use a pure version of CF this
+# causes segfaults for binaries that depend on it at runtime.  This
+# can be solved in two ways.
+# 1. Rewrite references to the pure CF using this setup hook, this
+# works for the simple case but this can still cause problems if other
+# dependencies (eg. python) use the pure CF.
+# 2. Create a wrapper for the binary that sets DYLD_FRAMEWORK_PATH to
+# /System/Library/Frameworks.  This will make everything load the
+# system's CoreFoundation framework while still keeping the
+# dependencies pure for other packages.
+
+fixupOutputHooks+=('fixDarwinFrameworksIn $prefix')
+
+fixDarwinFrameworks() {
+    local systemPrefix='/System/Library/Frameworks'
+
+    for fn in "$@"; do
+        if [ -L "$fn" ]; then continue; fi
+        echo "$fn: fixing dylib"
+
+        for framework in $(otool -L "$fn" | awk '/CoreFoundation\.framework/ {print $1}'); do
+          install_name_tool -change "$framework" "$systemPrefix/CoreFoundation.framework/Versions/A/CoreFoundation" "$fn" >&2
+        done
+    done
+}
+
+fixDarwinFrameworksIn() {
+    local dir="$1"
+    fixDarwinFrameworks $(find "$dir" -name "*.dylib")
+}
+
+
 # This configures the stdenv to use /System/Library/Frameworks/CoreFoundation.framework
 # instead of the nix version by including the system frameworks path
 # as an rpath entry when creating binaries.
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e51bc545aec8..e44b670ac082 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -328,8 +328,6 @@ with pkgs;
 
   fixDarwinDylibNames = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-dylib-names.sh;
 
-  fixDarwinFrameworks = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-frameworks.sh;
-
   keepBuildTree = makeSetupHook { } ../build-support/setup-hooks/keep-build-tree.sh;
 
   enableGCOVInstrumentation = makeSetupHook { } ../build-support/setup-hooks/enable-coverage-instrumentation.sh;