unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49543] [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt
@ 2021-07-13 12:31 Maxime Devos
  2021-08-11 14:35 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Devos @ 2021-07-13 12:31 UTC (permalink / raw)
  To: 49543; +Cc: slg


[-- Attachment #1.1: Type: text/plain, Size: 492 bytes --]

X-Debbugs-CC: slg <0x2d@disroot.org>

Hi guix,

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

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.

Greetings,
Maxime.

[-- Attachment #1.2: 0001-gnu-python-pycryptodome-Unbundle-libtomcrypt.patch --]
[-- Type: text/x-patch, Size: 3254 bytes --]

From e9b497cbb8f04490b6c835c8b5ed9b92d2765781 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 12 Jul 2021 17:52:39 +0200
Subject: [PATCH 1/2] gnu: python-pycryptodome: Unbundle libtomcrypt.

* gnu/packages/python-crypto.scm
  (pycryptodome)[arguments]<#:phases>{replace-libtomcrypt}:
  New phase.
  (pycryptodome)[native-inputs]{tomcrypt-source}: Add source
  code of 'libtomcrypt'.
---
 gnu/packages/python-crypto.scm | 35 ++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 733a87cd2f..5eb990b5ba 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -24,6 +24,7 @@
 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
 ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +44,7 @@
 (define-module (gnu packages python-crypto)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
@@ -1001,6 +1003,39 @@ protocol (Javascript Object Signing and Encryption).")
         (base32
          "1i4m74f88qj9ci8rpyzrbk2slmsdj5ipmwdkq6qk24byalm203li"))))
     (build-system python-build-system)
+    (arguments
+     `(#:modules ((srfi srfi-26)
+                  (guix build python-build-system)
+                  (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'replace-libtomcrypt
+           (lambda* (#:key native-inputs inputs #:allow-other-keys)
+             (with-directory-excursion "src/libtom"
+               ;; Delete bundled code.
+               (for-each delete-file (find-files "."))
+               ;; Extract tomcrypt source code into "untarred".
+               (mkdir "untarred")
+               (invoke "tar" "xf"
+                       (assoc-ref (or native-inputs inputs) "tomcrypt-source")
+                       "--strip-components=1"
+                       "-Cuntarred")
+               ;; Use source code from "untarred".
+               (rename-file "untarred/src/ciphers/des.c" "tomcrypt_des.c")
+               (for-each (cut install-file <> ".")
+                         (find-files "untarred/src/headers"))
+               (delete-file-recursively "untarred"))))
+         ;; The code bundled in pycryptdome has been modified
+         ;; to make some variables and functions 'static'.
+         (add-after 'replace-libtomcrypt 'make-des-static
+           (lambda _
+             (substitute* (find-files "src/libtom")
+               (("^extern const struct") "static const struct")
+               (("^const struct") "static const struct")
+               (("^int des") "static int des")
+               (("^void des") "static void des")))))))
+    (native-inputs
+     `(("tomcrypt-source" ,(package-source libtomcrypt))))
     (home-page "https://www.pycryptodome.org")
     (synopsis "Low-level cryptographic Python library")
     (description
-- 
2.32.0


[-- Attachment #1.3: 0002-gnu-python-pycryptodome-Build-documentation.patch --]
[-- Type: text/x-patch, Size: 3932 bytes --]

From 5e11b738571167dbb5ba59d9cfb3204dd81ca855 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 12 Jul 2021 20:30:06 +0200
Subject: [PATCH 2/2] gnu: python-pycryptodome: Build documentation.

* gnu/packages/python-crypto.scm
  (python-pycryptodome)[outputs]: Add "doc" output.
  (python-pycryptodome)[arguments]<#:phases>{build-documentation}:
  New phase, removing images loaded from the Internet, unbundling
  sphinx-rtd-theme and building HTML and Info documentation.
  (python-pycryptodome)[arguments]<#:phases>{build-documentation}:
  New phase.
---
 gnu/packages/python-crypto.scm | 35 ++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 5eb990b5ba..cb3d0f9609 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -52,6 +52,7 @@
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages kerberos)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages password-utils)
   #:use-module (gnu packages protobuf)
@@ -62,6 +63,7 @@
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages swig)
+  #:use-module (gnu packages texinfo)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml)
@@ -1003,6 +1005,8 @@ protocol (Javascript Object Signing and Encryption).")
         (base32
          "1i4m74f88qj9ci8rpyzrbk2slmsdj5ipmwdkq6qk24byalm203li"))))
     (build-system python-build-system)
+    ;; "doc" has HTML documentation weighing 4.9 MB
+    (outputs '("out" "doc"))
     (arguments
      `(#:modules ((srfi srfi-26)
                   (guix build python-build-system)
@@ -1033,9 +1037,36 @@ protocol (Javascript Object Signing and Encryption).")
                (("^extern const struct") "static const struct")
                (("^const struct") "static const struct")
                (("^int des") "static int des")
-               (("^void des") "static void des")))))))
+               (("^void des") "static void des"))))
+         (add-after 'build 'build-documentation
+           (lambda _
+             ;; Prevent offline documentation from loading
+             ;; images from the Internet.
+             (substitute* "README.rst"
+               (("^(.*)travis-ci.org(.*)\n") "")
+               (("^(.*)ci.appveyor.com(.*)\n") ""))
+             ;; Unbundle sphinx-rtd-theme.
+             (delete-file-recursively "Doc/sphinx_rtd_theme")
+             (invoke "make" "-C" "Doc" "html" "info")))
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((doc (string-append (assoc-ref outputs "doc")
+                                        "/share/doc/" ,name "-" ,version))
+                    (html (string-append doc "/html"))
+                    ;; The 'info' manual only weighs 72 KB
+                    (info (string-append (assoc-ref outputs "out")
+                                         "/share/info")))
+               (mkdir-p info)
+               (mkdir-p html)
+               (copy-recursively "Doc/_build/html" html)
+               (copy-recursively "Doc/_build/texinfo" info)
+               (delete-file (string-append info "/Makefile"))
+               (delete-file (string-append info "/PyCryptodome.texi"))))))))
     (native-inputs
-     `(("tomcrypt-source" ,(package-source libtomcrypt))))
+     `(("python-sphinx" ,python-sphinx)
+       ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
+       ("texinfo" ,texinfo)
+       ("tomcrypt-source" ,(package-source libtomcrypt))))
     (home-page "https://www.pycryptodome.org")
     (synopsis "Low-level cryptographic Python library")
     (description
-- 
2.32.0


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#49543] [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt
  2021-07-13 12:31 [bug#49543] [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt Maxime Devos
@ 2021-08-11 14:35 ` Ludovic Courtès
  2021-08-18 11:01   ` Maxime Devos
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2021-08-11 14:35 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 49543, slg

Hi Maxime,

Maxime Devos <maximedevos@telenet.be> 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'

['/tmp/guix-build-python-pycryptodomex-3.9.9.drv-0/pycryptodomex-3.9.9/lib', '/tmp/guix-build-python-pycryptodomex-3.9.9.drv-0/pycryptodomex-3.9.9/Doc', '/gnu/store/0ls72lxsfndc8cvlyhymdb8fjdgri2qx-python-sphinx-3.3.1/lib/python3.8/site-packages', '/gnu/store/2zakswhc9g439yc8wic8q0hs3igi9g5b-python-sphinx-rtd-theme-0.2.4/lib/python3.8/site-packages', '/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages', '/gnu/store/6lm3n9nlvycbr6cw2lw3m7r8afd6qprq-python-sphinxcontrib-serializinghtml-1.1.4/lib/python3.8/site-packages', '/gnu/store/0q8410qkshkppigcw52jf8h31yzmvvf2-python-sphinxcontrib-qthelp-1.0.3/lib/python3.8/site-packages', '/gnu/store/wb47l1a7w2h1dpd6bfalcq17qzfclcf7-python-sphinxcontrib-jsmath-1.0.1/lib/python3.8/site-packages', '/gnu/store/n5zs7y1sj957fnf8pknvwlyj7i703pcf-python-sphinxcontrib-htmlhelp-1.0.3/lib/python3.8/site-packages', '/gnu/store/5h811myaa1xwx7ccxsbddi3frw58ybmw-python-sphinxcontrib-devhelp-1.0.2/lib/python3.8/site-packages', '/gnu/store/08i1lwmkzrp21sk2gllbndbkssjglpih-python-sphinxcontrib-applehelp-1.0.2/lib/python3.8/site-packages', '/gnu/store/4zs7yw2yl5km552xny1dg2ai1nn137wh-python-sphinx-alabaster-theme-0.7.12/lib/python3.8/site-packages', '/gnu/store/i6wkshxcswdvfq9nyp6gldjcasnz3snr-python-snowballstemmer-2.0.0/lib/python3.8/site-packages', '/gnu/store/w0fzqiyvfz68bpr552h8qcbw8dbdyh5x-python-requests-2.25.0/lib/python3.8/site-packages', '/gnu/store/rvgdr6p6aa0kiiinxzxp4w15s05rbb4f-python-pygments-2.7.3/lib/python3.8/site-packages', '/gnu/store/5zfrihl2sg0svssmac0l06hyq6zjik8b-python-packaging-20.0/lib/python3.8/site-packages', '/gnu/store/ibvr3izfm99bmxg6cbb2qyhrb23ablla-python-imagesize-1.2.0/lib/python3.8/site-packages', '/gnu/store/6z2ri6yzpagh5pc32m8gn95lzarxkims-python-jinja2-2.11.2/lib/python3.8/site-packages', '/gnu/store/0dz7b0qxbj6m4ld53l8lnvv2yzdrbx8y-python-docutils-0.16/lib/python3.8/site-packages', '/gnu/store/rlp7fnxmn2qlmzjs52n7xycnvh3zjxwc-python-babel-2.9.0/lib/python3.8/site-packages', '/gnu/store/vy8f9ksgng46c4nkdl3hg08ngypzrx7a-python-urllib3-1.26.2/lib/python3.8/site-packages', '/gnu/store/ihl3h0s000vlkvadxvv21cbn4fqzvmav-python-idna-2.10/lib/python3.8/site-packages', '/gnu/store/ih20zyn3r0c6ymv7h3faqx0sbdakmw7w-python-chardet-3.0.4/lib/python3.8/site-packages', '/gnu/store/2j54g0s8db1b10ggs4rirfb5vv8abm2y-python-certifi-2020.12.5/lib/python3.8/site-packages', '/gnu/store/hjmz8ymac939ribn7g3jkgms4dk2az3a-python-six-1.14.0/lib/python3.8/site-packages', '/gnu/store/69lzz2dp87f896843jj05mw5z4hd9my2-python-pyparsing-2.4.6/lib/python3.8/site-packages', '/gnu/store/r6jy13vsfb1fjlrhr43xdnz56d614aw6-python-markupsafe-1.1.1/lib/python3.8/site-packages', '/gnu/store/3f1fglk0f6jym9r0zfaf7vqjn6gx6js5-python-pytz-2021.1/lib/python3.8/site-packages', '/gnu/store/dqm6p7w3l7whd0zzm3szr963mvpsfglh-python-pysocks-1.7.1/lib/python3.8/site-packages', '/gnu/store/wand0zrwwnds6x636746116cfh3sy50k-python-pyopenssl-20.0.0/lib/python3.8/site-packages', '/gnu/store/y793c1d3nmpgq1dacfccir6bkrj3ygf7-python-cryptography-3.3.1/lib/python3.8/site-packages', '/gnu/store/q01v2xjfcl7d020y3yh865695gm8i3gx-python-iso8601-0.1.13/lib/python3.8/site-packages', '/gnu/store/j3k8ah697pg289zg7j9ix4a53i94liw4-python-cffi-1.14.4/lib/python3.8/site-packages', '/gnu/store/xkcc4372psi79xiidw4k33nmyf6mk36h-python-asn1crypto-1.4.0/lib/python3.8/site-packages', '/gnu/store/k08j1silv8zxfglz3mb5q7ngmya9cv39-python-pycparser-2.20/lib/python3.8/site-packages', '/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python38.zip', '/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8', '/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/lib-dynload']
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’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#49543] [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt
  2021-08-11 14:35 ` Ludovic Courtès
@ 2021-08-18 11:01   ` Maxime Devos
  2021-09-01 21:28     ` bug#49543: " Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Devos @ 2021-08-18 11:01 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 49543, slg


[-- Attachment #1.1: Type: text/plain, Size: 1447 bytes --]

Ludovic Courtès schreef op wo 11-08-2021 om 16:35 [+0200]:
> Hi Maxime,
> 
> Maxime Devos <maximedevos@telenet.be> 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.

I have attached two new patches for unbundling libtomcrypt this way.
I left the documentation out for now, as I would prefer some kind of
generic solution that could be used by other packages using Sphinx
as well.

I had some trouble telling python to link to libtomcrypt.
I tried adding "tomcrypt" to "libraries" in ‘Extension’ forms in setup.py
but that doesn't seem to do anything, so I added
extra_link_args=['-ltomcrypt', '-ltommath'].  Do you know what's up with that?

The dependencies of python-pycryptodome, python2-pycryptodome and
python-pycryptodomex build successfully.

Greetings,
Maxime.

[-- Attachment #1.2: 0001-gnu-python-pycryptodome-Unbundle-libtomcrypt.patch --]
[-- Type: text/x-patch, Size: 2918 bytes --]

From a41b086246a5b59aab2d16eaeb91e0caafa706cc Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Wed, 18 Aug 2021 00:43:16 +0200
Subject: [PATCH 1/2] gnu: python-pycryptodome: Unbundle libtomcrypt.

* gnu/packages/python-crypto.scm
  (pycryptodome-unbundle-tomcrypt-snippet): New variable.
  (python-pycryptodome)[source]{snippet}: Unbundle libtomcrypt.
  (python-pycryptodome)[source]{modules}: Add (guix build utils).
---
 gnu/packages/python-crypto.scm | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index d9102adcc9..265ab6d228 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
 (define-module (gnu packages python-crypto)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
@@ -947,6 +949,22 @@ protocol (Javascript Object Signing and Encryption).")
 (define-public python2-josepy
   (package-with-python2 python-josepy))
 
+(define pycryptodome-unbundle-tomcrypt-snippet
+  #~(begin
+      ;; Unbundle libtomcrypt.
+      (delete-file-recursively "src/libtom")
+      (substitute* "src/DES.c"
+        (("#include \"libtom/tomcrypt_des.c\"")
+         "#include <tomcrypt.h>"))
+      (substitute* "setup.py"
+        (("include_dirs=\\['src/', 'src/libtom/'\\]")
+         ;; FIXME: why does '-ltomcrypt' need to be added
+         ;; manually, even when 'tomcrypt' is added to 'libraries'?
+         ;; This behaviour is not documented at
+         ;; <https://docs.python.org/3/extending/building.html>.
+         "include_dirs=['src/'], libraries=['tomcrypt', 'tommath'],
+ extra_link_args=['-ltomcrypt', '-ltommath']"))))
+
 (define-public python-pycryptodome
   (package
     (name "python-pycryptodome")
@@ -957,8 +975,13 @@ protocol (Javascript Object Signing and Encryption).")
        (uri (pypi-uri "pycryptodome" version))
        (sha256
         (base32
-         "1i4m74f88qj9ci8rpyzrbk2slmsdj5ipmwdkq6qk24byalm203li"))))
+         "1i4m74f88qj9ci8rpyzrbk2slmsdj5ipmwdkq6qk24byalm203li"))
+       (modules '((guix build utils)))
+       (snippet pycryptodome-unbundle-tomcrypt-snippet)))
     (build-system python-build-system)
+    (inputs
+     `(("libtomcrypt" ,libtomcrypt)
+       ("libtommath" ,libtommath)))
     (home-page "https://www.pycryptodome.org")
     (synopsis "Low-level cryptographic Python library")
     (description
-- 
2.32.0


[-- Attachment #1.3: 0002-gnu-python-pycryptodomex-Unbundle-libtomcrypt.patch --]
[-- Type: text/x-patch, Size: 1270 bytes --]

From 5b3366c9ebead99f0c22d612552063189bd0551c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Wed, 18 Aug 2021 12:46:51 +0200
Subject: [PATCH 2/2] gnu: python-pycryptodomex: Unbundle libtomcrypt.

* gnu/packages/python-crypto.scm
  (python-pycryptodomex)[source]{snippet}: Unbundle libtomcrypt.
  (python-pycryptodomex)[source]{modules}: Add (guix build utils).
---
 gnu/packages/python-crypto.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 265ab6d228..0fd3c829e3 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -1034,7 +1034,9 @@ PyCryptodome variants, the other being python-pycryptodomex.")
        (method url-fetch)
        (uri (pypi-uri "pycryptodomex" version))
        (sha256
-        (base32 "0lbx4qk3xmwqiidhmkj8qa7bh2lf8bwzg0xjpsh2w5zqjrc7qnvv"))))
+        (base32 "0lbx4qk3xmwqiidhmkj8qa7bh2lf8bwzg0xjpsh2w5zqjrc7qnvv"))
+       (modules '((guix build utils)))
+       (snippet pycryptodome-unbundle-tomcrypt-snippet)))
     (description
      "PyCryptodome is a self-contained Python package of low-level
 cryptographic primitives.  It's not a wrapper to a separate C library like
-- 
2.32.0


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#49543: [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt
  2021-08-18 11:01   ` Maxime Devos
@ 2021-09-01 21:28     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2021-09-01 21:28 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 49543-done, slg

Hi!

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op wo 11-08-2021 om 16:35 [+0200]:

[...]

>> 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.
>
> I have attached two new patches for unbundling libtomcrypt this way.
> I left the documentation out for now, as I would prefer some kind of
> generic solution that could be used by other packages using Sphinx
> as well.

Makes sense to me.

> I had some trouble telling python to link to libtomcrypt.
> I tried adding "tomcrypt" to "libraries" in ‘Extension’ forms in setup.py
> but that doesn't seem to do anything, so I added
> extra_link_args=['-ltomcrypt', '-ltommath'].  Do you know what's up with that?

No idea!

> From a41b086246a5b59aab2d16eaeb91e0caafa706cc Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Wed, 18 Aug 2021 00:43:16 +0200
> Subject: [PATCH 1/2] gnu: python-pycryptodome: Unbundle libtomcrypt.
>
> * gnu/packages/python-crypto.scm
>   (pycryptodome-unbundle-tomcrypt-snippet): New variable.
>   (python-pycryptodome)[source]{snippet}: Unbundle libtomcrypt.
>   (python-pycryptodome)[source]{modules}: Add (guix build utils).

[...]

> From 5b3366c9ebead99f0c22d612552063189bd0551c Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Wed, 18 Aug 2021 12:46:51 +0200
> Subject: [PATCH 2/2] gnu: python-pycryptodomex: Unbundle libtomcrypt.
>
> * gnu/packages/python-crypto.scm
>   (python-pycryptodomex)[source]{snippet}: Unbundle libtomcrypt.
>   (python-pycryptodomex)[source]{modules}: Add (guix build utils).

Finally applied, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-01 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 12:31 [bug#49543] [PATCH] python-pycryptodome: Build HTML and info documentation and unbundle sphinx-rtd-theme and libtomcrypt Maxime Devos
2021-08-11 14:35 ` Ludovic Courtès
2021-08-18 11:01   ` Maxime Devos
2021-09-01 21:28     ` bug#49543: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).