Skip to content
Permalink
Browse files

tidy up clutter

git-svn-id: http://svn.osgeo.org/qgis/trunk@10860 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
kyngchaos
kyngchaos committed May 29, 2009
1 parent 3d651d6 commit 100351b364ddf93fc066ee76c755f55eb2b6e9dc
@@ -0,0 +1,166 @@
#!/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
DEPS_BASE=/usr/local/qgis_universal_deps
LIB_DIR=${DEPS_BASE}/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

set -x
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

set +x

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

# Python libs need some special care
LIBS="share/qgis/python/qgis/core.so
share/qgis/python/qgis/gui.so
lib/libqgispython.dylib"
for LIB in $LIBS
do
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 "------------"
#echo $LIBPATH
#echo "------------"
BASELIB=`basename "$LIBPATH"`
#echo $BASELIB
install_name_tool -change ${LIBPATH} @executable_path/lib/${BASELIB} ${BUNDLE_DIR}/${LIB}
done
# Change the search path for qgis libs in python libs

CORELIBPATH=/`otool -L ${BUNDLE_DIR}/${LIB} |grep -o "\b[/A-Za-z0-9]*libqgis_core.[0-9.]*.dylib\b"`
CORELIB=`echo "${CORELIBPATH}" | grep -o "libqgis_core.[0-9.]*.dylib"`
install_name_tool -change ${CORELIBPATH} @executable_path/lib/${CORELIB} ${BUNDLE_DIR}/${LIB}
GUILIBPATH=/`otool -L ${BUNDLE_DIR}/${LIB} |grep -o "\b[/A-Za-z0-9]*libqgis_gui.[0-9.]*.dylib\b"`
GUILIB=`echo "${CORELIBPATH}" | grep -o "libqgis_gui.[0-9.]*.dylib"`
install_name_tool -change ${GUILIBPATH} @executable_path/lib/${GUILIB} ${BUNDLE_DIR}/${LIB}
echo $LIB
#otool -L ${BUNDLE_DIR}/lib/qgis/${LIB}
#echo "----------------------------------"
done


/Users/timlinux/dev/cpp/qgis/build/src/core/libqgis_core.0.11.dylib

#
# Strip binaries - disable for debugging
#
#pushd .
#cd ${APP_PREFIX}
#for FILE in `find . -name *.dylib`; do echo "Stripping $FILE"; strip -x $FILE; done
#for FILE in `find . -name *.so`; do echo "Stripping $FILE"; strip -x $FILE; done
#strip -x ${APP_PREFIX}/Contents/MacOS/qgis
#popd

#
# Install GDAL and Proj support files
#
cp -r ${DEPS_BASE}/share/proj ${APP_PREFIX}/Contents/MacOS/share/
cp -r ${DEPS_BASE}/share/*.wkt ${APP_PREFIX}/Contents/MacOS/share/
cp -r ${DEPS_BASE}/share/*.csv ${APP_PREFIX}/Contents/MacOS/share/
cp -r ${DEPS_BASE}/share/*.dgn ${APP_PREFIX}/Contents/MacOS/share/

@@ -0,0 +1,157 @@
#!/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 QtDesigner"

#
# 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/qgis/libcatalogue.so
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
share/qgis/python/qgis/core.so
share/qgis/python/qgis/gui.so
lib/libqgispython.dylib"
for FILE in ${FILES}
do
for FRAMEWORK in QtCore QtGui QtNetwork QtSql QtSvg QtXml
do
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

#
# Strip the qt libs
#

strip -x ${FRAMEWORKPREFIX}/QtGui.framework/Versions/4/QtGui
strip -x ${FRAMEWORKPREFIX}/QtCore.framework/Versions/4/QtCore
strip -x ${FRAMEWORKPREFIX}/QtSql.framework/Versions/4/QtSql
strip -x ${FRAMEWORKPREFIX}/QtSvg.framework/Versions/4/QtSvg
strip -x ${FRAMEWORKPREFIX}/QtXml.framework/Versions/4/QtXml
strip -x ${FRAMEWORKPREFIX}/QtNetwork.framework/Versions/4/QtNetwork
strip -x ${FRAMEWORKPREFIX}/QtDesigner.framework/Versions/4/QtDesigner
@@ -0,0 +1,38 @@
#!/bin/bash

#
# A bash script to create a dmg image file of the
# final application bundle
# (c) Tim Sutton 2007

DMGNAME=QGISAlaskaUncompressed.dmg
COMPRESSEDDMGNAME=QGISAlaska.dmg
set -x

echo "Removing old dmg if it exists"
rm ~/Desktop/${DMGNAME}
rm ~/Desktop/${COMPRESSEDDMGNAME}
hdiutil create -size 300m -fs HFS+ -volname "QGISAlaska" ~/Desktop/${DMGNAME}

# Mount the disk image
hdiutil attach ~/Desktop/${DMGNAME}

# Obtain device information
DEVS=$(hdiutil attach ~/Desktop/${DMGNAME} | cut -f 1)
DEV=$(echo $DEVS | cut -f 1 -d ' ')
VOLUME=$(mount |grep ${DEV} | cut -f 3 -d ' ')

# copy in the application bundle
cp -Rp /Applications/QGISAlaska.app ${VOLUME}/QGISAlaska.app

# copy in background image and folder settings for icon sizes etc
tar xvfz alaska_extra_dmg_files.tar.gz -C ${VOLUME}
cp ../LICENSE ${VOLUME}/LICENSE.txt

# Unmount the disk image
hdiutil detach $DEV

# Convert the disk image to read-only
hdiutil convert ~/Desktop/${DMGNAME} \
-format UDZO -o ~/Desktop/${COMPRESSEDDMGNAME}

0 comments on commit 100351b

Please sign in to comment.
You can’t perform that action at this time.