Provide QT5 libs in Bundle lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- shogun · 2019-02-14 07:55 Hello, I made an app that is compilable in lazarus IDE using QT5 Widgetset (v5.6.3). After that, I tried to create a bundle with this app and embendding QT5 Libraries in this bundle. For that, I use macqtdeploy tool to integrate frameworks in the bundle but the app crash when I try to run it on a fresh OSX install. Is there any additionnal step to do to make it works (use install_name_tool, copy plugins, ... )? Does I need to recompile QT5 statically (actually I follow the wiki guide and compile QT5Pas framework only)? ---------------------------------------------------------------------- DonAlfredo · 2019-02-14 08:13 You can have a look at the fpcupdeluxe QT5 app for Darwin. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v1.6 .2m/fpcupdeluxe-x86_64-darwin-qt5.zip It has the QT5 framework embedded. ---------------------------------------------------------------------- zeljko · 2019-02-14 08:40 I have script for macdeploy of qt5 apps on mac, currently away from computer, just ping me on priv msg and I"ll upload it here ---------------------------------------------------------------------- shogun · 2019-02-14 10:33 Thanks for your answers. I will have a look at fpcupdeluxe. Zeljko, yes i'm very interested with your script ... If you can upload here it will be nice. ---------------------------------------------------------------------- shogun · 2019-02-14 15:27 I've finally find that I have to add rpath value manually with install_name_tool command. But I still interested with your script ... This is how to make it work from a fresh install of OSX 10.12.5 : Step 1 : Install OSX Sierra 10.12.5 Step 2 : Install xcode 7.3.1 + Command Line tools Step 3 : Install QT 5.9.7 Step 4 : Install fpc-src-3.0.4, install fpc-3.04 using dmg images. Step 5: Checkout lazarus trunk with svn compile with make bigide PP=ppc386 Step 6: Setup Qt5 for Lazarus : LazarusDir=/Developer/Lazarus QtDir=~/Qt5.9.7 cd $LazarusDir/lcl/interfaces/qt5/cbindings PATH=$QtDir/5.9.7/clang_64/bin:$PATH qmake make make install cd /Library/Frameworks sudo ln -s $QtDir/5.9.7/clang_64/lib/*.framework . Step 7: Open project, set Compiler Executable in Tools→Option to /usr/local/bin/ppcx64 Set LCLWidgetType=qt5 in Project Options (Additions & Overrides) and create application bundle from Project Options Tab Compile your project Step 7 : Copy compiled application in your_bundle.app/Contents/MacOS Customise your_bundle.app/Contents/Info.plist if needed Step 8 : cd /Library/Frameworks/Qt5Pas.framework/Versions/1/ sudo mkdir -p Qt5Pas.framework/Versions/1/ sudo cp Qt5Pas Qt5Pas.framework/Versions/1/                                                                       *** Note: This directory structure is strange but without this step, macdeployqt returns errors *** $QtDir/5.9.7/clang_64/bin/macdeployqt your_bundle.app cd your_bundle.app/Contents/MacOS/ install_name_tool -add_rpath @executable/../Frameworks/  ./name_of_your_executable cd your_bundle.app/Contents/Frameworks/Qt5Pas.framework/Versions/1 install_name_tool -change @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport @executable_ path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport ./Qt5Pas install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Fr ameworks/QtWidgets.framework/Versions/5/QtWidgets ./Qt5Pas install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./Qt5Pas install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Fr ameworks/QtNetwork.framework/Versions/5/QtNetwork ./Qt5Pas install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./Qt5Pas