|
2 | 2 | # Copy supportibng libraries (except Qt) to openModeller bundle |
3 | 3 | # and make search paths for them relative to bundle |
4 | 4 |
|
| 5 | + |
5 | 6 | APP_PREFIX=/Applications/qgis0.11.0.app |
6 | 7 | BUNDLE_DIR=${APP_PREFIX}/Contents/MacOS |
7 | 8 | DEPS_BASE=/usr/local/qgis_universal_deps |
@@ -30,6 +31,7 @@ install_name_tool -change ${LIB_DIR}/libgdal.1.dylib \ |
30 | 31 | install_name_tool -change ${LIB_DIR}/libproj.dylib \ |
31 | 32 | @executable_path/lib/libproj.dylib \ |
32 | 33 | ${BUNDLE_DIR}/qgis |
| 34 | + |
33 | 35 | set +x |
34 | 36 |
|
35 | 37 | LIBS="lib/libqgis_core.dylib \ |
|
107 | 109 | #echo "----------------------------------" |
108 | 110 | done |
109 | 111 |
|
| 112 | +# Python libs need some special care |
| 113 | +LIBS="share/qgis/python/qgis/core.so |
| 114 | + share/qgis/python/qgis/gui.so |
| 115 | + lib/libqgispython.dylib" |
| 116 | +for LIB in $LIBS |
| 117 | +do |
| 118 | + install_name_tool -id @executable_path/${LIB} ${BUNDLE_DIR}/${LIB} |
| 119 | + # for debugging only |
| 120 | + for LIBPATH in `otool -L ${BUNDLE_DIR}/${LIB} \ |
| 121 | + | sed 's/(\([a-zA-Z0-9\., ]*\))//g' \ |
| 122 | + | grep $LIB_DIR \ |
| 123 | + | grep -v framework` #frameworks (in particular qt frameworks) get |
| 124 | + #dealt with in another script |
| 125 | + do |
| 126 | + #echo "------------" |
| 127 | + #echo $LIBPATH |
| 128 | + #echo "------------" |
| 129 | + BASELIB=`basename "$LIBPATH"` |
| 130 | + #echo $BASELIB |
| 131 | + install_name_tool -change ${LIBPATH} @executable_path/lib/${BASELIB} ${BUNDLE_DIR}/${LIB} |
| 132 | + done |
| 133 | + # Change the search path for qgis libs in python libs |
| 134 | + |
| 135 | + CORELIBPATH=/`otool -L ${BUNDLE_DIR}/${LIB} |grep -o "\b[/A-Za-z0-9]*libqgis_core.[0-9.]*.dylib\b"` |
| 136 | + CORELIB=`echo "${CORELIBPATH}" | grep -o "libqgis_core.[0-9.]*.dylib"` |
| 137 | + install_name_tool -change ${CORELIBPATH} @executable_path/lib/${CORELIB} ${BUNDLE_DIR}/${LIB} |
| 138 | + GUILIBPATH=/`otool -L ${BUNDLE_DIR}/${LIB} |grep -o "\b[/A-Za-z0-9]*libqgis_gui.[0-9.]*.dylib\b"` |
| 139 | + GUILIB=`echo "${CORELIBPATH}" | grep -o "libqgis_gui.[0-9.]*.dylib"` |
| 140 | + install_name_tool -change ${GUILIBPATH} @executable_path/lib/${GUILIB} ${BUNDLE_DIR}/${LIB} |
| 141 | + echo $LIB |
| 142 | + #otool -L ${BUNDLE_DIR}/lib/qgis/${LIB} |
| 143 | + #echo "----------------------------------" |
| 144 | +done |
| 145 | + |
| 146 | + |
| 147 | +/Users/timlinux/dev/cpp/qgis/build/src/core/libqgis_core.0.11.dylib |
| 148 | + |
110 | 149 | # |
111 | 150 | # Strip binaries - disable for debugging |
112 | 151 | # |
|
0 commit comments