1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 23:59:37 +02:00

Fix loader_path and executable_path

This commit is contained in:
Leland Lucius 2015-07-21 22:54:15 -05:00
parent 582ee7b45e
commit 02d4e71cf1
2 changed files with 25 additions and 6 deletions

View File

@ -65,6 +65,7 @@ echo '
hdiutil convert TMP.dmg -format UDZO -imagekey zlib-level=9 -o "$DMG.dmg"
# Create zip version
rm -rf "${DMG}/.background"
rm -rf "${DMG}/Audacity/help/"
zip -r9 "${DMG}.zip" "${DMG}"

View File

@ -1,13 +1,30 @@
#!/bin/sh
set -x
resolve()
{
set -x
dir="${1%/*}"
base="${1##*/}"
while [ -n "${base}" ]
do
lib="${dir}/${base}"
base=$(readlink "${dir}/${base}")
done
echo $lib
}
update_paths()
{
base=$(basename "${1}")
cp -p "${1}" "${LIBPATH}"
set -x
path=$(resolve "${1}")
base="${path##*/}"
cp -p "${path}" "${LIBPATH}"
for lib in $(otool -L "${1}" | awk '/libwx/{print $1}')
for lib in $(otool -L "${path}" | awk '/libwx/{print $1}')
do
install_name_tool -change "${lib}" @loader_path/../Frameworks/$(basename "${lib}") "${LIBPATH}/${base}"
path=$(resolve "${lib}")
install_name_tool -change "${lib}" "@loader_path/../Frameworks/${path##*/}" "${LIBPATH}/${base}"
done
}
@ -18,8 +35,9 @@ mkdir -p "${LIBPATH}"
for lib in $(otool -L "${EXEPATH}" | awk '/libwx/{print $1}')
do
install_name_tool -change "${lib}" @executable_path/../Frameworks/$(basename "${lib}") "${EXEPATH}"
update_paths "${lib}"
path=$(resolve "${lib}")
install_name_tool -change "${lib}" "@executable_path/../Frameworks/${path##*/}" "${EXEPATH}"
update_paths "${path}"
done
exit 0