Bug#964127: plplot: Please switch from sip4 to sip5

Dmitry Shachnev mitya57 at debian.org
Thu Jun 17 15:50:08 BST 2021


Control: tags -1 + patch

Hi again Rafael!

On Tue, Dec 01, 2020 at 06:02:47PM +0100, Rafael Laboissière wrote:
> I tried to build PLplot with my changes for SIP5 and againts version
> 5.15.2+dfsg-1 of pyqt5-dev.  It still fails with the error below.

I have just noticed that the emails I sent to plplot-devel mailing list
have not reached it for some reason and do not show up in the archives [1].
Maybe I need to be subscribed, or there is some moderation?

In my email from 2020-12-03 there was a patch to port to SIP 5/6. I am
attaching this patch here. The upstream developer (Alan W. Irwin) was one
of the recipients, so I hope he got that mail.

Copying the contents of my mail below, with slight corrections:

I have attached a draft patch that makes plplot build successfully with
sip-build. It retains compatibility with SIP 4, although I have not tested
that version.

My approach abuses the SIP's build system. sip-build generates a .pro file
for qmake and tries to run qmake by default. I decided that it's better to
rely on CMake to do the actual compilation (e.g. so that all compiler flags
are honored), so I pass --no-build to sip-build and then copy the .cpp and
.h files it generated to CMake's build directory, then let CMake build them.

SIP adds two defines to the .pro file: SIP_PROTECTED_IS_PUBLIC and
protected=public. This is needed to fix errors like:

  build/plplot_pyqt5/sipplplot_pyqt5QtExtWidget.cpp:1476:67: error:
  ‘virtual void QtExtWidget::paintEvent(QPaintEvent*)’ is protected within this context
   1476 |             (sipSelfWasArg ? sipCpp-> ::QtExtWidget::paintEvent(a0) : sipCpp->paintEvent(a0));
        |                                                                   ^

So I have copied these two defines to CMake code. SIP does not add them on
Windows but I think they won't hurt there.

How to test it:

- With Debian packages: sudo apt install sip-tools python3-pyqtbuild
- With upstream packages: pip install sip PyQt-builder

Then build as usual (the code prefers SIP 5/6 to 4 if both are available).

Please test it and let me know what you think.

[1]: https://sourceforge.net/p/plplot/mailman/plplot-devel/?viewmonth=202012

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-building-with-sip-build.patch
Type: text/x-diff
Size: 4760 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20210617/ff0d3bc9/attachment.patch>


More information about the debian-science-maintainers mailing list