diff mbox series

[bug#64288] gnu: python-msgspec: Regenerate autogenerated file.

Message ID 20230625222153.81510-1-monego@posteo.net
State New
Headers show
Series [bug#64288] gnu: python-msgspec: Regenerate autogenerated file. | expand

Commit Message

Vinicius Monego June 25, 2023, 10:21 p.m. UTC
* gnu/packages/serialization.scm (python-msgspec)[source]: Add a snippet to
delete autogenerated "msgspec/atof_consts.h".
[arguments]: Add new phase to regenerate that file.
---
 gnu/packages/serialization.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès July 18, 2023, 11:40 a.m. UTC | #1
Hello,

Vinicius Monego <monego@posteo.net> skribis:

> * gnu/packages/serialization.scm (python-msgspec)[source]: Add a snippet to
> delete autogenerated "msgspec/atof_consts.h".
> [arguments]: Add new phase to regenerate that file.

Good catch, LGTM!

Ludo’.
Vinicius Monego July 29, 2023, 6:43 p.m. UTC | #2
Em ter, 2023-07-18 às 13:40 +0200, Ludovic Courtès escreveu:
> Hello,
> 
> Vinicius Monego <monego@posteo.net> skribis:
> 
> > * gnu/packages/serialization.scm (python-msgspec)[source]: Add a
> > snippet to
> > delete autogenerated "msgspec/atof_consts.h".
> > [arguments]: Add new phase to regenerate that file.
> 
> Good catch, LGTM!
> 
> Ludo’.

Applied, thanks.
diff mbox series

Patch

diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 1f8c128eba..2d763e815e 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -628,6 +628,11 @@  (define-public python-msgspec
                     (url "https://github.com/jcrist/msgspec")
                     (commit version)))
               (file-name (git-file-name name version))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Delete autogenerated file, regenerate in a phase.
+               '(begin
+                  (delete-file "msgspec/atof_consts.h")))
               (sha256
                (base32
                 "09q567klcv7ly60w9lqip2ffyhrij100ky9igh3p3vqwbml33zb3"))))
@@ -645,7 +650,12 @@  (define-public python-msgspec
                        (invoke "versioneer" "install")
                        (substitute* "setup.py"
                          (("version=versioneer.get_version\\(),")
-                          (format #f "version=~s," #$version))))))))
+                          (format #f "version=~s," #$version)))))
+                   (add-after 'versioneer 'atof-consts
+                     (lambda _
+                       (with-directory-excursion "scripts"
+                         ;; Regenerate the autogenerated file.
+                         (invoke "python" "generate_atof_consts.py")))))))
     (native-inputs (list python-attrs
                          python-gcovr
                          python-msgpack