Hello, the attached patch adds the computer algebra system for group theory GAP. I am only interested in it as an input to SAGE, but it appears that someone on IRC was also trying to package it yesterday, so it would be nice if you could check whether this package meets your needs.
There is an impressive number of optional GAP packages that are shipped with the tarball; for the time being, I included only some of them in the installation. The documentation poses problems: It is included in the tarball, but I thought it would be in style to recreate it from source. Adding texlive-minimal is not sufficient and creates blank pdf pages (since fonts are missing; I think we need to revisit texlive-minimal and make it a little less minimal). Adding texlive helps, but now it also ends up in the closure, which is excessive! I am wondering whether we could simply drop texlive and delete the bundled pdf documentation; the on-line documentation should then still be available. What do you think? Also, I tried to create a separate doc package, but then installing both gap and gap:doc into a user profile is not enough: Documentation is searched for relatively to the binary, I think. (To check this, I called "?LoadPackage" from inside a gap session, which does not work with a separate doc package.) Personally, I would be happy with having one package only if we delete the pdf documentation: There are then about 35MB of documentation. Something unusual happens for the binary: The user is supposed to call a wrapper script gap.sh, which calls x86_64-unknown-linux-gnu-gcc-default64/gap after setting a few environment variables. We could add a symlink gap -> gap.sh, but this would be out of style for us. It might, however, be needed later on to make SAGE work. I am looking forward to your comments, Andreas
>From 950101a323d58e7435a0f79e156af1c829baff58 Mon Sep 17 00:00:00 2001 From: Andreas Enge <[email protected]> Date: Sun, 17 Apr 2016 13:33:02 +0200 Subject: [PATCH] gnu: Add GAP. * gnu/packages/algebra.scm (gap): New variable. --- gnu/packages/algebra.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 5b00493..39c90cd 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -28,6 +28,7 @@ #:use-module (gnu packages gl) #:use-module (gnu packages graphviz) #:use-module (gnu packages image) + #:use-module (gnu packages m4) #:use-module (gnu packages multiprecision) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) @@ -463,6 +464,85 @@ binary.") (license license:gpl3+) (home-page "http://ecm.gforge.inria.fr/"))) +(define-public gap + (package + (name "gap") + (version "4.8.3") + (source (origin + (method url-fetch) + (uri (string-append "http://www.gap-system.org/pub/gap/" + "gap48/tar.bz2/" + "gap4r8p3_2016_03_19-22_17.tar.bz2")) + (sha256 (base32 + "0m54yx2dvgqifhdgsninlsr6iaaax67c698k1nqlw0c7kl85ilw1")))) + (build-system gnu-build-system) + (native-inputs + `(("m4" ,m4) + ("texlive" ,texlive))) + (inputs + `(("gmp" ,gmp) + ("readline" ,readline))) + (arguments + `(#:test-target "testinstall" + #:configure-flags + (list (string-append "--with-gmp=" (assoc-ref %build-inputs "gmp"))) + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch + (lambda _ + ;; Drop a test checking home and other directories. + (delete-file "tst/testinstall/dir.tst") + #t)) + (add-after 'build 'make-doc + ;; Rebuild the documentation from source. + (lambda _ + (system* "make" "manuals") + #t)) + (replace 'install + ;; There is no install target. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (pkg (string-append out "/pkg"))) + (mkdir out) + (with-directory-excursion "bin" + ;; In start script, replace build by install directory, and + ;; clean up. + (substitute* (readlink "gap.sh") + (("^GAP_DIR=.*") (string-append "GAP_DIR=\"" out "\"\n"))) + (map delete-file + '("BuildPackages.sh" "cygwin.ver" "gapicon.bmp" + "gapicon.ico" "gaprxvt.ico" "usemem.bat"))) + ;; Install subdirectories. + (map (lambda (name) + (copy-recursively name (string-append out "/" name))) + '("bin" "doc" "grp" "lib")) + ;; Copy just some of the packages containing only GAP code and + ;; needing no compilation, since altogether, there are 131 + ;; packages with more than 1GB of source code. + ;; GAPDoc is mandatory; after that, we take inspiration from + ;; SAGE. For the time being, we drop polymaking, which requires + ;; polymake, and packages depending on polymaking; and Alnuth, + ;; which requires PARI/GP. + (mkdir pkg) + (with-directory-excursion "pkg" + (map (lambda (name) + (copy-recursively name (string-append pkg "/" name))) + '("GAPDoc-1.5.1" + "crime" "cttllib" "design" "factint" "grape" + "guava-3.13" "Hap1.11" "laguna" + "sonata" "toric1.8" "polycyclic-2.11" "autpgroup" + "atlasrep"))) + #t)))))) + (synopsis "Computer algebra system specialized in group theory") + (description + "GAP is a system for computational discrete algebra, with particular +emphasis on computational group theory. GAP provides a programming +language, a library of thousands of functions implementing algebraic +algorithms written in the GAP language as well as large data libraries +of algebraic objects.") + (license license:gpl2+) + (home-page "http://www.gap-system.org/"))) + (define-public bc (package (name "bc") -- 2.7.3
