summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-25 10:27:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-25 10:27:21 -0400
commita8059df713ed85bbb8b0ceb49172514667fa840a (patch)
treefcf1cee79f249ef5c365c6e9efe88d327d6449be
parent137ff3969bc85b80380dd6a9c3001191dbead990 (diff)
preserve library directories
Should avoid overwriting libraries when there are multiple versions of a library used by different programs.
-rw-r--r--Makefile10
-rwxr-xr-xui-macos/git-annex.app/Contents/MacOS/runshell4
2 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 952a14856..5861636fb 100644
--- a/Makefile
+++ b/Makefile
@@ -152,10 +152,14 @@ osxapp: $(bins)
install -d "$(OSXAPP_BASE)/git-core"
(cd "$(shell git --exec-path)" && tar c .) | (cd "$(OSXAPP_BASE)"/git-core && tar x)
- install -d "$(OSXAPP_BASE)/lib"
+ touch "$(OSXAPP_BASE)/libdirs.tmp"
for lib in $$(otool -L "$(OSXAPP_BASE)"/bin/* "$(OSXAPP_BASE)"/git-core/* | egrep '^ ' | cut -d ' ' -f 1 | sed 's/^ //' | sort | uniq); do \
- base=$$(basename "$$lib"); \
- cp "$$lib" "$(OSXAPP_BASE)/lib/$$base"; \
+ dir=$$(dirname "$$lib"); \
+ install -d "$(OSXAPP_BASE)/$$dir"; \
+ echo "$$dir" >> "$(OSXAPP_BASE)/libdirs.tmp"; \
+ cp "$$lib" "$(OSXAPP_BASE)/$$dir"; \
done
+ sort "$(OSXAPP_BASE)/libdirs.tmp" | uniq > "$(OSXAPP_BASE)/libdirs"
+ rm -f "$(OSXAPP_BASE)/libdirs.tmp"
.PHONY: $(bins) test install
diff --git a/ui-macos/git-annex.app/Contents/MacOS/runshell b/ui-macos/git-annex.app/Contents/MacOS/runshell
index e6c932720..82a75c401 100755
--- a/ui-macos/git-annex.app/Contents/MacOS/runshell
+++ b/ui-macos/git-annex.app/Contents/MacOS/runshell
@@ -29,7 +29,9 @@ cd "$orig"
PATH=$base/bin:$PATH
export PATH
-DYLD_LIBRARY_PATH=$base/lib:$DYLD_LIBRARY_PATH
+for lib in "$(cat libdirs)"; do
+ DYLD_LIBRARY_PATH="$base/$lib:$DYLD_LIBRARY_PATH"
+done
export DYLD_LIBRARY_PATH
GIT_EXEC_PATH=$base/git-core