diff mbox series

[bug#42885,23/27] gnu: calibre: Update to 5.13.0.

Message ID 20210310090053.21612-23-mail@brendan.scot
State Accepted
Headers show
Series [bug#42885,01/27] gnu: python-sip: Update to 5.5.0. Add python-sip-4 | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Brendan Tildesley March 10, 2021, 9 a.m. UTC
* gnu/packages/ebook.scm (calibre): Update to 5.13.0.

Switch all Python 2 inputs to their Python 3 equivalents.

[native-inputs]: Add new dependency python-pyqt-builder.

[inputs]: Remove js-mathmax. Calibre now uses a newer mathjax that we
don't have in guix since it's needs a javascript bootstrap.
Remove python-chardet. This is still used by python-html5lib but since
 I added the input directly to python-htmpl5lib, it is no longer needed
 here.
Remove chmlib. python-chmlib bindings are used now.
Remove python-sip
Add new dependencies:
  - python-cchardet
  - python-speechd
  - python-zeroconf
  - python-py7zr
  - python-pychm
  - python-pycryptodome (Used by some Calibre extensions)

[arguments]: get_sip_dir isn't used anymore, so now we specify the sip
directory by editing the project.toml file. Also, for whatever reason,
it doesn't build unless the WS_X11 tag is set.
Don't try building mathjax support.
Don't set SIP_BIN anymore since it isn't needed.

* gnu/packages/patches/calibre-no-updates-dialog.patch
* gnu/packages/patches/calibre-remove-test-sqlite.patch
* gnu/packages/patches/calibre-remove-test-unrar.patch
Remake these patches to work with the slightly different new source
code.

startars
---
 gnu/packages/ebook.scm                        | 101 +++++++++---------
 .../patches/calibre-no-updates-dialog.patch   |  22 ++--
 .../patches/calibre-remove-test-sqlite.patch  |  21 ++--
 .../patches/calibre-remove-test-unrar.patch   |  24 ++---
 4 files changed, 88 insertions(+), 80 deletions(-)

Comments

Leo Famulari March 23, 2021, 6:25 p.m. UTC | #1
On Wed, Mar 10, 2021 at 08:00:49PM +1100, Brendan Tildesley wrote:
> * gnu/packages/ebook.scm (calibre): Update to 5.13.0.
> 
> Switch all Python 2 inputs to their Python 3 equivalents.

Thanks a lot for working on this! I'm going to start reviewing / pushing
patches today.
Leo Famulari March 23, 2021, 6:36 p.m. UTC | #2
On Wed, Mar 10, 2021 at 08:00:49PM +1100, Brendan Tildesley wrote:
> * gnu/packages/ebook.scm (calibre): Update to 5.13.0.
> 
> Switch all Python 2 inputs to their Python 3 equivalents.

Alright, the patches are aleady stale, even at patch 2 of 27.

To make this easier, can you either put this work online in a Git repo
somewhere? It's easier to clone a repo with a custom branch to rebase
the patches.

Alternatively, can you say which older Guix Git commit these patches
apply to?

Thansk!
Brendan Tildesley March 24, 2021, 2:13 a.m. UTC | #3
> On 03/23/2021 7:36 PM Leo Famulari <leo@famulari.name> wrote:
> 
>  
> On Wed, Mar 10, 2021 at 08:00:49PM +1100, Brendan Tildesley wrote:
> > * gnu/packages/ebook.scm (calibre): Update to 5.13.0.
> > 
> > Switch all Python 2 inputs to their Python 3 equivalents.
> 
> Alright, the patches are aleady stale, even at patch 2 of 27.
> 
> To make this easier, can you either put this work online in a Git repo
> somewhere? It's easier to clone a repo with a custom branch to rebase
> the patches.
> 
> Alternatively, can you say which older Guix Git commit these patches
> apply to?
> 
> Thansk!

https://notabug.org/Brendan/guix/src/calibre-5.13.0

I fixed the conflict updated to latest master here.
Also, a minor change, I oved the 
"gnu: veusz: Fix build"
 until after 
"gnu: python-pyqt: Fix build for new python-sip."
since it doesn't actually work until that ones applied.
Leo Famulari March 29, 2021, 8:12 p.m. UTC | #4
On Wed, Mar 24, 2021 at 03:13:26AM +0100, Brendan Tildesley wrote:
> https://notabug.org/Brendan/guix/src/calibre-5.13.0
> 
> I fixed the conflict updated to latest master here.
> Also, a minor change, I oved the 
> "gnu: veusz: Fix build"
>  until after 
> "gnu: python-pyqt: Fix build for new python-sip."
> since it doesn't actually work until that ones applied.

Thanks for the updated branch! I'm going through the patches now.
Leo Famulari March 29, 2021, 11:05 p.m. UTC | #5
On Wed, Mar 24, 2021 at 03:13:26AM +0100, Brendan Tildesley wrote:
> https://notabug.org/Brendan/guix/src/calibre-5.13.0

Can you clarify some things about the commit "gnu: python-pyqt: Fix
build for new python-sip"? First, python-pyqt before applying this
commit; if it's broken, can you say how?

Also, there is a comment "Linking here means the sip module can be found
without python-pyqt5-sip needing to be added as an input". But,
python-pyqt5-sip is an input to this package. Can you explain what you
mean?

I think we should drop the commit "gnu: calibre: Add qtsvg as input.",
since it adds a dependency but for what seems to be no reason. What do
you think?

Based on your branch, I've made the following changes and pushed the
branch at
<https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-update-calibre>.

Can you take a look and tell me what you think?

I squashed the first two commits, so that there is no commit where
python2-sip fails to build. It's not always easy to avoid intermediate
breakage in complicated package upgrades like this, but it's worth
trying. At least, it can improve the utility of `git bisect`.

I also squashed the "fix veusz" commit into that one, for the same
reason. And all the rest of the commits that are adjusting to that
change.

For the "Fix build for new python-sip" commit, I removed the hardcoding
of "python3.8" in the 'pyqt5-sip' phase, and instead used the
python-version procedure.

I squashed the remaining cleanup-type commits into the Calibre update.

I pushed the commit 'gnu: python-poppler-qt5: Update to 21.1.0.' as
02f664a0a3dd3a936213e687802bdc62f2a10983

I corrected the license of python-pychm from gpl3 to gpl2+.

I made many other changes to satisfy `guix lint`, and improved synopses
and descriptions.
Brendan Tildesley March 30, 2021, 6:23 a.m. UTC | #6
> On 03/30/2021 1:05 AM Leo Famulari <leo@famulari.name> wrote:
> 
>  
> On Wed, Mar 24, 2021 at 03:13:26AM +0100, Brendan Tildesley wrote:
> > https://notabug.org/Brendan/guix/src/calibre-5.13.0
> 
> Can you clarify some things about the commit "gnu: python-pyqt: Fix
> build for new python-sip"? First, python-pyqt before applying this
> commit; if it's broken, can you say how?

Me adding python-pyqt-builder here looks like a mistake. I left it
there while experimenting.  When I was Upgrading SIP, I experimented
with switching to the new 'sip-build' tool introduced in SIP 5. SIP
6's main change is to delete obsoleted code, so the old 'python
configure.py' won't work. I never got it working so I just went back
to the old way with SIP 5.  python-pyqt-builder is still needed by
Calibre however.

The only other functional change in this patch is to remove the patch
pyqt-public-sip.patch.  The introduction of python-pyqt5-sip as a
separate module means means that with this patch, the module is not
found at all. Removing it fixes it. I don't understand it in any great
depth but it seems the patch may only really relevant to SIP 4.

> Also, there is a comment "Linking here means the sip module can be found
> without python-pyqt5-sip needing to be added as an input". But,
> python-pyqt5-sip is an input to this package. Can you explain what you
> mean?

Upstream for whatever reason chose to move the sip module part out in
to a separate source package python-pyqt5-sip. It's broken without
removing the pyqt-public-sip.

The linking can be removed, but it would mean for every input that
requires python-pyqt5 as an input, you also need to add
python-pyqt5-sip so the sip module can be found. On a distribution
with a traditional filesystem layout, that would not be necessary, you
just have the -sip module as a dependency to pyqt5 and its then its
available at a global path to be found. On Nix/Guix that doesn't work
so it has to be added every time, or linked in like this. Actually I'm
not sure if there is ever any case where one /doesn't/ need the sip
modules, but they're only 200KiB. The Nix developers chose to just
link it like this so I copied their way. Do you think it's fine?

> I think we should drop the commit "gnu: calibre: Add qtsvg as input.",
> since it adds a dependency but for what seems to be no reason. What do
> you think?

The reason I added qtsvg was to try fix the Qt test. If you remove the
line (setenv "SKIP_QT_BUILD_TEST" "true"), this test fails for
multiple reasons.  One of them was qtsvg missing. Another was the
get_exe_path bit. But a third reason I that its call to printtopdf in
pyqtwebegine returns an empty string instaed of b'Skia/PDF'. I had no
idea how to proceed with fixing that so I left it for now. But at
least fixed the other errors. I assume some SVG related functionality
will fail without it...

> Based on your branch, I've made the following changes and pushed the
> branch at
> <https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-update-calibre>.
> 
> Can you take a look and tell me what you think?
> 
> I squashed the first two commits, so that there is no commit where
> python2-sip fails to build. It's not always easy to avoid intermediate
> breakage in complicated package upgrades like this, but it's worth
> trying. At least, it can improve the utility of `git bisect`.
> 
> I also squashed the "fix veusz" commit into that one, for the same
> reason. And all the rest of the commits that are adjusting to that
> change.
> 
> For the "Fix build for new python-sip" commit, I removed the hardcoding
> of "python3.8" in the 'pyqt5-sip' phase, and instead used the
> python-version procedure.
> 
> I squashed the remaining cleanup-type commits into the Calibre update.
> 
> I pushed the commit 'gnu: python-poppler-qt5: Update to 21.1.0.' as
> 02f664a0a3dd3a936213e687802bdc62f2a10983
> 
> I corrected the license of python-pychm from gpl3 to gpl2+.
> 
> I made many other changes to satisfy `guix lint`, and improved synopses
> and descriptions.

All good I think. My descriptions were much worse than I realised.

python-cchardet differs from in python-chardet in that its not written
/in/ python, but links to a fast C library to do it, but your
description/synopsis changes make it look like its all in
Python. Maybe make the description:
 
"cChardet is a character encoding detector, binding to the C
library uchardet for speed." ?

I fixed another one of my typos 'statical' -> 'statistical', and
removed the python-pyqt-builder input from python-pyqt

https://notabug.org/Brendan/guix/src/wip-update-calibre
Brendan Tildesley March 30, 2021, 10:45 a.m. UTC | #7
Just updated for Calibre 5.14.0 released 4 days ago also.

https://notabug.org/Brendan/guix/src/wip-update-calibre
Leo Famulari April 4, 2021, 5:46 p.m. UTC | #8
On Tue, Mar 30, 2021 at 12:45:18PM +0200, Brendan Tildesley wrote:
> Just updated for Calibre 5.14.0 released 4 days ago also.
> 
> https://notabug.org/Brendan/guix/src/wip-update-calibre

Thanks! I will review these today or tomorrow.
Leo Famulari April 5, 2021, 7:58 p.m. UTC | #9
On Tue, Mar 30, 2021 at 08:23:43AM +0200, Brendan Tildesley wrote:
> Me adding python-pyqt-builder here looks like a mistake. I left it
> there while experimenting.  When I was Upgrading SIP, I experimented
> with switching to the new 'sip-build' tool introduced in SIP 5. SIP
> 6's main change is to delete obsoleted code, so the old 'python
> configure.py' won't work. I never got it working so I just went back
> to the old way with SIP 5.  python-pyqt-builder is still needed by
> Calibre however.
> 
> The only other functional change in this patch is to remove the patch
> pyqt-public-sip.patch.  The introduction of python-pyqt5-sip as a
> separate module means means that with this patch, the module is not
> found at all. Removing it fixes it. I don't understand it in any great
> depth but it seems the patch may only really relevant to SIP 4.

Okay. I adjusted the commit message to match your revision.

> > On 03/30/2021 1:05 AM Leo Famulari <leo@famulari.name> wrote:
> > Also, there is a comment "Linking here means the sip module can be found
> > without python-pyqt5-sip needing to be added as an input". But,
> > python-pyqt5-sip is an input to this package. Can you explain what you
> > mean?
> 
> Upstream for whatever reason chose to move the sip module part out in
> to a separate source package python-pyqt5-sip. It's broken without
> removing the pyqt-public-sip.
> 
> The linking can be removed, but it would mean for every input that
> requires python-pyqt5 as an input, you also need to add
> python-pyqt5-sip so the sip module can be found. 

If I understand correctly, the issue that any package that uses
python-pyqt5 also needs to be able to find python-pyqt5-sip. Is that
right?

If so, it sounds like a case for propagated-inputs [0]. Concretely, I made
python-pyqt5-sip a propagated-input of python-pyqt and removed the
'pyqt5-sip' phase, and Calibre built successfully.

Does that seem like the right approach?

> The reason I added qtsvg was to try fix the Qt test. If you remove the
> line (setenv "SKIP_QT_BUILD_TEST" "true"), this test fails for
> multiple reasons.  One of them was qtsvg missing. Another was the
> get_exe_path bit. But a third reason I that its call to printtopdf in
> pyqtwebegine returns an empty string instaed of b'Skia/PDF'. I had no
> idea how to proceed with fixing that so I left it for now. But at
> least fixed the other errors. I assume some SVG related functionality
> will fail without it...

That's a good point. However, I checked if the built Calibre refers to
qtsvg, and it doesn't [1]. So, it's unlikely that Calibre will be able to
find and use qtsvg, regardless of whether or not it's an input. So, I'd
prefer to leave it out until we understand what it's for and how to make
sure that Calibre can use it.

> All good I think. My descriptions were much worse than I realised.

No worries. Writing the synopses and descriptions is a completely
different type of work from packaging or programming. I often "finish"
some packages, but need to go back later to write the descriptions. I'm
happy to finish these tasks as part of the code review process.

> python-cchardet differs from in python-chardet in that its not written
> /in/ python, but links to a fast C library to do it, but your
> description/synopsis changes make it look like its all in
> Python. Maybe make the description:
>  
> "cChardet is a character encoding detector, binding to the C
> library uchardet for speed." ?

Thanks, that helps. I amended the synopses and description based on
this.

I pushed my revisions of your updated branch, rebased on the current
master branch, to Savannah:

https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-update-calibre

[0]
https://guix.gnu.org/manual/en/html_node/package-Reference.html

[1] This command be used:
$ guix gc --references $(./pre-inst-env guix build --no-grafts calibre) | grep qtsvg
Brendan Tildesley April 6, 2021, 1:30 a.m. UTC | #10
> On 04/05/2021 9:58 PM Leo Famulari <leo@famulari.name> wrote:

[...]

> If I understand correctly, the issue that any package that uses
> python-pyqt5 also needs to be able to find python-pyqt5-sip. Is that
> right?
> 
> If so, it sounds like a case for propagated-inputs [0]. Concretely, I made
> python-pyqt5-sip a propagated-input of python-pyqt and removed the
> 'pyqt5-sip' phase, and Calibre built successfully.
> 
> Does that seem like the right approach?
> 

Sounds good. I didn't realise propagated-inputs did that, I thought they were
just normal inputs that were installed along side the package in a profile,
but wouldn't make a difference during build time.
Does this mean all packages that depend on python-pyqt5 will have python-pyqt5-sip
added to its own list of inputs in their own package definition? If so
the manual doesn't mention that.

> > The reason I added qtsvg was to try fix the Qt test. If you remove the
> > line (setenv "SKIP_QT_BUILD_TEST" "true"), this test fails for
> > multiple reasons.  One of them was qtsvg missing. Another was the
> > get_exe_path bit. But a third reason I that its call to printtopdf in
> > pyqtwebegine returns an empty string instaed of b'Skia/PDF'. I had no
> > idea how to proceed with fixing that so I left it for now. But at
> > least fixed the other errors. I assume some SVG related functionality
> > will fail without it...
> 
> That's a good point. However, I checked if the built Calibre refers to
> qtsvg, and it doesn't [1]. So, it's unlikely that Calibre will be able to
> find and use qtsvg, regardless of whether or not it's an input. So, I'd
> prefer to leave it out until we understand what it's for and how to make
> sure that Calibre can use it.

I see, that's a good trick for checking references.. Leave svg out for now then.

> 
> > All good I think. My descriptions were much worse than I realised.
> 
> No worries. Writing the synopses and descriptions is a completely
> different type of work from packaging or programming. I often "finish"
> some packages, but need to go back later to write the descriptions. I'm
> happy to finish these tasks as part of the code review process.
> 
I find writing them the most stressful part because I sit there not knowing
what to write.

> > python-cchardet differs from in python-chardet in that its not written
> > /in/ python, but links to a fast C library to do it, but your
> > description/synopsis changes make it look like its all in
> > Python. Maybe make the description:
> >  
> > "cChardet is a character encoding detector, binding to the C
> > library uchardet for speed." ?
> 
> Thanks, that helps. I amended the synopses and description based on
> this.
> 
> I pushed my revisions of your updated branch, rebased on the current
> master branch, to Savannah:
> 
> https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-update-calibre
> 
> [0]
> https://guix.gnu.org/manual/en/html_node/package-Reference.html
> 
> [1] This command be used:
> $ guix gc --references $(./pre-inst-env guix build --no-grafts calibre) | grep qtsvg
Leo Famulari April 6, 2021, 5:11 p.m. UTC | #11
On Tue, Apr 06, 2021 at 03:30:08AM +0200, Brendan Tildesley wrote:
> Sounds good. I didn't realise propagated-inputs did that, I thought they were
> just normal inputs that were installed along side the package in a profile,
> but wouldn't make a difference during build time.
> Does this mean all packages that depend on python-pyqt5 will have python-pyqt5-sip
> added to its own list of inputs in their own package definition? If so
> the manual doesn't mention that.

That's the idea: they are run-time dependencies of a package that lacks
the ability for recording references to its dependencies. We have to
help the package with our packaging tools.

In general, all Python packages in Guix use this mechanism.

Just to clarify, does Calibre work on your end with my latest Savannah
branch? I built it on CI, so you can get substitutes for it on x86_64.

The basics work for me: library management, conversion, etc.

I think we're almost done!

> I find writing them the most stressful part because I sit there not knowing
> what to write.

Don't hesitate to send in your patches with a note like, "I didn't know
what to put here".
Brendan Tildesley April 7, 2021, 3:57 a.m. UTC | #12
> On 04/06/2021 7:11 PM Leo Famulari <leo@famulari.name> wrote:
> 
>  
> On Tue, Apr 06, 2021 at 03:30:08AM +0200, Brendan Tildesley wrote:
> > Sounds good. I didn't realise propagated-inputs did that, I thought they were
> > just normal inputs that were installed along side the package in a profile,
> > but wouldn't make a difference during build time.
> > Does this mean all packages that depend on python-pyqt5 will have python-pyqt5-sip
> > added to its own list of inputs in their own package definition? If so
> > the manual doesn't mention that.
> 
> That's the idea: they are run-time dependencies of a package that lacks
> the ability for recording references to its dependencies. We have to
> help the package with our packaging tools.
> 
> In general, all Python packages in Guix use this mechanism.
> 
> Just to clarify, does Calibre work on your end with my latest Savannah
> branch? I built it on CI, so you can get substitutes for it on x86_64.
> 
> The basics work for me: library management, conversion, etc.
 
Works for me.
Leo Famulari April 8, 2021, 12:05 a.m. UTC | #13
While testing the dependents of packages changes in this patch series, I
found that QGIS fails to build as a result of these patches, like this:

------
[...]
[ 50%] Built target qgis_sqliteutilstest_autogen                    
make -f tests/src/core/CMakeFiles/qgis_layouthtmltest_autogen.dir/build.make tests/src/core/CMakeFiles/qgis_layouthtmltest_autogen.dir/depend
.sip5-real: Unable to find file "QtXml/QtXmlmod.sip"                
                                                
make[2]: Entering directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
cd /tmp/guix-build-qgis-3.16.3.drv-0/build && /gnu/store/3dsl2jalrcyldkrsqab1hc6sv8pyag9z-cmake-minimal-3.16.5/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/guix-build-qgis-3.16.3.drv-0/qgi
s-3.16.3 /tmp/guix-build-qgis-3.16.3.drv-0/qgis-3.16.3/tests/src/core /tmp/guix-build-qgis-3.16.3.drv-0/build /tmp/guix-build-qgis-3.16.3.drv-0/build/tests/src/core /tmp/guix-build-qgis-3.16.3
.drv-0/build/tests/src/core/CMakeFiles/qgis_layouthtmltest_autogen.dir/DependInfo.cmake --color=                                                                                            
Scanning dependencies of target qgis_layouthtmltest_autogen                
make[2]: Leaving directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'                        
make -f tests/src/core/CMakeFiles/qgis_layouthtmltest_autogen.dir/build.make tests/src/core/CMakeFiles/qgis_layouthtmltest_autogen.dir/build
make[2]: Entering directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
[ 50%] Automatic MOC for target qgis_layouthtmltest
cd /tmp/guix-build-qgis-3.16.3.drv-0/build/tests/src/core && /gnu/store/3dsl2jalrcyldkrsqab1hc6sv8pyag9z-cmake-minimal-3.16.5/bin/cmake -E cmake_autogen /tmp/guix-build-qgis-3.16.3.drv-0/build
/tests/src/core/CMakeFiles/qgis_layouthtmltest_autogen.dir/AutogenInfo.json RelWithDebInfo
make[2]: *** [python/CMakeFiles/python_module_qgis__core_autogen.dir/build.make:682: python/core/sip_corepart0.cpp] Error 1
make[2]: *** Deleting file 'python/core/sip_corepart0.cpp'
make[2]: Leaving directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:8003: python/CMakeFiles/python_module_qgis__core_autogen.dir/all] Error 2
[...]
builder for `/gnu/store/svp5sjdga02zngsrh3x613wjfqm2cwyi-qgis-3.16.3.drv' failed with exit code 1
------

I think the salient part is near the beginning:

.sip5-real: Unable to find file "QtXml/QtXmlmod.sip"

I tried using your original approach for pyqt5-sip, where you symlinked
it into the output of python-pyqt, but I got the same result.

I guess that we need to adjust the package python-pyqt+qscintilla. Any
ideas?
Leo Famulari April 8, 2021, 1:14 a.m. UTC | #14
> .sip5-real: Unable to find file "QtXml/QtXmlmod.sip"

I found an upstream bug report that is superficially similar:

https://issues.qgis.org/issues/20969

However, their solution is already done in our package: Make sure that
pyqt is available.
Leo Famulari April 8, 2021, 3:59 a.m. UTC | #15
On Wed, Apr 07, 2021 at 08:05:00PM -0400, Leo Famulari wrote:
> .sip5-real: Unable to find file "QtXml/QtXmlmod.sip"

I also noticed this passage in the QGIS ChangeLog:

------
Daniel Minor <daniel.minor@gmail.com>   2020-07-14

    Fix FindPyQt5 cmake and python scripts

    As written, the FindPyQt5.cmake and FindPyQt5.py scripts will succeed even if
    PyQt5 is not installed. In FindPyQt5.cmake, we have PYQT5_FIND_REQUIRED rather 
    than PyQt5_FIND_REQUIRED, so the package is always treated as though it is
    optional. In FindPyQt5.py, the script will succeed with a default location for
    the sip directory, even if the PyQt5 directory is not located.

    For some systems, if enough other dependencies are installed, the build can
    get about halfway complete without the main PyQt5 dependency, and then fail
    with a message like:

    sip: Unable to find file "QtXml/QtXmlmod.sip"

    I hit this building on Ubuntu, and there have been a few similar bug reports in
    the past.
------
Brendan Tildesley April 8, 2021, 4:11 a.m. UTC | #16
Well, using a python-pyqt with the python-sip input set back to python-sip-4 fixes it. Do we want to commit to getting it working with python-sip@5. I'm still playing around with it trying to get it to build

Not sure where you see that sip error. The builds fail for me with

make[2]: Leaving directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
make[2]: *** [python/CMakeFiles/python_module_qgis__core_autogen.dir/build.make:682: python/core/sip_corepart0.cpp] Error 1
make[2]: *** Deleting file 'python/core/sip_corepart0.cpp'
make[2]: Leaving directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:8003: python/CMakeFiles/python_module_qgis__core_autogen.dir/all] Error 2
Leo Famulari April 8, 2021, 4:28 a.m. UTC | #17
On Thu, Apr 08, 2021 at 06:11:55AM +0200, Brendan Tildesley wrote:
> Well, using a python-pyqt with the python-sip input set back to python-sip-4 fixes it. Do we want to commit to getting it working with python-sip@5. I'm still playing around with it trying to get it to build

I think it's okay to use python-sip-4, unless you want to hunt down this
bug.

> Not sure where you see that sip error. The builds fail for me with
> 
> make[2]: Leaving directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
> make[2]: *** [python/CMakeFiles/python_module_qgis__core_autogen.dir/build.make:682: python/core/sip_corepart0.cpp] Error 1
> make[2]: *** Deleting file 'python/core/sip_corepart0.cpp'
> make[2]: Leaving directory '/tmp/guix-build-qgis-3.16.3.drv-0/build'
> make[1]: *** [CMakeFiles/Makefile2:8003: python/CMakeFiles/python_module_qgis__core_autogen.dir/all] Error 2

I see these lines too, but later. The QtXml error may be a few lines
above.
diff mbox series

Patch

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 763e3eba2b..124fcda4df 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -2,7 +2,7 @@ 
 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
-;;; Copyright © 2017, 2019, 2020 Brendan Tildesley <mail@brendan.scot>
+;;; Copyright © 2017, 2019, 2020, 2021 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
@@ -58,10 +58,14 @@ 
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
+  #:use-module (gnu packages python-compression)
+  #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages serialization)
+  #:use-module (gnu packages speech)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
@@ -111,7 +115,7 @@ 
 (define-public calibre
   (package
     (name "calibre")
-    (version "4.18.0")
+    (version "5.13.0")
     (source
       (origin
         (method url-fetch)
@@ -120,7 +124,7 @@ 
                             version ".tar.xz"))
         (sha256
          (base32
-          "0w9pcfvskjh4v00vjw3i6hzrafy863pgsmmqdx4lffip3p856brw"))
+          "08sljr5rg5f5i1s92g2li5f63mw458b8w5drgcxjm4k62rkl0c8q"))
         (modules '((guix build utils)))
         (snippet
           '(begin
@@ -145,17 +149,16 @@ 
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("qtbase" ,qtbase) ; for qmake
-       ("python2-flake8" ,python2-flake8)
+       ("python-flake8" ,python-flake8)
+       ("python-pyqt-builder" ,python-pyqt-builder)
        ("xdg-utils" ,xdg-utils)))
     (inputs
-     `(("chmlib" ,chmlib)
-       ("fontconfig" ,fontconfig)
+     `(("fontconfig" ,fontconfig)
        ("font-liberation" ,font-liberation)
        ("glib" ,glib)
        ("hunspell" ,hunspell)
        ("hyphen" ,hyphen)
        ("icu4c" ,icu4c)
-       ("js-mathjax" ,js-mathjax)
        ("libmtp" ,libmtp)
        ("libpng" ,libpng)
        ("libusb" ,libusb)
@@ -163,39 +166,41 @@ 
        ("optipng" ,optipng)
        ("podofo" ,podofo)
        ("poppler" ,poppler)
-       ("python" ,python-2)
-       ("python2-apsw" ,python2-apsw)
-       ("python2-beautifulsoup4" ,python2-beautifulsoup4)
-       ("python2-chardet" ,python2-chardet)
-       ("python2-cssselect" ,python2-cssselect)
-       ("python2-css-parser" ,python2-css-parser)
-       ("python2-dateutil" ,python2-dateutil)
-       ("python2-dbus" ,python2-dbus)
-       ("python2-dnspython" ,python2-dnspython-1.16)
-       ("python2-dukpy" ,python2-dukpy)
-       ("python2-feedparser" ,python2-feedparser)
-       ("python2-html2text" ,python2-html2text)
-       ("python2-html5-parser" ,python2-html5-parser)
-       ("python2-html5lib" ,python2-html5lib)
-       ("python2-lxml" ,python2-lxml)
-       ("python2-markdown" ,python2-markdown)
-       ("python2-mechanize" ,python2-mechanize)
-       ;; python2-msgpack is needed for the network content server to work.
-       ("python2-msgpack" ,python2-msgpack)
-       ("python2-netifaces" ,python2-netifaces)
-       ("python2-odfpy" ,python2-odfpy)
-       ("python2-pillow" ,python2-pillow)
-       ("python2-psutil" ,python2-psutil)
-       ("python2-pygments" ,python2-pygments)
-       ("python2-pyqtwebengine" ,python2-pyqtwebengine)
-       ("python2-pyqt" ,python2-pyqt)
-       ("python2-sip" ,python2-sip)
-       ("python2-regex" ,python2-regex)
+       ("python-apsw" ,python-apsw)
+       ("python-beautifulsoup4" ,python-beautifulsoup4)
+       ("python-cchardet" ,python-cchardet)
+       ("python-css-parser" ,python-css-parser)
+       ("python-cssselect" ,python-cssselect)
+       ("python-dateutil" ,python-dateutil)
+       ("python-dbus" ,python-dbus)
+       ("python-dnspython" ,python-dnspython-1.16)
+       ("python-dukpy" ,python-dukpy)
+       ("python-feedparser" ,python-feedparser)
+       ("python-html2text" ,python-html2text)
+       ("python-html5-parser" ,python-html5-parser)
+       ("python-html5lib" ,python-html5lib)
+       ("python-lxml" ,python-lxml)
+       ("python-markdown" ,python-markdown)
+       ("python-mechanize" ,python-mechanize)
+       ;; python-msgpack is needed for the network content server to work.
+       ("python-msgpack" ,python-msgpack)
+       ("python-netifaces" ,python-netifaces)
+       ("python-odfpy" ,python-odfpy)
+       ("python-pillow" ,python-pillow)
+       ("python-psutil" ,python-psutil)
+       ("python-py7zr" ,python-py7zr)
+       ("python-pychm" ,python-pychm)
+       ("python-pycryptodome" ,python-pycryptodome)
+       ("python-pygments" ,python-pygments)
+       ("python-pyqt" ,python-pyqt)
+       ("python-pyqtwebengine" ,python-pyqtwebengine)
+       ("python-regex" ,python-regex)
+       ("python-speechd" ,speech-dispatcher)
+       ("python-zeroconf" ,python-zeroconf)
        ("qtwebengine" ,qtwebengine)
        ("sqlite" ,sqlite)))
     (arguments
-     `(#:python ,python-2
-       ;; Calibre is using setuptools by itself, but the setup.py is not
+     `(;; Calibre is using setuptools by itself, but the setup.py is not
        ;; compatible with the shim wrapper (taken from pip) we are using.
        #:use-setuptools? #f
        #:phases
@@ -227,13 +232,16 @@ 
          (add-before 'build 'configure
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((podofo (assoc-ref inputs "podofo"))
-                  (pyqt (assoc-ref inputs "python2-pyqt"))
-                  (python-sip (assoc-ref inputs "python2-sip"))
+                  (pyqt (assoc-ref inputs "python-pyqt"))
+                  (python-sip (assoc-ref inputs "python-sip"))
                   (out (assoc-ref outputs "out")))
-              (substitute* "setup/build_environment.py"
-                (("= get_sip_dir\\(\\)")
-                 (string-append "= '" pyqt "/share/sip'")))
-
+              (substitute* "setup/build.py"
+                (("\\[tool.sip.bindings.pictureflow\\]")
+                 "[tool.sip.bindings.pictureflow]
+tags = [\"WS_X11\"]")
+                (("\\[tool.sip.project\\]")
+                 (string-append "[tool.sip.project]
+sip-include-dirs = [\"" pyqt "/share/sip" "\"]")))
               (substitute* "src/calibre/ebooks/pdf/pdftohtml.py"
                 (("PDFTOHTML = 'pdftohtml'")
                  (string-append "PDFTOHTML = \"" (assoc-ref inputs "poppler")
@@ -257,7 +265,6 @@ 
                                       "/share/fonts")
                        "/tmp/.fonts")
 
-              (setenv "SIP_BIN" (string-append python-sip "/bin/sip"))
               (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo"))
               (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib"))
               ;; This informs the tests we are a continuous integration
@@ -270,11 +277,7 @@ 
               #t)))
          (add-after 'build 'build-extra
            (lambda* (#:key inputs #:allow-other-keys)
-             (invoke "python2" "setup.py" "mathjax""--system-mathjax"
-                     "--path-to-mathjax" (string-append
-                                          (assoc-ref inputs "js-mathjax")
-                                          "/share/javascript/mathjax"))
-             (invoke "python2" "setup.py" "rapydscript")
+             (invoke "python" "setup.py" "rapydscript")
              #t))
          (add-after 'install 'install-man-pages
            (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/patches/calibre-no-updates-dialog.patch b/gnu/packages/patches/calibre-no-updates-dialog.patch
index 1d8d79660e..66ac913cb5 100644
--- a/gnu/packages/patches/calibre-no-updates-dialog.patch
+++ b/gnu/packages/patches/calibre-no-updates-dialog.patch
@@ -1,11 +1,17 @@ 
-Taken from debian.
+From 19e8d7701c302b0eca4c638705a6db625352caa3 Mon Sep 17 00:00:00 2001
+From: Brendan Tildesley <mail@brendan.scot>
+Date: Thu, 25 Feb 2021 12:17:30 +1100
+Subject: [PATCH] Don't check for updates.
 
-# Description: Disable update check by default.
-Index: calibre/src/calibre/gui2/main.py
-===================================================================
---- calibre.orig/src/calibre/gui2/main.py	2014-02-02 10:41:28.470954623 +0100
-+++ calibre/src/calibre/gui2/main.py	2014-02-02 10:41:56.546954247 +0100
-@@ -37,8 +37,8 @@
+---
+ src/calibre/gui2/main.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py
+index 776f8bebfb..4302716d7e 100644
+--- a/src/calibre/gui2/main.py
++++ b/src/calibre/gui2/main.py
+@@ -59,8 +59,8 @@ def option_parser():
                        help=_('Start minimized to system tray.'))
      parser.add_option('-v', '--verbose', default=0, action='count',
                        help=_('Ignored, do not use. Present only for legacy reasons'))
@@ -16,3 +22,5 @@  Index: calibre/src/calibre/gui2/main.py
      parser.add_option('--ignore-plugins', default=False, action='store_true',
              help=_('Ignore custom plugins, useful if you installed a plugin'
                  ' that is preventing calibre from starting'))
+--
+2.30.1
diff --git a/gnu/packages/patches/calibre-remove-test-sqlite.patch b/gnu/packages/patches/calibre-remove-test-sqlite.patch
index 7bdd90874d..fc2b237ef2 100644
--- a/gnu/packages/patches/calibre-remove-test-sqlite.patch
+++ b/gnu/packages/patches/calibre-remove-test-sqlite.patch
@@ -1,20 +1,20 @@ 
-From a92e26359bd07743ab105819ed0b619e27e14017 Mon Sep 17 00:00:00 2001
+From d8225e83c3b73f0e0da73874910f50ca652f48cf Mon Sep 17 00:00:00 2001
 From: Brendan Tildesley <mail@brendan.scot>
-Date: Sat, 27 Apr 2019 03:30:53 +1000
-Subject: [PATCH] Disable test_sqlite.
+Date: Thu, 25 Feb 2021 00:48:00 +1100
+Subject: [PATCH] Remove test_sqlite
 
 ---
  src/calibre/test_build.py | 6 ------
  1 file changed, 6 deletions(-)
 
 diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py
-index 07bdffd3e5..740588c95b 100644
+index 0ab7aa0646..87fdfabd9a 100644
 --- a/src/calibre/test_build.py
 +++ b/src/calibre/test_build.py
-@@ -162,12 +162,6 @@ class BuildTest(unittest.TestCase):
-             au(x, 'strftime')
-             self.assertEqual(unicode_type(time.strftime(fmt.replace('%e', '%#d'), t)), x)
- 
+@@ -273,12 +273,6 @@ def read_changes():
+         m.close()
+         self.assertEqual(winutil.parse_cmdline('"c:\\test exe.exe" "some arg" 2'), ('c:\\test exe.exe', 'some arg', '2'))
+
 -    def test_sqlite(self):
 -        import sqlite3
 -        conn = sqlite3.connect(':memory:')
@@ -24,6 +24,5 @@  index 07bdffd3e5..740588c95b 100644
      def test_apsw(self):
          import apsw
          conn = apsw.Connection(':memory:')
--- 
-2.21.0
-
+--
+2.30.1
diff --git a/gnu/packages/patches/calibre-remove-test-unrar.patch b/gnu/packages/patches/calibre-remove-test-unrar.patch
index 4e5572d1a6..961cc3eba7 100644
--- a/gnu/packages/patches/calibre-remove-test-unrar.patch
+++ b/gnu/packages/patches/calibre-remove-test-unrar.patch
@@ -1,28 +1,26 @@ 
-Unrar contains security vulnerabilities and has thus been removed from Guix.
-From a16f97b02bd8afd0ec05c471e156f631f2cc6eec Mon Sep 17 00:00:00 2001
+From 9edf67191cc3655480b6fd418247709ade930b1a Mon Sep 17 00:00:00 2001
 From: Brendan Tildesley <mail@brendan.scot>
-Date: Tue, 26 Mar 2019 22:17:03 +1100
-Subject: [PATCH] Remove test_unrar.
+Date: Thu, 25 Feb 2021 00:33:10 +1100
+Subject: [PATCH] Remove test_unrar
 
 ---
  src/calibre/test_build.py | 4 ----
  1 file changed, 4 deletions(-)
 
 diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py
-index d67afd20a6..709132ef17 100644
+index b37fb1bcfb..0ab7aa0646 100644
 --- a/src/calibre/test_build.py
 +++ b/src/calibre/test_build.py
-@@ -220,10 +220,6 @@ class BuildTest(unittest.TestCase):
+@@ -369,10 +369,6 @@ def test_file_dialog_helper(self):
          from calibre.gui2.win_file_dialogs import test
          test()
- 
+
 -    def test_unrar(self):
 -        from calibre.utils.unrar import test_basic
 -        test_basic()
 -
-     @unittest.skipUnless(iswindows, 'WPD is windows only')
-     def test_wpd(self):
-         wpd = plugins['wpd'][0]
--- 
-2.21.0
-
+     def test_7z(self):
+         from calibre.utils.seven_zip import test_basic
+         test_basic()
+--
+2.30.1