From 5e89d39601ab9c9370be68fc260659a82a62c4b0 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov Date: Wed, 24 Sep 2025 18:53:39 +0100 Subject: [PATCH] gnu: libsecp256k1: Fix cross-compiling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- gnu/packages/crypto.scm | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm index 4155fb901ae..a6114427c80 100644 --- a/gnu/packages/crypto.scm +++ b/gnu/packages/crypto.scm @@ -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")