I had posted that allready on the github issue page, but i will just post it here too.
i am willing to write a blogpost on how to create a portable OSX app with go and go-qml, maybe even throw in some code to build the app on the fly,
all i want is to get some help towards this problem here:
While this might rather be a problem with Qt5.5 i guess it can only be fixed in the go-qml itself, since it needs changes on how the c++ part is compiled, long story short.
i use macdeployqt to add qt framework to a app bundle, that way my executable is referenced to a bunch of qt libs that are relative ( portable)
i end up with something like ( so you see everything is linked relative to @executable_path)
# otool -L myProgram
gcode2time:
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.5.0, current version 5.5.0)
@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.5.0, current version 5.5.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.5.0, current version 5.5.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.5.0, current version 5.5.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.5.0, current version 5.5.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.5.0, current version 5.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
when i run it i get
objc[6213]: Class NotificationReceiver is implemented in both /Users/user/tools/go/src/gcode2time/LaydropCostCalculator.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets and /usr/local/Cellar/qt5/5.5.0/lib/QtWidgets.framework/QtWidgets. One of the two will be used. Which one is undefined.
i figured that this is to the fact that QApplication::setStyle(QStyleFactory::create("Fusion")); is called before QApplication app(argc, argv); is called, well i reference that from
i tried to find the corresponding part in go-qml, i coudn't maybe someone has some advice on how to make sure qt main() is structured in a way that resamples this post.
i am willing to write a blogpost on how to create a portable OSX app with go and go-qml, maybe even throw in some code to build the app on the fly,all i want is to get some help towards this problem here:
While this might rather be a problem with Qt5.5 i guess it can only be fixed in the go-qml itself, since it needs changes on how the c++ part is compiled, long story short.
i use macdeployqt to add qt framework to a app bundle, that way my executable is referenced to a bunch of qt libs that are relative ( portable)
i end up with something like ( so you see everything is linked relative to @executable_path)
# build the bundle structure
APP="myapp.app"
mkdir $APP
mkdir $APP/Contents
mkdir $APP/Contents/MacOS
mkdir $APP/Contents/Resources
# copy in all the files
cp Info.plist $APP/Contents/
cp myapp $APP/Contents/MacOS/
# all my qml files are in ui/
cp -r ui $APP/Contents/Resources/
# get all the required QT stuff into the bundle
/usr/local/Cellar/qt5/5.3.2/bin/macdeployqt $APP -verbose=1 -qmldir=$APP/Contents/Resources -dmg