From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Darrington Subject: [PATCH 3/3] gnu: Add jacal. Date: Sun, 26 Feb 2017 20:42:28 +0100 Message-ID: <1488138148-24017-3-git-send-email-jmd@gnu.org> References: <1488138148-24017-1-git-send-email-jmd@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci4iV-0002pK-JL for guix-devel@gnu.org; Sun, 26 Feb 2017 14:42:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci4iR-0000tQ-BM for guix-devel@gnu.org; Sun, 26 Feb 2017 14:42:47 -0500 In-Reply-To: <1488138148-24017-1-git-send-email-jmd@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: John Darrington * gnu/packages/maths.scm (jacal): New variable. * gnu/packages/patches/jacal.texi.patch: New file. --- gnu/packages/maths.scm | 50 +++++++++++++++++++ gnu/packages/patches/jacal.texi.patch | 90 +++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 gnu/packages/patches/jacal.texi.patch diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 18536c4..df3ba40 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -83,6 +83,7 @@ #:use-module (gnu packages python) #:use-module (gnu packages readline) #:use-module (gnu packages tbb) + #:use-module (gnu packages scheme) #:use-module (gnu packages shells) #:use-module (gnu packages tcl) #:use-module (gnu packages texinfo) @@ -2956,3 +2957,52 @@ algorithm for LCS. It is a fast program to compute the approximate Longest Commons Subsequence of a set of strings.") (home-page "https://github.com/gdv/Reduce-Expand-for-LCS") (license license:gpl3+)))) + +(define-public jacal + (package + (name "jacal") + (version "1c4") + (source (origin + (method url-fetch) + (uri (string-append + "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-" + version ".zip")) + (sha256 (base32 + "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q")) + (patches (search-patches "jacal.texi.patch")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'pre-build + ;; Don't use upstream's script - it really doesn't fit into + ;; Guix's functional paradigm. + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "Makefile" + (("^install: install-script") "install: ")))) + (add-after 'install 'post-install + ;; Instead, we provide our own simplified script. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((wrapper (string-append (assoc-ref outputs "out") + "/bin/jacal"))) + (format (open wrapper (logior O_WRONLY O_CREAT)) + "#!~a\nexec ~a/bin/scm -ip1 -e '(slib:load \"~a/lib/jacal/math\") (math)' \"$@\"\n" + (which "bash") + (assoc-ref inputs "scm") + (assoc-ref outputs "out")) + (chmod wrapper #o555)))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (zero? (system* "./configure" + (string-append "--prefix=" + (assoc-ref outputs "out"))))))))) + (inputs `(("scm" ,scm))) + (native-inputs `(("unzip" ,unzip) + ("texinfo" ,texinfo))) + (synopsis "Symbolic mathematics system") + (description "GNU JACAL is an interactive symbolic mathematics program based on +Scheme. It manipulate and simplify a range of mathematical expressions such +as equations, scalars, vectors, and matrices.") + (home-page "http://www.gnu.org/software/jacal") + (license license:gpl3+))) + diff --git a/gnu/packages/patches/jacal.texi.patch b/gnu/packages/patches/jacal.texi.patch new file mode 100644 index 0000000..27c6d78 --- /dev/null +++ b/gnu/packages/patches/jacal.texi.patch @@ -0,0 +1,90 @@ +--- jacal/jacal.texi,orig 2017-02-23 20:35:55.303980444 +0100 ++++ jacal/jacal.texi 2017-02-23 20:53:14.539024674 +0100 +@@ -343,7 +343,7 @@ + + With the standard input grammar, the precedence of @samp{-} as a prefix + behaves strangely. @code{a^-b*c} becomes @code{a^(-b*c)} while +-@code{@result{a^b*c} (a^b)*c}. ++@code{a^b*c @result{} (a^b)*c}. + + Using @code{divide} to divide a polynomial by an integer does not work. + +@@ -675,8 +675,9 @@ + e1: --------- + a + @end example ++@end deffn + +-@deffnx Command suchthat var exp ++@deffn Command suchthat var exp + + If an expression rather than an equation is given to @code{suchthat}, it + is as though the equation @code{@var{exp}=0} was given. +@@ -688,8 +689,9 @@ + e2: --------- + a + @end example ++@end deffn + +-@deffnx Operator | var exp_or_eqn ++@deffn Operator | var exp_or_eqn + + An alternative infix notation is also available for @code{suchthat}. + +@@ -857,8 +859,9 @@ + + Returns the degree of polynomial or equation @var{poly} in variable + @var{var}. ++@end deffn + +-@deffnx Operator degree poly ++@deffn Operator degree poly + + Returns the total-degree, the degree of its highest degree monomial, + of polynomial or equation @var{poly}. +@@ -1016,10 +1019,12 @@ + Returns @var{poly1} reduced with respect to @var{poly2} (or @var{eqn}) + and @var{var}. If @var{poly2} is univariate, the third argument is not + needed. ++@end deffn + +-@deffnx Command mod poly1 n ++@deffn Command mod poly1 n + Returns @var{poly1} with all the coefficients taken modulo @var{n}. +-@deffnx Command mod poly1 ++@end deffn ++@deffn Command mod poly1 + Returns @var{poly1} with all the coefficients taken modulo the + current modulus. + +@@ -1220,8 +1225,9 @@ + e1: -1 2 3 5 + @end group + @end example ++@end deffn + +-@deffnx Command factor polyratio ++@deffn Command factor polyratio + Given a univariate ratio of polynomials @var{polyratio}, returns a + matrix of factors and exponents. + +@@ -2028,7 +2034,7 @@ + formed from the pair-wise products of components of the inputs. For + example, for the input tensors @code{x[a,b]} and @code{y[c]} + @example +-@result{z:tmult(x,y);} z[a,b,c] = x[a,b]*y[c] ++z:tmult(x,y); @result{} z[a,b,c] = x[a,b]*y[c] + @end example + + With an additional argument, @code{tmult} will produce the inner product +@@ -2464,8 +2470,9 @@ + If you do not wish to return to Jacal but really want to terminate the + session and return to the operating system, then after typing + @code{qed();}, type @code{(slib:exit)} or use @code{quit}. ++@end deffn + +-@deffnx Command quit ++@deffn Command quit + Exit directly from Jacal to the operating system. You will not be able + to continue your Jacal session. + -- 2.1.4