Hi Norbert,

On Fri, Jul 03, 2020 at 07:58:38PM +0900, Norbert Preining wrote:
> Now it simply does not compile. sip5 seems to be different:
>
> SIPing 3 files...
> sip5 -w -c /tmp/calibre-4.99.4+dfsg+really4.19.0/build/pyqt/pictureflow -b 
> /tmp/calibre-4.99.4+dfsg+really4.19.0/build/pyqt/pictureflow/pictureflow.sip.sbf
>  -I/usr/lib/python3/dist-packages/PyQt5/bindings/ -n sip -t WS_X11 -t 
> Qt_5_14_0 
> /tmp/calibre-4.99.4+dfsg+really4.19.0/src/calibre/gui2/pictureflow/pictureflow.sip
> usage: sip5 [-h] [-V] [-a FILE] [--abi-version VERSION] [-B TAG] [-c DIR] [-D]
>             [-e] [-f] [-g] [-I DIR] [-j FILES] [-n NAME] [-o] [-P] [-r]
>             [-s SUFFIX] [-t TAG] [-w] [-x FEATURE] [-X ID:FILE] [-y FILE]
>             [FILE]
> sip5: error: unrecognized arguments: -b 
> /tmp/calibre-4.99.4+dfsg+really4.19.0/src/calibre/gui2/pictureflow/pictureflow.sip
>
> Are you sure that sip(4) and sip5 are actually compatible in any
> reasonable way?

I expected them to be compatible. The documentation [1] says that “sip5 is a
drop-in replacement for the sip code generator included with SIP v4”.

However, indeed it looks like the -b option was removed [2], and sip5 can no
longer generate .sbf files. Calibre's build system (namely get_sip_data()
function) uses those files, so that is a problem :-(

I can suggest two ways to fix this:

- The build system creates a separate directory for every build file (the
  "os.makedirs(src_dir, exist_ok=True)" call). So the needed headers and
  sources can be received by simply looking at what files are in that
  directory (e.g. using glob module).

- Alternatively, if you pass "-j 1" to sip, it will create only one .cpp file,
  which will make things even simplier.

Good news is that all other options used in the command line above are present
in sip5. However I noticed one more thing: "-n sip" needs to be replaced with
"-n PyQt5.sip".

Maybe you can file a bug upstream for this? I see Kovid started some work on
sip5 [3] so maybe he will be interested in this?

[1]: 
https://www.riverbankcomputing.com/static/Docs/sip/legacy_command_line_tools.html#sip5
[2]: https://riverbankcomputing.com/hg/sip/rev/f152b2474968
[3]: https://github.com/kovidgoyal/calibre/commit/5ef79c742a87df12

--
Dmitry Shachnev

Attachment: signature.asc
Description: PGP signature

Reply via email to