gnu: libsecp256k1: Fix cross-compiling.

* gnu/packages/crypto.scm (libsecp256k1)
[source]: Remove snippet deleting "src/precomputed_ecmult.c" and
"src/precomputed_ecmult_gen.c".
[arguments]: Add conditional phase 'delete-precomputed-files' that
deletes them only when not cross-compiling.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Hennadii Stepanov 2025-09-24 18:53:39 +01:00 committed by Ludovic Courtès
parent 6e12325bf3
commit 5e89d39601
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1136,20 +1136,26 @@ trivial to build for local use. Portability is emphasized over performance.")
(file-name (git-file-name name version))
(sha256
(base32
"1d0cnd2s607j642h64821mpklfvvzy70mkyl2dlsm5s9lgvndn2p"))
(modules '((guix build utils)))
(snippet
;; These files are pre-generated, the build system is able to
;; re-generate those.
#~(for-each delete-file '("src/precomputed_ecmult.c"
"src/precomputed_ecmult_gen.c")))))
"1d0cnd2s607j642h64821mpklfvvzy70mkyl2dlsm5s9lgvndn2p"))))
(build-system gnu-build-system)
(arguments
'(#:configure-flags '("--enable-module-recovery"
"--enable-experimental"
"--enable-shared"
"--disable-static"
"--disable-benchmark")))
(list #:configure-flags
#~(list
"--enable-module-recovery"
"--enable-experimental"
"--enable-shared"
"--disable-static"
"--disable-benchmark")
#:phases
(if (%current-target-system)
#~%standard-phases
#~(modify-phases %standard-phases
;; These files are pre-generated, the build system is able to
;; re-generate those if not cross-compiling,
(add-after 'unpack 'delete-precomputed-files
(lambda _
(for-each delete-file '("src/precomputed_ecmult.c"
"src/precomputed_ecmult_gen.c"))))))))
(native-inputs
(list autoconf automake libtool))
(synopsis "C library for EC operations on curve secp256k1")