* [PATCH 1/3] gnu: Add slib.
@ 2017-02-26 19:42 John Darrington
2017-02-26 19:42 ` [PATCH 2/3] gnu: Add scm John Darrington
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: John Darrington @ 2017-02-26 19:42 UTC (permalink / raw)
To: guix-devel; +Cc: John Darrington
* gnu/packages/scheme.scm (slib): New variable.
---
gnu/packages/scheme.scm | 42 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index af416c5..5134c24 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
+;;; Copyright © 2017 John Darrington <jmd@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,8 +26,8 @@
(define-module (gnu packages scheme)
#:use-module (gnu packages)
#:use-module ((guix licenses)
- #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3
- cc-by-sa4.0))
+ #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
+ cc-by-sa4.0 non-copyleft))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -57,6 +58,7 @@
#:use-module (gnu packages xorg)
#:use-module (gnu packages tls)
#:use-module (gnu packages gl)
+ #:use-module (gnu packages zip)
#:use-module (ice-9 match))
(define (mit-scheme-source-directory system version)
@@ -844,3 +846,39 @@ metalinguistic abstraction, recursion, interpreters, and modular programming.")
"String pattern-matching library for scheme48 based on the SRE
regular-expression notation.")
(license bsd-3))))
+
+(define-public slib
+ (package
+ (name "slib")
+ (version "3b5")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-" version ".zip"))
+ (sha256
+ (base32
+ "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;; No check target
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'remove-bin-share
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (zero? (system* "rm" "-r"
+ (string-append
+ (assoc-ref outputs "out") "/bin")))))
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (zero? (system* "./configure"
+ (string-append "--prefix="
+ (assoc-ref outputs "out")))))))))
+ (native-inputs `(("unzip" ,unzip)
+ ("texinfo" ,texinfo)))
+ (home-page "http://people.csail.mit.edu/jaffer/SLIB/")
+ (synopsis "Compatibility and utility library for Scheme.")
+ (description "SLIB is a portable Scheme library providing compatibility and
+utility functions for all standard Scheme implementations.")
+ (license (non-copyleft
+ "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
+ "Or see COPYING in the distribution."))))
+
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] gnu: Add scm.
2017-02-26 19:42 [PATCH 1/3] gnu: Add slib John Darrington
@ 2017-02-26 19:42 ` John Darrington
2017-02-26 19:42 ` [PATCH 3/3] gnu: Add jacal John Darrington
2017-02-28 0:26 ` [PATCH 1/3] gnu: Add slib Leo Famulari
2 siblings, 0 replies; 6+ messages in thread
From: John Darrington @ 2017-02-26 19:42 UTC (permalink / raw)
To: guix-devel; +Cc: John Darrington
* gnu/packages/scheme.scm (scm): New variable.
---
gnu/packages/scheme.scm | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 5134c24..cd3fb5b 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -882,3 +882,64 @@ utility functions for all standard Scheme implementations.")
"http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
"Or see COPYING in the distribution."))))
+(define-public scm
+ (package
+ (name "scm")
+ (version "5f2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
+ version ".zip"))
+ (sha256
+ (base32
+ "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (zero? (system* "./configure"
+ (string-append "--prefix="
+ (assoc-ref outputs "out"))))))
+ (add-before 'build 'pre-build
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "Makefile"
+ (("ginstall-info") "install-info"))))
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (setenv "SCHEME_LIBRARY_PATH"
+ (string-append (assoc-ref inputs "slib")
+ "/lib/slib/"))
+ (and
+ (zero? (system* "make" "scmlit" "CC=gcc"))
+ (zero? (system* "make" "all")))))
+ (add-after 'install 'post-install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((req
+ (string-append (assoc-ref outputs "out")
+ "/lib/scm/require.scm")))
+ (and
+ (delete-file req)
+ (format (open req (logior O_WRONLY O_CREAT))
+ "(define (library-vicinity) ~s)\n"
+ (string-append (assoc-ref inputs "slib")
+ "/lib/slib/"))
+
+ ;; We must generate the slibcat file
+ (zero? (system*
+ (string-append
+ (assoc-ref outputs "out")
+ "/bin/scm")
+ "-br" "new-catalog")))))))))
+ (inputs `(("slib" ,slib)))
+ (native-inputs `(("unzip" ,unzip)
+ ("texinfo" ,texinfo)))
+ (home-page "http://people.csail.mit.edu/jaffer/SCM")
+ (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
+ (description "GNU SCM is an implementation of Scheme. This
+implementation includes Hobbit, a Scheme-to-C compiler, which can
+generate C files whose binaries can be dynamically or statically
+linked with a SCM executable.")
+ (license lgpl3+)))
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] gnu: Add jacal.
2017-02-26 19:42 [PATCH 1/3] gnu: Add slib John Darrington
2017-02-26 19:42 ` [PATCH 2/3] gnu: Add scm John Darrington
@ 2017-02-26 19:42 ` John Darrington
2017-02-28 0:31 ` Leo Famulari
2017-02-28 0:26 ` [PATCH 1/3] gnu: Add slib Leo Famulari
2 siblings, 1 reply; 6+ messages in thread
From: John Darrington @ 2017-02-26 19:42 UTC (permalink / raw)
To: guix-devel; +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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] gnu: Add slib.
2017-02-26 19:42 [PATCH 1/3] gnu: Add slib John Darrington
2017-02-26 19:42 ` [PATCH 2/3] gnu: Add scm John Darrington
2017-02-26 19:42 ` [PATCH 3/3] gnu: Add jacal John Darrington
@ 2017-02-28 0:26 ` Leo Famulari
2 siblings, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2017-02-28 0:26 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
On Sun, Feb 26, 2017 at 08:42:26PM +0100, John Darrington wrote:
> * gnu/packages/scheme.scm (slib): New variable.
> +(define-public slib
> + (package
> + (name "slib")
> + (version "3b5")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-" version ".zip"))
Line too looooooong :)
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'install 'remove-bin-share
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (zero? (system* "rm" "-r"
How about the the Scheme procedure delete-file-recursively from (guix
build utils)?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] gnu: Add jacal.
2017-02-26 19:42 ` [PATCH 3/3] gnu: Add jacal John Darrington
@ 2017-02-28 0:31 ` Leo Famulari
2017-02-28 6:10 ` John Darrington
0 siblings, 1 reply; 6+ messages in thread
From: Leo Famulari @ 2017-02-28 0:31 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
On Sun, Feb 26, 2017 at 08:42:28PM +0100, John Darrington wrote:
> * gnu/packages/maths.scm (jacal): New variable.
> * gnu/packages/patches/jacal.texi.patch: New file.
Can you rename the patch jacal-texi.patch (for consistency with the
majority of the patches) and add a comment in the patch file explaining
what it does?
> + (replace 'configure
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (zero? (system* "./configure"
> + (string-append "--prefix="
> + (assoc-ref outputs "out")))))))))
This can be done in #:configure-flags, right?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] gnu: Add jacal.
2017-02-28 0:31 ` Leo Famulari
@ 2017-02-28 6:10 ` John Darrington
0 siblings, 0 replies; 6+ messages in thread
From: John Darrington @ 2017-02-28 6:10 UTC (permalink / raw)
To: Leo Famulari; +Cc: guix-devel, John Darrington
[-- Attachment #1: Type: text/plain, Size: 890 bytes --]
On Mon, Feb 27, 2017 at 07:31:11PM -0500, Leo Famulari wrote:
> + (replace 'configure
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (zero? (system* "./configure"
> + (string-append "--prefix="
> + (assoc-ref outputs "out")))))))))
This can be done in #:configure-flags, right?
Normally it could be. But in this case, the ./configure script is not a autoconf generated one
and does not accept many of the default options that gnu-build-system sends to it.
J'
--
Avoid eavesdropping. Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-02-28 6:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-26 19:42 [PATCH 1/3] gnu: Add slib John Darrington
2017-02-26 19:42 ` [PATCH 2/3] gnu: Add scm John Darrington
2017-02-26 19:42 ` [PATCH 3/3] gnu: Add jacal John Darrington
2017-02-28 0:31 ` Leo Famulari
2017-02-28 6:10 ` John Darrington
2017-02-28 0:26 ` [PATCH 1/3] gnu: Add slib Leo Famulari
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).