@@ -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