mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Reconfigured build script for deploying on Mac (still not working)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user