mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
macOS: update package build script
The create-dmg script changed repo name - let's support either version. On newer Macs the SDKs are elsewhere - let's look there, too. Let's be far more flexible when finding SDK versions. Let's not assume that we are linking against QtWebKit (we're not with Qt6). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
53e153e6d7
commit
e9b4d02d24
1 changed files with 18 additions and 5 deletions
|
@ -7,9 +7,17 @@
|
||||||
# find the directory above the sources - typically ~/src
|
# find the directory above the sources - typically ~/src
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../.. && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../.. && pwd )
|
||||||
|
|
||||||
# install location of yourway-create-dmg
|
# install location of create-dmg
|
||||||
# by default we assume it's next to subsurface in ~/src/yoursway-create-dmg
|
# by default we assume it's next to subsurface in ~/src/yoursway-create-dmg
|
||||||
DMGCREATE=${DIR}/yoursway-create-dmg/create-dmg
|
DMGCREATE=${DIR}/yoursway-create-dmg/create-dmg
|
||||||
|
if [ ! -x $DMGCREATE ] ; then
|
||||||
|
# well, this app changed its github name, so it may be in a different directory now
|
||||||
|
DMGCREATE=${DIR}/create-dmg/create-dmg
|
||||||
|
if [ ! -x $DMGCREATE ] ; then
|
||||||
|
echo "Can't find working create-dmg, aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# same git version magic as in the Makefile
|
# same git version magic as in the Makefile
|
||||||
# for the naming of volume and dmg we want the 3 digits of the full version number
|
# for the naming of volume and dmg we want the 3 digits of the full version number
|
||||||
|
@ -18,7 +26,9 @@ VERSION=$(cd ${DIR}/subsurface; ./scripts/get-version linux)
|
||||||
# first build and install Subsurface and then clean up the staging area
|
# first build and install Subsurface and then clean up the staging area
|
||||||
# make sure we didn't lose the minimum OS version
|
# make sure we didn't lose the minimum OS version
|
||||||
rm -rf ./Subsurface.app
|
rm -rf ./Subsurface.app
|
||||||
if [ -d /Developer/SDKs ] ; then
|
if [ -d /Library/Developer/CommandLineTools/SDKs ] ; then
|
||||||
|
SDKROOT=/Library/Developer/CommandLineTools/SDKs
|
||||||
|
elif [ -d /Developer/SDKs ] ; then
|
||||||
SDKROOT=/Developer/SDKs
|
SDKROOT=/Developer/SDKs
|
||||||
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ] ; then
|
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ] ; then
|
||||||
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
|
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
|
||||||
|
@ -27,9 +37,10 @@ else
|
||||||
echo "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs)"
|
echo "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs)"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
BASESDK=$(ls $SDKROOT | grep "MacOSX10\.1.\.sdk" | head -1 | sed -e "s/MacOSX//;s/\.sdk//")
|
BASESDK=$(ls $SDKROOT | grep "MacOSX1.*\.sdk" | head -1 | sed -e "s/MacOSX//;s/\.sdk//")
|
||||||
OLDER_MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/"
|
OLDER_MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/"
|
||||||
export PKG_CONFIG_PATH=${DIR}/install-root/lib/pkgconfig:$PKG_CONFIG_PATH
|
export PKG_CONFIG_PATH=${DIR}/install-root/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||||
|
|
||||||
cmake $OLDER_MAC_CMAKE .
|
cmake $OLDER_MAC_CMAKE .
|
||||||
LIBRARY_PATH=${DIR}/install-root/lib make -j8
|
LIBRARY_PATH=${DIR}/install-root/lib make -j8
|
||||||
LIBRARY_PATH=${DIR}/install-root/lib make install
|
LIBRARY_PATH=${DIR}/install-root/lib make install
|
||||||
|
@ -56,6 +67,7 @@ done
|
||||||
|
|
||||||
# ensure libpng and libjpeg inside the bundle are referenced in QtWebKit libraries
|
# ensure libpng and libjpeg inside the bundle are referenced in QtWebKit libraries
|
||||||
QTWEBKIT=Subsurface.app/Contents/Frameworks/QtWebKit.framework/QtWebKit
|
QTWEBKIT=Subsurface.app/Contents/Frameworks/QtWebKit.framework/QtWebKit
|
||||||
|
if [ -f $QTWEBKIT ] ; then
|
||||||
for i in libjpeg.8.dylib libpng16.16.dylib; do
|
for i in libjpeg.8.dylib libpng16.16.dylib; do
|
||||||
OLD=$(otool -L ${QTWEBKIT} | grep $i | cut -d\ -f1 | tr -d "\t")
|
OLD=$(otool -L ${QTWEBKIT} | grep $i | cut -d\ -f1 | tr -d "\t")
|
||||||
if [[ ! -z ${OLD} ]] ; then
|
if [[ ! -z ${OLD} ]] ; then
|
||||||
|
@ -68,6 +80,7 @@ for i in libjpeg.8.dylib libpng16.16.dylib; do
|
||||||
install_name_tool -id @executable_path/../Frameworks/${SONAME} Subsurface.app/Contents/Frameworks/${SONAME}
|
install_name_tool -id @executable_path/../Frameworks/${SONAME} Subsurface.app/Contents/Frameworks/${SONAME}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# next, copy libssh2.1
|
# next, copy libssh2.1
|
||||||
# cp ${DIR}/install-root/lib/libssh2.1.dylib Subsurface.app/Contents/Frameworks
|
# cp ${DIR}/install-root/lib/libssh2.1.dylib Subsurface.app/Contents/Frameworks
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue