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.
This commit is contained in:
Andreas Enge 2019-06-20 18:36:13 +02:00
parent 88f913e8ad
commit fedb9571eb
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3
6 changed files with 209 additions and 0 deletions

View file

@ -24,6 +24,7 @@
#: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 @@ Boolean variables. As a unique approach, binary decision diagrams are
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")))