summary refs log tree commit diff
path: root/gnu/packages/scheme.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-03-29 17:34:41 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-03-29 17:34:41 +0200
commit5576cfabf3485e0cf794cc3de085a3578151ee64 (patch)
tree8ca4093d05fda6b0064d0fca429353327ec491f9 /gnu/packages/scheme.scm
parent12cb6c31df4b90d58658e88a256e36b6808e1064 (diff)
parente086d2f68b90a39bae07ae46572e5cc6b0fc4308 (diff)
downloadguix-5576cfabf3485e0cf794cc3de085a3578151ee64.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/scheme.scm')
-rw-r--r--gnu/packages/scheme.scm67
1 files changed, 67 insertions, 0 deletions
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 65a2d5645a..4340237b29 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -954,3 +954,70 @@ 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+)))
+
+(define-public tinyscheme
+  (package
+    (name "tinyscheme")
+    (version "1.41")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name "/" name "/"
+                                  name "-" version "/" name "-" version ".zip"))
+              (sha256
+               (base32
+                "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'unpack
+           (lambda* (#:key source #:allow-other-keys)
+             (invoke "unzip" source)
+             (chdir (string-append ,name "-" ,version))
+             #t))
+         (add-after 'unpack 'set-scm-directory
+           ;; Hard-code ‘our’ init.scm instead of looking in the current
+           ;; working directory, so invoking ‘scheme’ just works.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (scm (string-append out "/share/" ,name)))
+               (substitute* "scheme.c"
+                 (("init.scm" all)
+                  (string-append scm "/" all)))
+               #t)))
+         (delete 'configure)            ; no configure script
+         (replace 'install
+           ;; There's no ‘install’ target.  Install files manually.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out     (assoc-ref outputs "out"))
+                    (bin     (string-append out "/bin"))
+                    (doc     (string-append out "/share/doc/"
+                                            ,name "-" ,version))
+                    (include (string-append out "/include"))
+                    (lib     (string-append out "/lib"))
+                    (scm     (string-append out "/share/" ,name)))
+               (install-file "scheme" bin)
+               (install-file "Manual.txt" doc)
+               (install-file "scheme.h" include)
+               (install-file "libtinyscheme.so" lib)
+               (install-file "init.scm" scm)
+               #t))))
+       #:tests? #f))                    ; no tests
+    (home-page "http://tinyscheme.sourceforge.net/")
+    (synopsis "Light-weight interpreter for the Scheme programming language")
+    (description
+     "TinyScheme is a light-weight Scheme interpreter that implements as large a
+subset of R5RS as was possible without getting very large and complicated.
+
+It's meant to be used as an embedded scripting interpreter for other programs.
+As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
+extensive toolkits, although it does sport a small (and optional) top-level
+loop.
+
+As an embedded interpreter, it allows multiple interpreter states to coexist in
+the same program, without any interference between them.  Foreign functions in C
+can be added and values can be defined in the Scheme environment.  Being quite a
+small program, it is easy to comprehend, get to grips with, and use.")
+    (license bsd-3)))                   ; there are no licence headers