From c696fcdacb04d382ae95f0581d293bd40540d871 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Thu, 19 Nov 2020 17:18:44 +0900 Subject: [PATCH] fixDarwinDylibNames: set name of install_name_tool --- pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh | 2 +- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh b/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh index af2ff0cc9662..55e196e654df 100644 --- a/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh +++ b/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh @@ -23,7 +23,7 @@ fixDarwinDylibNames() { for fn in "$@"; do if [ -L "$fn" ]; then continue; fi echo "$fn: fixing dylib" - int_out=$(install_name_tool -id "$fn" "${flags[@]}" "$fn" 2>&1) + int_out=$(@targetPrefix@install_name_tool -id "$fn" "${flags[@]}" "$fn" 2>&1) result=$? if [ "$result" -ne 0 ] && ! grep "shared library stub file and can't be changed" <<< "$out" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 08f94a54a587..07aba73d0fcf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -641,7 +641,9 @@ in setJavaClassPath = makeSetupHook { } ../build-support/setup-hooks/set-java-classpath.sh; - fixDarwinDylibNames = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-dylib-names.sh; + fixDarwinDylibNames = makeSetupHook { + substitutions = { inherit (binutils) targetPrefix; }; + } ../build-support/setup-hooks/fix-darwin-dylib-names.sh; keepBuildTree = makeSetupHook { } ../build-support/setup-hooks/keep-build-tree.sh;