Reconfigured build script for deploying on Mac (still not working)

This commit is contained in:
Tats
2016-05-07 08:45:50 -04:00
parent e9bf69017a
commit 73159789c7
2 changed files with 36 additions and 15 deletions
+17 -12
View File
@@ -3,7 +3,7 @@
# On Mac, install it from http://qt-project.org/downloads
# set -o verbose
qtversion=5.5
QT_VERSION=5.5
do_create_dmg() {
if [ -f DMGVERSION.txt ]
@@ -53,10 +53,10 @@ if [[ $unamestr == "Darwin" ]]; then
#export QMAKE_CFLAGS_PPC_64
#export QMAKESPEC=macx-g++
#export QMAKESPEC=macx-xcode
qtbindir=~/Qt/${qtversion}/clang_64/bin/
PATH=$PATH:${qtbindir}
QT_BIN_DIR=~/Qt/${QT_VERSION}/clang_64/bin/
PATH=$PATH:${QT_BIN_DIR}
APP="MapMap.app"
gstreamer="GStreamer.framework/Versions/1.0/lib/GStreamer"
app="MapMap.app"
# XXX
#$qmake5 -config release -spec macx-llvm
@@ -67,22 +67,27 @@ if [[ $unamestr == "Darwin" ]]; then
# build program
echo "Building program ..."
qmake -config release
${QT_BIN_DIR}/qmake -config release
make -j4
# Bundle Qt frameworks in app using macdeployqt
echo "Bundling Qt ..."
macdeployqt $app
${QT_BIN_DIR}/macdeployqt $APP
# Bundle GStreamer framework in app
echo "Bundling GStreamer ..."
cp -R /Library/Frameworks/GStreamer.framework ${app}/Contents/Frameworks/
install_name_tool -id @executable_path/../Frameworks/${gstreamer} ${app}/Contents/Frameworks/${gstreamer}
install_name_tool -change /Library/Frameworks/${gstreamer} @executable_path/../Frameworks/${gstreamer} ${app}/Contents/MacOs/MapMap
#echo "Bundling GStreamer ..."
cp -r /Library/Frameworks/GStreamer.framework ${APP}/Contents/Frameworks/
osxrelocator ${APP}/Contents/Frameworks/GStreamer.framework/Versions/Current/lib /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
osxrelocator ${APP}/Contents/Frameworks/GStreamer.framework/Versions/Current/libexec /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
osxrelocator ${APP}/Contents/Frameworks/GStreamer.framework/Versions/Current/bin /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
osxrelocator ${APP}/Contents/MacOS /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
#install_name_tool -id @executable_path/../Frameworks/${gstreamer} ${APP}/Contents/Frameworks/${gstreamer}
#install_name_tool -change /Library/Frameworks/${gstreamer} @executable_path/../Frameworks/${gstreamer} ${APP}/Contents/MacOs/MapMap
# do_fix_qt_plugins_in_app
echo "Creating DMG ..."
do_create_dmg
#echo "Creating DMG ..."
#do_create_dmg
elif [[ $unamestr == "Linux" ]]; then
qmake
make -j4
+19 -3
View File
@@ -23,11 +23,11 @@ MM_USE_NAMESPACE
static void set_env_vars_if_needed()
{
#ifdef __MACOSX_CORE__
std::cout << "OS X detected. Set environment for GStreamer support." << std::endl;
if (0 == setenv("GST_PLUGIN_PATH", "/Library/Frameworks/GStreamer.framework/Libraries", 1))
std::cout << "OS X detected. Set environment for GStreamer support." << std::endl;
/* if (0 == setenv("GST_PLUGIN_PATH", "/Library/Frameworks/GStreamer.framework/Libraries", 1))
std::cout << " * GST_PLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries" << std::endl;
if (0 == setenv("GST_DEBUG", "2", 1))
std::cout << " * GST_DEBUG=2" << std::endl;
std::cout << " * GST_DEBUG=2" << std::endl;*/
//setenv("LANG", "C", 1);
#endif // __MACOSX_CORE__
}
@@ -84,6 +84,22 @@ int main(int argc, char *argv[])
initRegistry();
MainApplication app(argc, argv);
#ifdef __MACOSX_CORE__
std::cout << "OS X detected. Set environment for GStreamer support." << std::endl;
/* if (0 == setenv("GST_PLUGIN_PATH", "/Library/Frameworks/GStreamer.framework/Libraries", 1))
std::cout << " * GST_PLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries" << std::endl;
if (0 == setenv("GST_DEBUG", "2", 1))
std::cout << " * GST_DEBUG=2" << std::endl;*/
//setenv("LANG", "C", 1);
#endif // __MACOSX_CORE__
putenv("GST_PLUGIN_SYSTEM_PATH=/Users/rustines/Documents/workspace/mapmap/MapMap.app/Contents/Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0");
putenv("GST_PLUGIN_SCANNER=/Users/rustines/Documents/workspace/mapmap/MapMap.app//Contents/Frameworks/GStreamer.framework/Versions/Current/libexec/gstreamer-1.0/gst-plugin-scanner");
putenv("GTK_PATH=/Users/rustines/Documents/workspace/mapmap/MapMap.app//Contents/Frameworks/GStreamer.framework/Versions/Current/");
putenv("GIO_EXTRA_MODULES=/Users/rustines/Documents/workspace/mapmap/MapMap.app//Contents/Frameworks/GStreamer.framework/Versions/Current/lib/gio/modules");
qDebug() << app.applicationDirPath() << endl;
#if USING_QT_5
QCommandLineParser parser;