Re: using sip-wheel on MacOS

Steve Borho <[email protected]> Tue, 28 Apr 2020 12:49:15 -0500
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <[email protected]>

> On Apr 28, 2020, at 3:58 AM, Phil Thompson <[email protected]> wrote:
> 
> On 28/04/2020 04:55, Steve Borho wrote:
>> Hello,
>> On Linux and Windows I can use sip-wheel to build binary wheels that
>> will gladly use the Qt libraries packaged by PyQt5, by compiling
>> against the same local version of Qt.
>> But when I try this on Mac, it is linking in the full paths to the
>> local (homebrew) Qt libraries
>> $ otool -L foo.cpython-37m-darwin.so
>> foo.cpython-37m-darwin.so:
>> 	/usr/local/opt/qt/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport
>> (compatibility version 5.14.0, current version 5.14.1)
>> 	/usr/local/opt/qt/lib/QtOpenGL.framework/Versions/5/QtOpenGL
>> (compatibility version 5.14.0, current version 5.14.1)
>> 	/usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets
>> (compatibility version 5.14.0, current version 5.14.1)
>> 	/usr/local/opt/qt/lib/QtDataVisualization.framework/Versions/5/QtDataVisualization
>> (compatibility version 5.14.0, current version 5.14.1)
>> 	/usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui (compatibility
>> version 5.14.0, current version 5.14.1)
>> I see that sip-wheel has an option for:
>>  --target-qt-dir DIR   the Qt libraries will be found in DIR when the wheel
>>                        is installed
>> but it is not clear how to target the PyQt5 packaged Qt libraries.
>> Has anyone else tackled this?  Thanks
> 
> Assuming you are going to package a Qt installation with your wheel using pyqt-bundle at a later stage then pass '--target-qt-dir Qt/lib'.
> 
> This will be documented in the next release of the PyQt docs.

Ideally the binaries in the wheel would use the Qt libraries in ../PyQt5/Qt/lib/* from site-packages.

Does my app need to package its own copy of the Qt libraries if it compiles its own shared library?

I just realized my Linux wheels have the same issue.  They are not using PyQt5/Qt/lib, they are relying on the Qt libraries being present where they were compiled.

Thanks,

Steve Borho