unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add GAP.
@ 2016-04-17 11:44 Andreas Enge
  2016-04-18 11:46 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Enge @ 2016-04-17 11:44 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

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


[-- Attachment #2: 0001-gnu-Add-GAP.patch --]
[-- Type: text/plain, Size: 4494 bytes --]

From 950101a323d58e7435a0f79e156af1c829baff58 Mon Sep 17 00:00:00 2001
From: Andreas Enge <andreas@enge.fr>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add GAP.
  2016-04-17 11:44 [PATCH] Add GAP Andreas Enge
@ 2016-04-18 11:46 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2016-04-18 11:46 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Hello,

Andreas Enge <andreas@enge.fr> writes:

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

I was also trying to pave the way towards SAGE. I tested it briefly and,
AFAIC, it looks good. Thank you for the work.

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

GAP packages require their own input, so they could be considered as
first-class packages in Guix (e.g, define-public gap-sonata), all
propagating gap and setting an appropriate GAP root directory.

OTOH, GAP provides its own mechanism to handle its packages.

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

Considering the educational purpose of GAP, and the sheer size of the
packages involved, I tend to think that 35MB documentation is not much
of a problem. IMO, we should keep it around. 

Of course, a gap:doc ouput seems the best option, provided it can be
made to work. For example, could gap:doc install "doc" directory in
a new location and symlink "lib", "bin", etc. from the original "out"
directory? Then the only thing left to do would be to set GAP_DIR (e.g,
by modifying gap.sh) to "doc" output.


Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-18 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-17 11:44 [PATCH] Add GAP Andreas Enge
2016-04-18 11:46 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).