source: subsurface/packaging/macosx/ @ ca7f593

Last change on this file since ca7f593 was ca7f593, checked in by Miika Turkia <miika.turkia@…>, 12 months ago

Fix MacOS make-package script

We need the full path to the local libssh in order to replace it with the
correct path.

Signed-off-by: Dirk Hohndel <dirk@…>

  • Property mode set to 100755
File size: 3.8 KB
3# this simply automates the steps to create a DMG we can ship
5# run this from the top subsurface directory
[cb1aac0]7# find the directory above the sources - typically ~/src
8DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../.. && pwd )
[61066b9]10# install location of yourway-create-dmg
[cb1aac0]11# by default we assume it's next to subsurface in ~/src/yoursway-create-dmg
[4125653]14# same git version magic as in the Makefile
[cb1aac0]15# for the naming of volume and dmg we want the 3 digits of the full version number
16VERSION=$(cd ${DIR}/subsurface; ./scripts/get-version linux)
18# first build and install Subsurface and then clean up the staging area
[3212bfd]19rm -rf ./
[cb1aac0]20LIBRARY_PATH=${DIR}/install-root/lib make -j8
21LIBRARY_PATH=${DIR}/install-root/lib make install
23# now adjust a few references that macdeployqt appears to miss
[818031e]25for i in libssh libssrfmarblewidget libgit2 libGrantlee_TextDocument.dylib libGrantlee_Templates.dylib; do
[cb1aac0]26        OLD=$(otool -L ${EXECUTABLE} | grep $i | cut -d\  -f1 | tr -d "\t")
[818031e]27        if [ ! -z ${OLD} ] ; then
28                cp ${DIR}/install-root/lib/$(basename ${OLD})
29                SONAME=$(basename $OLD)
30                install_name_tool -change ${OLD} @executable_path/../Frameworks/${SONAME} ${EXECUTABLE}
31                if [[ "$i" = "libssh" ]] ; then
32                        LIBSSH=$(basename ${OLD})
33                fi
34                if [[ "$i" = "libgit2" && ! -z ${LIBSSH} ]] ; then
[ca7f593]35                        CURLIBSSH=$(otool -L${SONAME} | grep libssh | cut -d\  -f1 | tr -d "\t")
36                        install_name_tool -change ${CURLIBSSH} @executable_path/../Frameworks/${LIBSSH}${SONAME}
[818031e]37                fi
[f66e3a44]38        fi
[7d2a7da]40RPATH=$(otool -L ${EXECUTABLE} | grep rpath  | cut -d\  -f1 | tr -d "\t" | cut -b 8- )
41for i in ${RPATH}; do
42        install_name_tool -change @rpath/$i @executable_path/../Frameworks/$i ${EXECUTABLE}
45RPATH=$(otool -L ${MARBLELIB} | grep rpath  | cut -d\  -f1 | tr -d "\t" | cut -b 8- )
46for i in ${RPATH}; do
47        install_name_tool -change @rpath/$i @executable_path/../Frameworks/$i ${MARBLELIB}
50# next deal with libGrantlee
[f66e3a44]52for i in QtScript.framework/Versions/5/QtScript QtCore.framework/Versions/5/QtCore ; do
53        install_name_tool -change @rpath/$i @executable_path/../Frameworks/$i ${LIBG}
56# it seems the compiler in XCode 4.6 doesn't build Grantlee5 correctly,
57# so cheat and copy over pre-compiled binaries created with a newer compiler
58# and adjust their references to the Grantlee template library
60# -disabled for now as this is still under more investigation-
61# cp -a /Users/hohndel/src/tmp/
[f66e3a44]62cp ${DIR}/tmp/{sql,usb,zip}*
64# clean up shared library dependency in the Grantlee plugins
65for i in*.so; do
66        OLD=$(otool -L $i | grep libGrantlee_Templates | cut -d\  -f1 | tr -d "\t")
67        SONAME=$(basename $OLD )
68        install_name_tool -change ${OLD} @executable_path/../Frameworks/${SONAME} $i;
[f66e3a44]69        mv $i
[d3065d8]73# copy things into staging so we can create a nice DMG
74rm -rf ./staging
75mkdir ./staging
76cp -a ./ ./staging
[cb1aac0]78sh ${DIR}/subsurface/packaging/macosx/sign
[44c7e02]80if [ -f ./Subsurface-$VERSION.dmg ]; then
81        rm ./Subsurface-$VERSION.dmg.bak
82        mv ./Subsurface-$VERSION.dmg ./Subsurface-$VERSION.dmg.bak
[cb1aac0]85$DMGCREATE --background ${DIR}/subsurface/packaging/macosx/DMG-Background.png \
[44c7e02]86        --window-size 500 300 --icon-size 96 --volname Subsurface-$VERSION \
[61066b9]87        --app-drop-link 380 205 \
[cb1aac0]88        --volicon ${DIR}/subsurface/packaging/macosx/Subsurface.icns \
[44c7e02]89        --icon "Subsurface" 110 205 ./Subsurface-$VERSION.dmg ./staging
Note: See TracBrowser for help on using the repository browser.