[Interest] Build Qt from source in 32bit (-platform macx-clang-32)

Nuno Santos nunosantos at imaginando.pt
Thu May 28 16:38:41 CEST 2015


> On 28 May 2015, at 12:54, René J.V. Bertin <rjvbertin at gmail.com> wrote:
> 
> On Thursday May 28 2015 10:09:52 Nuno Santos wrote:
> 
>>> Stupid question: you did check that not only is the framework bundle there, its payload is there too exactly as shown?
>> 
>> Sorry about my ignorance. what is the payload?
> 
> The contents of the .framework directory inside the Contents/Frameworks directory inside the application bundle.

Yes.

> 
> 
>> I’m a baby boy regarding libraries, plugins and specially about the details of each platform. This is not something I deal on a daily basis so the learn curve tends to be quite hard.
> 
> If the file does exist, what does 
> %> file "Your application".app/Contents/Frameworks/QtQuick.framework/Versions/5/QtQuick
> 
> say?

My answer will be with QtCore because I’m cutting down everything that could be a potential problem. Right now i’m cutting dependencies out of the plugin in order to see if the problem was in fact from QtQuick.framework or from anything else. So I have made QT -= qml quick and now it’s basically linking only with QtCore and QtGui. The problem remains. If I run macdeployqt on it, it doesn’t get loaded by the host anymore. This is the output of the command you asked me:
 
MACKIE:64 nsantos$ file audiolab.vst/Contents/Frameworks/QtCore.framework/Versions/5/QtCore 
audiolab.vst/Contents/Frameworks/QtCore.framework/Versions/5/QtCore: Mach-O 64-bit dynamically linked shared library x86_64
MACKIE:64 nsantos$

> 
>> 
>> I’m not sure if I can reply explicitly answer to your questions. The only thing I know so far is that if I build the bundle as 64 bit, run macdeploy on it and load it on a 64 bit host program, it behaves the same way, so I assume this is not an issue related with the 32 bit build. 
> 
> Indeed. I didn't notice this however:
>> Referenced from:
>> /Users/nsantos/Dropbox/workspace/drc/vstbuild/64/audiolab.vst/Contents/MacOS/audiolab
>                                                            ^^^
> 
> It is not entirely impossible that your issue arises from the fact that you use @executable_path in something that may not be recognised as an app bundle: what happens if you rename audiolab.vst to audiolab.app ?
> 
>> I can also observe that the bundle does load, if I don’t run macdeployqt on it. But i’m also sure that it won’t open on another computer without Qt installed on the same path. 
> 
> Where does it get installed if you don't use macdeployqt?

Xcode has a template for plugin bundles. QtCreator don’t. To avoid using Xcode I have searched which flags are used to produce a plugin bundle. This was my conclusion:

macx:{
    CONFIG += plugin
    QMAKE_LFLAGS_PLUGIN -= -single_module -dynamiclib
    QMAKE_LFLAGS_PLUGIN += -bundle
    QMAKE_POST_LINK = mv -f $(TARGET) $$TARGET
    OTHER_FILES += Info.plist
}

This produces a dylib which I rename to target as you can see in the following output:

rm -f libaudiolab.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.7 -bundle -o libaudiolab.dylib audioeffect.o audioeffectx.o vstplugmain.o IVstWrapper.o qrc_qml.o qrc_resources.o moc_IVstWrapper.o  -F/Users/nsantos/Qt/5.4/clang_64/lib -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL  
mv -f libaudiolab.dylib audiolab

The bundle structure is the following:

target.vst 
 - PkgInfo 
 - MacOS
   - target (dylib without extension)
 - Resources

So basically what I do is to manually copy the output lib without the extension inside the MacOS dir.

Then I point the host program to search for plugins in the folder where this is contained, and it gets found.

Cool! But now I’m trying to distribute this and see if it works on other computers beside mine:

macdeployqt target.vst -qmldir=path_to_qml_dir


> 
>> Is macdeployqt a recommended procedure for bundles? Or this is definitely not related?  
> 
> Do you mean plugin bundles here, or the term bundle in the general sense that includes application bundles?

Yes, I mean plugin bundles.

> 
> Someone else will have to help you with that. I never use macdeployqt myself, as all my Qt grappling takes place in the MacPorts context, i.e. with a central Qt installation. I usually find myself undoing the effects of attempts to bundle everything into an application bundle ...
> 
> R.

Ok. Thanks anyway.

Regards,

Nuno

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150528/a1ae56f3/attachment.html>


More information about the Interest mailing list