Skip to content
Permalink
Browse files
Alternative post build scripts for mac if using Tim's qgis universal …
…deps bundle for OS X

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8427 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed May 14, 2008
1 parent c17d8d4 commit 3f89c1d956c1fde97c629eae53845596783c635a
Showing with 251 additions and 0 deletions.
  1. +108 −0 mac/1-release-extra.sh
  2. +143 −0 mac/2-release-extra-qt.sh
@@ -0,0 +1,108 @@
#!/bin/sh
# Copy supportibng libraries (except Qt) to openModeller bundle
# and make search paths for them relative to bundle

APP_PREFIX=/Applications/qgis0.11.0.app
BUNDLE_DIR=${APP_PREFIX}/Contents/MacOS
LIB_DIR=/usr/local/qgis_universal_deps/lib
#set -x
cp -r ${LIB_DIR}/libexpat.dylib ${BUNDLE_DIR}/lib
cp -r ${LIB_DIR}/libgdal.1.dylib ${BUNDLE_DIR}/lib
cp -r ${LIB_DIR}/libgeos.dylib ${BUNDLE_DIR}/lib
cp -r ${LIB_DIR}/libproj.dylib ${BUNDLE_DIR}/lib
cp -r ${LIB_DIR}/libgsl.dylib ${BUNDLE_DIR}/lib
cp -r ${LIB_DIR}/libgslcblas.dylib ${BUNDLE_DIR}/lib
#cp -r ${LIB_DIR}/libsqlite3.0.dylib ${BUNDLE_DIR}
pushd .
cd ${BUNDLE_DIR}/lib
ln -s libgdal.1.dylib libgdal.dylib
ln -s libexpat.dylib libexpat.1.dylib
ln -s libgsl.dylib libgsl.0.dylib
ln -s libgslcblas.dylib libgslcblas.0.dylib
#ln -s libsqlite3.0.dylib libsqlite3.dylib
popd


install_name_tool -change ${LIB_DIR}/libgdal.1.dylib \
@executable_path/lib/libgdal.1.dylib \
${BUNDLE_DIR}/qgis
install_name_tool -change ${LIB_DIR}/libproj.dylib \
@executable_path/lib/libproj.dylib \
${BUNDLE_DIR}/qgis


LIBS="lib/libqgis_core.dylib \
lib/libqgis_gui.dylib \
lib/libexpat.1.dylib \
lib/libgsl.0.dylib \
lib/libgslcblas.0.dylib \
lib/libexpat.dylib \
lib/libgdal.dylib \
lib/libgeos.dylib \
lib/libproj.dylib"
#
# Next we work through all the libs except Qt libs
# and update the library ids and paths for these libs
#
for LIB in $LIBS
do
install_name_tool -id @executable_path/$LIB ${BUNDLE_DIR}/${LIB}
#echo "install_name_tool -id @executable_path/$LIB ${BUNDLE_DIR}/${LIB}"
# for debugging only
for LIBPATH in `otool -L ${BUNDLE_DIR}/${LIB} \
| sed 's/(\([a-zA-Z0-9\., ]*\))//g' \
| grep $LIB_DIR \
| grep -v framework` #frameworks (in particular qt frameworks)
#get dealt with in another script
do
#echo $LIBPATH
BASELIB=`basename "$LIBPATH"`
#echo $BASELIB
install_name_tool -change ${LIBPATH} \
@executable_path/lib/${BASELIB} \
${BUNDLE_DIR}/${LIB}
done
#otool -L ${BUNDLE_DIR}/${LIB}
echo ${LIB}
done

#
# Next sort out the qgis plugins....
#
LIBS="libcopyrightlabelplugin.so
libgpxprovider.so
libscalebarplugin.so
libdelimitedtextplugin.so
libgridmakerplugin.so
libwfsplugin.so
libdelimitedtextprovider.so
libnortharrowplugin.so
libwfsprovider.so
libgeorefplugin.so
libogrprovider.so
libwmsprovider.so
libgpsimporterplugin.so
libquickprintplugin.so
libevis.so"
for LIB in $LIBS
do
install_name_tool -id @executable_path/lib/qgis/${LIB} ${BUNDLE_DIR}/lib/qgis/${LIB}
# for debugging only
for LIBPATH in `otool -L ${BUNDLE_DIR}/lib/qgis/${LIB} \
| sed 's/(\([a-zA-Z0-9\., ]*\))//g' \
| grep $LIB_DIR \
| grep -v framework` #frameworks (in particular qt frameworks) get
#dealt with in another script
do
#echo "------------"
#echo $LIBPATH
#echo "------------"
BASELIB=`basename "$LIBPATH"`
#echo $BASELIB
install_name_tool -change ${LIBPATH} @executable_path/lib/${BASELIB} ${BUNDLE_DIR}/lib/qgis/${LIB}
done
echo $LIB
#otool -L ${BUNDLE_DIR}/lib/qgis/${LIB}
#echo "----------------------------------"
done

@@ -0,0 +1,143 @@
#!/bin/sh
# Copy Qt frameworks to atlas bundle
# and make search paths for them relative to bundle

APP_PREFIX=/Applications/qgis0.11.0.app
MACOS_PREFIX=${APP_PREFIX}/Contents/MacOS
FRAMEWORKPREFIX=${APP_PREFIX}/Contents/Frameworks
mkdir -p $MACOS_PREFIX
mkdir -p $FRAMEWORKPREFIX
pushd $PWD
cd $FRAMEWORKPREFIX

# Edit version when any library is upgraded
UNIVERSAL_LIBS_PREFIX=/usr/local/qgis_universal_deps
QTPREFIX=${UNIVERSAL_LIBS_PREFIX}/lib
QTFRAMEWORKS="QtCore QtGui QtNetwork QtSql QtSvg QtXml"

#
# Copy supporting frameworks to application bundle
#
cd $FRAMEWORKPREFIX
for FRAMEWORK in $QTFRAMEWORKS
do
LIBFRAMEWORK=$FRAMEWORK.framework/Versions/4/$FRAMEWORK
if test ! -f $LIBFRAMEWORK; then
mkdir -p $FRAMEWORK.framework/Versions/4
cp $QTPREFIX/$LIBFRAMEWORK $LIBFRAMEWORK
install_name_tool -id @executable_path/../Frameworks/$LIBFRAMEWORK $LIBFRAMEWORK
fi
done

# Update path to supporting frameworks
for FRAMEWORK in QtGui QtNetwork QtSql QtSvg QtXml
do
install_name_tool -change ${QTPREFIX}/QtCore.framework/Versions/4/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore \
$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done

for FRAMEWORK in QtSvg
do
install_name_tool -change ${QTPREFIX}/QtGui.framework/Versions/4/QtGui \
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui \
$FRAMEWORK.framework/Versions/4/$FRAMEWORK
install_name_tool -change ${QTPREFIX}/QtXml.framework/Versions/4/QtXml \
@executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml \
$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done

#
# Update qgis related libs and binaries
#

cd $MACOS_PREFIX
FILES="qgis
lib/libqgis_core.dylib
lib/libqgis_gui.dylib
lib/libomg_widgets.dylib
lib/qgis/libcopyrightlabelplugin.so
lib/qgis/libgpxprovider.so
lib/qgis/libscalebarplugin.so
lib/qgis/libdelimitedtextplugin.so
lib/qgis/libgridmakerplugin.so
lib/qgis/libwfsplugin.so
lib/qgis/libdelimitedtextprovider.so
lib/qgis/libnortharrowplugin.so
lib/qgis/libwfsprovider.so
lib/qgis/libgeorefplugin.so
lib/qgis/libogrprovider.so
lib/qgis/libwmsprovider.so
lib/qgis/libgpsimporterplugin.so
lib/qgis/libevis.so
lib/qgis/libquickprintplugin.so"
for FILE in ${FILES}
do
for FRAMEWORK in QtCore QtGui QtNetwork QtSql QtSvg QtXml
do
set -x
install_name_tool -change ${QTPREFIX}/${FRAMEWORK}.framework/Versions/4/$FRAMEWORK \
@executable_path/../Frameworks/$FRAMEWORK.framework/Versions/4/$FRAMEWORK \
$MACOS_PREFIX/$FILE
done
done



#
# Update qt imageformat plugin paths
#


cd ${MACOS_PREFIX}/../
mkdir -p plugins/imageformats
cd plugins/imageformats

LIBJPEG=libjpeg.dylib
LIBQJPEG=${UNIVERSAL_LIBS_PREFIX}/plugins/imageformats/libqjpeg.dylib
if test ! -f $LIBJPEG; then
cp $LIBQJPEG $LIBJPEG
# Update path to supporting libraries
install_name_tool -change ${QTPREFIX}/QtCore.framework/Versions/4/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore \
$LIBJPEG
install_name_tool -change ${QTPREFIX}/QtGui.framework/Versions/4/QtGui \
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui \
$LIBJPEG
install_name_tool -change $LIBQJPEG @executable_path/../plugins/imageformats/$LIBJPEG
fi
LIBGIF=libgif.dylib
LIBQGIF=${UNIVERSAL_LIBS_PREFIX}/plugins/imageformats/libqgif.dylib
if test ! -f $LIBGIF; then
cp $LIBQGIF $LIBGIF
# Update path to supporting libraries
install_name_tool -change ${QTPREFIX}/QtCore.framework/Versions/4/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore \
$LIBGIF
install_name_tool -change ${QTPREFIX}/QtGui.framework/Versions/4/QtGui \
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui \
$LIBGIF
install_name_tool -change $LIBQGIF @executable_path/../plugins/imageformats/$LIBGIF
fi

#
# QT Sql Drivers
#
cd ${MACOS_PREFIX}/../
mkdir -p plugins/sqldrivers
cd plugins/sqldrivers
LIBSQLITE=libqsqlite.dylib
LIBQSQLITE=${UNIVERSAL_LIBS_PREFIX}/plugins/sqldrivers/libqsqlite.dylib
if test ! -f $LIBSQLITE; then
cp $LIBQSQLITE $LIBSQLITE
# Update path to supporting libraries
install_name_tool -change ${QTPREFIX}/QtCore.framework/Versions/4/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore \
$LIBSQLITE
install_name_tool -change ${QTPREFIX}/QtSql.framework/Versions/4/QtSql \
@executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql \
$LIBSQLITE
install_name_tool -change $LIBSQLITE @executable_path/../plugins/sqldrivers/$LIBSQLITE
fi

popd

0 comments on commit 3f89c1d

Please sign in to comment.