From 82be68a42b1e95903f24bd0880be561b10d16499 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 20 Feb 2025 15:49:19 +0100 Subject: gnu: gap: Enable xgap package. * gnu/packages/algebra.scm (gap)[inputs]: Add libx11, libxaw, and libxt. [arguments]{prepare-package-source}: Substitute paths and modify configuration. {remove-packages}: Do not remove xgap. {install-packages}: Add a symlink from bin/ to xgap.sh. Change-Id: I9466fdb3f469325f7229de210b88d371c2839504 --- gnu/packages/algebra.scm | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index a8ad770c92..77e3c16205 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1362,6 +1362,7 @@ (define-public gap (list gmp readline zlib cddlib ; for the cddinterface package curl ; for the curlinterface package + libx11 libxaw libxt ; for the xgap package zeromq ; for the zeromqinterface package )) (arguments @@ -1374,8 +1375,23 @@ (define-public gap (with-directory-excursion "pkg" ;; Unpack package tarball, so that shebangs can be modified. (with-directory-excursion "caratinterface" - (invoke "tar" "xvf" "carat.tgz"))))) - ;; The following phases are added after 'build, apparently in + (invoke "tar" "xvf" "carat.tgz")) + ;; Replace paths and adapt configuration. + (with-directory-excursion "xgap" + (substitute* '("Makefile.in" "cnf/Makegap.in") + (("/bin/sh") + (string-append + (assoc-ref %build-inputs "bash") "/bin/bash"))) + (substitute* "xgap.sh.in" + (("\"@gapdir@\"") + (string-append %output "/share/gap")) + (("^XGAP=.*$") + (string-append "XGAP=" %output + "/share/gap/pkg/xgap/bin/$XGAP_PRG\n")) + (("^GAP=.*$") + (string-append "GAP=" %output "/bin/gap\n")) + (("VERBOSE=\"NO\"") "VERBOSE=\"YES\"")))))) + ;; The following phases are executed after 'build, apparently in ;; reverse order. So we carry out 'build, then 'build-doc, then ;; 'remove-packages, then 'build-packages. (add-after 'build 'build-packages @@ -1391,8 +1407,7 @@ (define-public gap (with-directory-excursion "pkg" (for-each delete-file-recursively '("normalizinterface" ; tries to download normaliz even when it is available - "semigroups" ; bundled dependencies - "xgap" ; make: /bin/sh: No such file or directory + "semigroups" ; bundled dependency libsemigroups ))))) (add-after 'build 'build-doc ;; The documentation is bundled, but we create it from source. @@ -1407,8 +1422,13 @@ (define-public gap (add-after 'install 'install-packages (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share/gap"))) - (copy-recursively "pkg" (string-append share "/pkg")))))))) + (bin (string-append out "/bin")) + (share (string-append out "/share/gap")) + (xgap-sh (string-append share "/pkg/xgap/xgap.sh")) + (xgap (string-append bin "/xgap"))) + (copy-recursively "pkg" (string-append share "/pkg")) + (chmod xgap-sh #o744) + (symlink xgap-sh xgap))))))) (home-page "https://www.gap-system.org/") (synopsis "System for computational group theory") -- cgit v1.2.3