Correct way to add third-party sip extensions to pyqtdeploy project?

Patrick Stinson patrickkidd at gmail.com
Thu Sep 24 06:59:02 BST 2020


Got it.

I’ve now managed to get pyqtdeploy to use my sysroot component plugin to add my app’s extension module source files to the qmake project. Is there any way to tell the ExtensionModule that there is a sip file so it will do what sip-build does by generating the C++ sources and setting up C++ flags correctly? What about generating moc files for .h headers?

My extension is starting to get busy with those mangled sip-build file names, and it’s also complaining about sip.h, and I imagine more things if I fix those problems with manual paths.


class VedanaComponent(Component):
    """ The vedana module component. """

    must_install_from_source = False
    preinstalls = ['Python', 'PyQt', 'Qt', 'SIP']
    provides = {
        '_pkdiagram':
            ExtensionModule(
                deps='PyQt:PyQt5.QtWidgets',
                source=[
                    "../../../_pkdiagram/unsafearea.cpp",
                    "../../../_pkdiagram/_pkdiagram.cpp",
                    "../../../_pkdiagram/_pkdiagram_mac.mm",
                    "../../../_pkdiagram/build/_pkdiagram/moc_unsafearea.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/moc__pkdiagram.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramAppFilter.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramcmodule.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramCUtil.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramFDDocument.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramPathItemBase.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramPathItemDelegate.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramPersonDelegate.cpp",
                    "../../../_pkdiagram/build/_pkdiagram/sip_pkdiagramQMap0100QString0100QString.cpp",
                ],
                defines=[ "PK_DEBUG_BUILD=0" ],
                qmake_qt=[ 'gui', 'widgets' ]
            )
    }

    def get_archive_name(self):
        return ''

    def install(self):
        """ Install for the target. """

> On Sep 3, 2020, at 9:28 AM, Phil Thompson <phil at riverbankcomputing.com> wrote:
> 
> Look at the plugins that are bundled with pyqtdeploy.
> 
> On 03/09/2020 17:51, Patrick Stinson wrote:
>> Ok. Is there an example? I’m reading the docs and trying to imagine
>> how the component plugin will look if there is a pure C++ sip
>> extension in the app source tree and if there is a mixed C++ / Python
>> package in the app source tree. I have both.
>>> On Sep 2, 2020, at 11:59 PM, Phil Thompson <phil at riverbankcomputing.com> wrote:
>>> On 03/09/2020 05:33, Patrick Stinson wrote:
>>>> My app project contains two custom sip5 modules that build
>>>> successfully on their own. How are these added to the pyqtdeploy
>>>> project? Is pyqtdeploy supposed to automatically pick them up somehow?
>>>> I don’t see them listed under “Other Packages”
>>> You have to write a plugin...
>>> https://www.riverbankcomputing.com/static/Docs/pyqtdeploy/sysroot.html#writing-a-component-plugin
>>> Phil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200923/afae0730/attachment.htm>


More information about the PyQt mailing list