+
+(define-public stalin
+ (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
+ ;; FIXME: The Stalin "source" contains C code generated by itself:
+ ;; 'stalin-AMD64.c', etc.
+ (package
+ (name "stalin")
+ (version "0.11")
+ (source (origin
+ ;; Use Pearlmutter's upstream branch with AMD64 patches
+ ;; applied. Saves us from including those 20M! patches
+ ;; in Guix. For more info, see:
+ ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/barak/stalin.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
+ (modules '((guix build utils)))
+ (snippet
+ ;; remove gc libs from build, we have them as input
+ '(begin
+ (delete-file "gc6.8.tar.gz")
+ (delete-file-recursively "benchmarks")
+ (substitute* "build"
+ ((".*gc6.8.*") "")
+ ((" cd \\.\\.") "")
+ ((".*B include/libgc.a") "")
+ ((".*make.*") ""))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (include-out (string-append out "/include")))
+ (invoke "./build")
+ (for-each (lambda (fname)
+ (install-file fname include-out))
+ (find-files "include"))
+ (substitute* "makefile"
+ (("\\./include") include-out))
+ (substitute* "post-make"
+ (("`pwd`") out))
+ #t)))
+ (delete 'check)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (install-file "stalin.1"
+ (string-append out "/share/man/man1"))
+ (install-file "stalin"
+ (string-append out "/bin"))
+ #t))))))
+ (inputs
+ `(("libx11" ,libx11)))
+ (propagated-inputs
+ `(("libgc" ,libgc)))
+ (supported-systems '("x86_64-linux"))
+ (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
+ (synopsis "Brutally efficient Scheme compiler")
+ (description
+ "Stalin is an aggressively optimizing whole-program compiler
+for Scheme that does polyvariant interprocedural flow analysis,
+flow-directed interprocedural escape analysis, flow-directed
+lightweight CPS conversion, flow-directed lightweight closure
+conversion, flow-directed interprocedural lifetime analysis, automatic
+in-lining, unboxing, and flow-directed program-specific and
+program-point-specific low-level representation selection and code
+generation.")
+ (license gpl2+))))
+
+(define-public femtolisp
+ (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
+ (revision "1"))
+ (package
+ (name "femtolisp")
+ (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/JeffBezanson/femtolisp.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
+ ;; See "utils.h" for supported systems. Upstream bug:
+ ;; https://github.com/JeffBezanson/femtolisp/issues/25
+ (supported-systems
+ (fold delete %supported-systems
+ '("armhf-linux" "mips64el-linux" "aarch64-linux")))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags '("CC=gcc" "release")
+ #:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; No configure script
+ (replace 'install ; Makefile has no 'install phase
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin")))
+ (install-file "flisp" bin)
+ #t)))
+ ;; The flisp binary is now available, run bootstrap to
+ ;; generate flisp.boot and afterwards runs make test.
+ (add-after 'install 'bootstrap-gen-and-test
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin")))
+ (and
+ (zero? (system* "./bootstrap.sh"))
+ (install-file "flisp.boot" bin))))))))
+ (synopsis "Scheme-like lisp implementation")
+ (description
+ "@code{femtolisp} is a scheme-like lisp implementation with a
+simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
+The core is 12 builtin special forms and 33 builtin functions.")
+ (home-page "https://github.com/JeffBezanson/femtolisp")
+ (license bsd-3))))
+
+(define-public gauche
+ (package
+ (name "gauche")
+ (version "0.9.7")
+ (home-page "http://practical-scheme.net/gauche/index.html")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://sourceforge/gauche/Gauche/Gauche-"
+ version ".tgz"))
+ (sha256
+ (base32
+ "181nycikma0rwrb1h6mi3kys11f8628pq8g5r3fg5hiz5sabscrd"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove libatomic-ops
+ (delete-file-recursively "gc/libatomic_ops")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("libatomic-ops" ,libatomic-ops)
+ ("zlib" ,zlib)))
+ (native-inputs
+ `(("texinfo" ,texinfo)
+ ("openssl" ,openssl) ; needed for tests
+ ("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-/bin/sh
+ ;; needed only for tests
+ (lambda _
+ (substitute* '("configure"
+ "test/www.scm"
+ "ext/tls/test.scm"
+ "gc/configure"
+ "lib/gauche/configure.scm"
+ "lib/gauche/package/util.scm"
+ "lib/gauche/process.scm")
+ (("/bin/sh") (which "sh")))
+ #t))
+ (add-after 'build 'build-doc
+ (lambda _
+ (with-directory-excursion "doc"
+ (invoke "make" "info"))
+ #t))
+ (add-before 'check 'patch-normalize-test
+ ;; neutralize sys-normalize-pathname test as it relies on
+ ;; the home directory; (setenv "HOME" xx) isn't enough)
+ (lambda _
+ (substitute* "test/system.scm"
+ (("~/abc") "//abc"))
+ #t))
+ (add-before 'check 'patch-network-tests
+ ;; remove net checks
+ (lambda _
+ (substitute* "ext/Makefile"
+ (("binary net termios") "binary termios"))
+ #t))
+ (add-after 'install 'install-docs
+ (lambda _
+ (with-directory-excursion "doc"
+ (invoke "make" "install"))
+ #t)))))
+ (synopsis "Scheme scripting engine")
+ (description "Gauche is a R7RS Scheme scripting engine aiming at being a
+handy tool that helps programmers and system administrators to write small to
+large scripts quickly. Quick startup, built-in system interface, native
+multilingual support are some of the goals. Gauche comes with a package
+manager/installer @code{gauche-package} which can download, compile, install
+and list gauche extension packages.")
+ (license bsd-3)))