all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 60849@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#60849] [PATCH core-updates 1/4] gnu: libtommath: Update to 1.2.0-0.03de03d.
Date: Mon, 16 Jan 2023 00:13:36 -0500	[thread overview]
Message-ID: <20230116051339.27113-2-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20230116050942.26300-1-maxim.cournoyer@gmail.com>

This change makes it possible to cross-compile libtommath.

* gnu/packages/multiprecision.scm (libtommath): Update to 1.2.0-0.03de03d.
[outputs]: Delete field.
[source]: Fetch from git.
[build-system]: Switch to cmake-build-system.
[arguments]: Delete prepare-build, remove-static-library, check and
install-static-library phases.  Delete #:test-target and #:make-flags
arguments.  Add #:configure-flags argument.
[native-inputs]: Delete field.
---

 gnu/packages/multiprecision.scm | 73 +++++++++++----------------------
 1 file changed, 25 insertions(+), 48 deletions(-)

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index b96efed843..c8b4639ed7 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -8,7 +8,7 @@
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -39,6 +39,7 @@ (define-module (gnu packages multiprecision)
   #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu))
 
 (define-public gmp
@@ -439,56 +440,32 @@ (define-public libtomcrypt
     (license unlicense)))
 
 (define-public libtommath
-  (package
-    (name "libtommath")
-    (version "1.2.0")
-    (outputs '("out" "static"))
-    (source
-      (origin
-        (method url-fetch)
-        (uri (string-append "https://github.com/libtom/libtommath/releases/"
-                            "download/v" version "/ltm-" version ".tar.xz"))
-        (sha256
-         (base32
-          "1c8q1qy88cjhdjlk3g24mra94h34c1ldvkjz0n2988c0yvn5xixp"))))
-    (build-system gnu-build-system)
-    (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (delete 'configure) ; no configure
-         (add-after 'unpack 'prepare-build
-           (lambda _
-             ;; We want the shared library by default so force it to be the
-             ;; default makefile target.
-             (delete-file "makefile")
-             (symlink "makefile.shared" "makefile")
-             #t))
-         (add-after 'install 'remove-static-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (delete-file (string-append (assoc-ref outputs "out")
-                                         "/lib/libtommath.a"))
-             #t))
-         (replace 'check
-           (lambda* (#:key test-target make-flags #:allow-other-keys)
-             (apply invoke "make" test-target make-flags)
-             (invoke "sh" "test")))
-         (add-after 'install 'install-static-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (invoke "make" "-f" "makefile.unix" "install"
-                     (string-append "PREFIX=" (assoc-ref outputs "static"))
-                     (string-append "CC=" (which "gcc"))))))
-       #:test-target "test"
-       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
-                          "CC=gcc")))
-    (native-inputs
-     (list libtool))
-    (home-page "https://www.libtom.net/LibTomMath/")
-    (synopsis "Portable number theoretic multiple-precision integer library")
-    (description "LibTomMath is a portable number theoretic multiple-precision
+  ;; Use the latest commit, as it contains a new CMake build system capable of
+  ;; cross-compilation.
+  (let ((revision "0")
+        (commit "03de03dee753442d4b23166982514639c4ccbc39"))
+    (package
+      (name "libtommath")
+      (version (git-version "1.2.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/libtom/libtommath")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0maqzpc3f4l9b3bps8dj49b3schj3dfzvf2xcpilg8q3p1sxgrbl"))))
+      (build-system cmake-build-system)
+      (arguments (list #:configure-flags #~(list "-DBUILD_TESTING=ON"
+                                                 "-DBUILD_SHARED_LIBS=ON")))
+      (home-page "https://www.libtom.net/LibTomMath/")
+      (synopsis "Portable number theoretic multiple-precision integer library")
+      (description "LibTomMath is a portable number theoretic multiple-precision
 integer library written entirely in C.  It's designed to provide an API that is
 simple to work with that provides fairly efficient routines that build out of
 the box without configuration.")
-    (license unlicense)))
+      (license unlicense))))
 
 (define-public libtommath-1.1
   (package
-- 
2.38.1





  reply	other threads:[~2023-01-16  6:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16  5:09 [bug#60849] [PATCH core-updates 0/4] Enable cross-Compilation for python-pycryptodome Maxim Cournoyer
2023-01-16  5:13 ` Maxim Cournoyer [this message]
2023-01-16  5:13   ` [bug#60849] [PATCH core-updates 2/4] gnu: libtomcrypt: Update to 1.18.2-0.29986d0 Maxim Cournoyer
2023-01-16  5:13   ` [bug#60849] [PATCH core-updates 3/4] gnu: python-pycryptodome: Fix build and enable cross-compilation Maxim Cournoyer
2023-01-16  5:13   ` [bug#60849] [PATCH core-updates 4/4] gnu: python-coverage: Switch to pyproject-build-system Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230116051339.27113-2-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=60849@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.