preserve library directories

Should avoid overwriting libraries when there are multiple versions of
a library used by different programs.
This commit is contained in:
Joey Hess 2012-09-25 10:27:21 -04:00
parent 356dc9bc17
commit 74fb57d1c4
2 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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