Chris@0: #!/bin/bash Chris@0: Chris@0: # this script should be executed from the directory that contains the app directory (application bundle) Chris@0: # it copies the required 3rd party libraries into the application bundle and corrects the library install names and references Chris@0: Chris@0: TARGETPATH="sonic-annotator.app/Contents/Frameworks/" Chris@0: Chris@0: mkdir "$TARGETPATH" Chris@0: Chris@0: QTPREFIX=/Library/Frameworks/ Chris@0: QTFWKS="QtXml QtCore QtNetwork" Chris@0: Chris@0: # copy the dynamic libraries into the app bundle Chris@0: Chris@0: for FWK in $QTFWKS; do Chris@0: cp ${QTPREFIX}${FWK}.framework/Versions/4/${FWK} "${TARGETPATH}" Chris@0: done Chris@0: Chris@0: # change the id's of the dylibs Chris@0: for FWK in $QTFWKS; do Chris@0: install_name_tool -id @executable_path/../Frameworks/${FWK} "$TARGETPATH/$FWK" Chris@0: done Chris@0: Chris@0: # tell the linker to look for dylibs in the app bundle Chris@0: for FWK in $QTFWKS; do Chris@0: install_name_tool -change ${FWK}.framework/Versions/4/${FWK} @executable_path/../Frameworks/${FWK} "sonic-annotator.app/Contents/MacOS/sonic-annotator" Chris@0: done Chris@0: Chris@0: # correct dependencies between QT dylibs Chris@0: for FWK in $QTFWKS; do Chris@0: case $FWK in QtCore) continue;; esac Chris@0: install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore "$TARGETPATH/${FWK}" Chris@0: done Chris@0: