Subject: [bug#49543] [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt

From: Ludovic Courtès <[email-masked]>
Date: Wed, 11 Aug 2021 16:35:12 +0200

Hi Maxime,

Maxime Devos <[email-masked]> skribis:

> These two patches fix <https://issues.guix.gnu.org/49530>.
> The dependencies of python-pycryptodome (found with "guix refresh -l")
> still build succesfully.

Neat.

> I performed the unbundling in build phases as I'm not sure
> what is the proper way to use 'tar' from a snippet, and whether
> the unbundling is done in a build phase or an 'origin' snippet
> doesn't seem to matter much, as the bundled code is free software.

Usually, bundled software is removed from a snippet.

Also, when unbundling, it’s better if we can actually reuse the package
in question (libtomcrypt here) as opposed to reusing its source, as you
did here.

Unfortunately, ‘python-pycryptodomex’ fails to build after this change:

--8<---------------cut here---------------start------------->8---
starting phase `build-documentation'
make: Entering directory '/tmp/guix-build-python-pycryptodomex-3.9.9.drv-0/pycryptodomex-3.9.9/Doc'
python -m sphinx -b html -d _build/doctrees   . _build/html
Running Sphinx v3.3.1
WARNING: Support for evaluating Python 2 syntax is deprecated and will be removed in Sphinx 4.0. Convert /tmp/guix-build-python-pycryptodomex-3.9.9.drv-0/pycryptodomex-3.9.9/Doc/conf.py to Python 3 syntax.

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/gnu/store/0ls72lxsfndc8cvlyhymdb8fjdgri2qx-python-sphinx-3.3.1/lib/python3.8/site-packages/sphinx/config.py", line 319, in eval_config_file
    execfile_(filename, namespace)
  File "/gnu/store/0ls72lxsfndc8cvlyhymdb8fjdgri2qx-python-sphinx-3.3.1/lib/python3.8/site-packages/sphinx/util/pycompat.py", line 89, in execfile_
    exec(code, _globals)
  File "/tmp/guix-build-python-pycryptodomex-3.9.9.drv-0/pycryptodomex-3.9.9/Doc/conf.py", line 21, in <module>
    from Crypto.Util import _raw_api
ModuleNotFoundError: No module named 'Crypto'

make: *** [Makefile:45: html] Error 2
make: Leaving directory '/tmp/guix-build-python-pycryptodomex-3.9.9.drv-0/pycryptodomex-3.9.9/Doc'
command "make" "-C" "Doc" "html" "info" failed with status 2
--8<---------------cut here---------------end--------------->8---

I suppose ‘python2-pycryptodome’ fails similarly, though we could start
by removing it.

Could you take a look?

Thanks,
Ludo’.