From fedb9571eb423bff0f806ae3fcb106e16e1e56e9 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 20 Jun 2019 18:36:13 +0200 Subject: gnu: Add lcalc. * gnu/packages/sagemath.scm (lcalc): New variable. * gnu/packages/patches/lcalc-default-parameters-1.patch, gnu/packages/patches/lcalc-default-parameters-2.patch, gnu/packages/patches/lcalc-lcommon-h.patch, gnu/packages/patches/lcalc-using-namespace-std.patch: New files. * gnu/local.mk (dist_patch_DATA): Register patches. --- gnu/packages/sagemath.scm | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'gnu/packages/sagemath.scm') diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm index 63d1281668..7517b55175 100644 --- a/gnu/packages/sagemath.scm +++ b/gnu/packages/sagemath.scm @@ -24,6 +24,7 @@ (define-module (gnu packages sagemath) #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages bdw-gc) @@ -353,3 +354,67 @@ (define-public brial used as internal storage type for polynomial structures.") (license license:gpl2+) (home-page "https://gitlab.com/sagemath/zn_poly"))) + +(define-public lcalc + (package + (name "lcalc") + (version "1.23") + ;; The original home page of the project has disappeared, as well as + ;; code hosted by the original author on Google Code. The latter has + ;; been copied to gitlab.com/sagemath and purportedly contains patches + ;; for a never released version 1.3, that supposedly follows 1.23. + ;; We use the tarball as well as the patches hosted inside the sage + ;; package system distributed with the sage tarball. + (source + (origin + (method url-fetch) + (uri (string-append "ftp://ftp.fu-berlin.de/unix/misc/sage/spkg/" + "upstream/lcalc/lcalc-1.23.tar.bz2")) + (sha256 + (base32 + "1c6dsdshgxhqppjxvxhp8yhpxaqvnz3d1mlh26r571gkq8z2bm43")) + (patches (search-patches "lcalc-lcommon-h.patch" + "lcalc-default-parameters-1.patch" + "lcalc-default-parameters-2.patch" + "lcalc-using-namespace-std.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no tests + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'prepare-build + (lambda* (#:key outputs #:allow-other-keys) + (chdir "src") + (let ((out (assoc-ref outputs "out"))) + (substitute* "Makefile" + (("^INSTALL_DIR= /usr/local") + (string-append "INSTALL_DIR=" out)) + ;; Sage renames the include directory, so we do it also. + (("include/Lfunction") + "include/libLfunction") + ;; Add --std=c++11 to be compatible with the "auto" keyword + ;; introduced by lcalc-using-namespace-std.patch. + (("^#EXTRA= -pg") + "EXTRA=--std=c++11"))) + #t)) + (add-before 'install 'make-output-dirs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (include (string-append out "/include"))) + (mkdir-p bin) + (mkdir-p lib) + (mkdir-p include)) + #t))))) + ;; FIXME: + ;; We need to add pari-gp and probably pari related patches from the + ;; sage project, as well as uncomment the line setting PARI_DEFINE in + ;; the Makefile to get the full functionality of this package. + ;; For the time being, we hope that sage can be compiled without. + (synopsis "C++ library for L-functions") + (description "Lcalc computes L-functions, in particular the Riemann +zeta function and its twists by quadratic characters.") + (license license:gpl2+) + (home-page "https://gitlab.com/sagemath/sage"))) -- cgit v1.2.3 From e6049c84dab3031fb64defae2c45a20b512d4644 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Fri, 21 Jun 2019 16:32:58 +0200 Subject: gnu: zn-poly: Install all libraries. * gnu/packages/sagemath.scm (zn-poly): Install the static and the dynamic library with its symlinks, and end a phase with #t. --- gnu/packages/sagemath.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'gnu/packages/sagemath.scm') diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm index 7517b55175..d264eb560f 100644 --- a/gnu/packages/sagemath.scm +++ b/gnu/packages/sagemath.scm @@ -309,8 +309,19 @@ (define-public zn-poly (invoke "make" "libzn_poly.so"))) (add-after 'install 'install-so (lambda* (#:key outputs #:allow-other-keys) - (let ((lib (string-append (assoc-ref outputs "out") "/lib"))) - (install-file "libzn_poly.so" lib))))))) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (soname (string-append "libzn_poly-" ,version ".so")) + (target (string-append lib "/" soname))) + (install-file "libzn_poly.a" lib) + (install-file soname lib) + (symlink target + (string-append lib "/libzn_poly.so")) + (symlink target + (string-append lib "/libzn_poly-" + ,(version-major+minor version) + ".so"))) + #t))))) (synopsis "Arithmetic for polynomials over Z/NZ") (description "zn_poly implements the arithmetic of polynomials the coefficients of which are modular integers.") -- cgit v1.2.3 From a65f1e8eab8417154ac8a2b4371d0eb13b1987b9 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 21 Jun 2019 22:57:19 +0200 Subject: gnu: Move ratpoints into "sagemath.scm" * gnu/packages/algebra.scm (ratpoints): Move package from here... * gnu/packages/sagemath.scm (ratpoints): ... to here. --- gnu/packages/algebra.scm | 42 ------------------------------------------ gnu/packages/sagemath.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 42 deletions(-) (limited to 'gnu/packages/sagemath.scm') diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index edcfad1402..95189401f7 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1333,48 +1333,6 @@ (define-public m4ri (license license:gpl2+) (home-page "https://bitbucket.org/malb/m4ri/"))) -(define-public ratpoints - (package - (name "ratpoints") - (version "2.1.3") - (source (origin - (method url-fetch) - (uri (string-append - "http://www.mathe2.uni-bayreuth.de/stoll/programs/" - "ratpoints-" version ".tar.gz")) - (sha256 - (base32 - "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4")) - (patches - ;; Taken from - ;; - (search-patches "ratpoints-sturm_and_rp_private.patch")))) - (build-system gnu-build-system) - (arguments - `(#:test-target "test" - #:make-flags - (list (string-append "INSTALL_DIR=" (assoc-ref %outputs "out")) - "CCFLAGS=-fPIC") - #:phases - (modify-phases %standard-phases - (delete 'configure) ;no configure script - (add-before 'install 'create-install-directories - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (mkdir-p out) - (with-directory-excursion out - (for-each (lambda (d) (mkdir-p d)) - '("bin" "include" "lib")))) - #t))))) - (inputs - `(("gmp" ,gmp))) - (home-page "http://www.mathe2.uni-bayreuth.de/stoll/programs/") - (synopsis "Find rational points on hyperelliptic curves") - (description "Ratpoints tries to find all rational points within -a given height bound on a hyperelliptic curve in a very efficient way, -by using an optimized quadratic sieve algorithm.") - (license license:gpl2+))) - (define-public symmetrica (package (name "symmetrica") diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm index d264eb560f..43da5c636a 100644 --- a/gnu/packages/sagemath.scm +++ b/gnu/packages/sagemath.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Andreas Enge +;;; Copyright © 2019 Nicolas Goaziou ;;; ;;; This file is part of GNU Guix. ;;; @@ -429,3 +430,45 @@ (define-public lcalc zeta function and its twists by quadratic characters.") (license license:gpl2+) (home-page "https://gitlab.com/sagemath/sage"))) + +(define-public ratpoints + (package + (name "ratpoints") + (version "2.1.3") + (source (origin + (method url-fetch) + (uri (string-append + "http://www.mathe2.uni-bayreuth.de/stoll/programs/" + "ratpoints-" version ".tar.gz")) + (sha256 + (base32 + "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4")) + (patches + ;; Taken from + ;; + (search-patches "ratpoints-sturm_and_rp_private.patch")))) + (build-system gnu-build-system) + (arguments + `(#:test-target "test" + #:make-flags + (list (string-append "INSTALL_DIR=" (assoc-ref %outputs "out")) + "CCFLAGS=-fPIC") + #:phases + (modify-phases %standard-phases + (delete 'configure) ;no configure script + (add-before 'install 'create-install-directories + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p out) + (with-directory-excursion out + (for-each (lambda (d) (mkdir-p d)) + '("bin" "include" "lib")))) + #t))))) + (inputs + `(("gmp" ,gmp))) + (home-page "http://www.mathe2.uni-bayreuth.de/stoll/programs/") + (synopsis "Find rational points on hyperelliptic curves") + (description "Ratpoints tries to find all rational points within +a given height bound on a hyperelliptic curve in a very efficient way, +by using an optimized quadratic sieve algorithm.") + (license license:gpl2+))) -- cgit v1.2.3