Add support for SIP v5 bindings
SIP v5 and above rely on a PEP-0518 based tooling system to build bindings (usually distutils). v4, as our currently supported generator, is only a dummy tool -- it relies on the user to compile and link the bindings. This commit adds support for SIP v5. - I've added a "sip-generate" tool, that differs from the standard sip-build in that it only generates the binding glue; this relies on a private, undocumented method of the sipbuild.Builder class. - The cmake/modules directory now has a pyproject.toml skeleton manifest, which is processed by the new add_sip_python_module_v5 macro. It works identically to the v4 macro, but targets the sip-generate tool. Compilation happens in the exact same was as we do with v4. Key remarks: - All the data must be now injected in the skeleton manifest (as opposed to build flags in v4). - SIP v5 makes use of protected Qt methods; for this reason, it supplies a "protected-as-public" override, which I emulate in the add_sip_python_module_v5 macro. - Like v4, v5 also needs to be told the fully qualified name of the SIP package (e.g. `import PyQt5.sip` -- PyQt5.sip is the value). Otherwise, the native library will not find the package and the initialization will fail. - The initialization function changes, from "PyInit_pykrita" to "PyInit_krita" (the innermost module name). This has been macro'd for backwards compatibility. BUG: 415743 CCMAIL: kimageshop@kde.org (cherry picked from commit 5bb4874a)
Loading
Please register or sign in to comment