;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
+;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
;;; Copyright © 2017 John Darrington <jmd@gnu.org>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
+;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
+;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
;;;
;;; This file is part of GNU Guix.
;;;
(define-module (gnu packages scheme)
#:use-module (gnu packages)
#:use-module ((guix licenses)
- #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
+ #:select (gpl2+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ asl2.0 bsd-3
cc-by-sa4.0 non-copyleft expat))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system trivial)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bdw-gc)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages libevent)
#:use-module (gnu packages tls)
#:use-module (gnu packages gl)
#:use-module (gnu packages libedit)
+ #:use-module (gnu packages linux)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match))
(define-public racket
(package
(name "racket")
- (version "7.6")
+ (version "8.0") ; note: remember to also update racket-minimal!
(source (origin
(method url-fetch)
- (uri (list (string-append "http://mirror.racket-lang.org/installers/"
- version "/racket-" version "-src.tgz")
+ (uri (list (string-append "https://mirror.racket-lang.org/installers/"
+ version "/racket-src.tgz")
+ ;; this mirror seems to have broken HTTPS:
(string-append
"http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
- version "/racket-" version "-src.tgz")))
+ version "/racket-src.tgz")))
(sha256
(base32
- "0yagy7qrnz96gwafnj3whh2vs54788k1ci3vkm100h68gsw638b8"))
+ "047wpjblfzmf1msz7snrp2c2h0zxyzlmbsqr9bwsyvz3frcg0888"))
(patches (search-patches
+ "racket-sh-via-rktio.patch"
+ ;; TODO: If we're no longer patching Racket source
+ ;; files with store paths, we may also fix the
+ ;; issue that necessitated the following patch:
"racket-store-checksum-override.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:configure-flags
+ `(,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH="
+ (assoc-ref %build-inputs "sh")
+ "/bin/sh")
+ "--enable-libz"
+ "--enable-liblz4")
+ #:modules
+ ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1))
+ #:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'patch-chez-configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* "src/cs/c/Makefile.in"
+ (("/bin/sh") (which "sh")))
+ ;; TODO: Racket CS uses a fork of Chez Scheme.
+ ;; Most of this is copy-pasted from the "chez.scm",
+ ;; but maybe there's a way to reuse more directly.
+ (with-directory-excursion "src/ChezScheme"
+ (substitute* (find-files "mats" "Mf-.*")
+ (("^[[:space:]]+(cc ) *") "\tgcc "))
+ (substitute*
+ (find-files "." (string-append
+ "("
+ "Mf-[a-zA-Z0-9.]+"
+ "|Makefile[a-zA-Z0-9.]*"
+ "|checkin"
+ "|stex\\.stex"
+ "|newrelease"
+ "|workarea"
+ "|unix\\.ms"
+ "|^6\\.ms"
+ ;;"|[a-zA-Z0-9.]+\\.ms" ; guile can't read
+ ")"))
+ (("/bin/rm") (which "rm"))
+ (("/bin/ln") (which "ln"))
+ (("/bin/cp") (which "cp"))
+ (("/bin/echo") (which "echo")))
+ (substitute* "makefiles/installsh"
+ (("/bin/true") (which "true"))))
+ #t))
(add-before 'configure 'pre-configure-minimal
(lambda* (#:key inputs #:allow-other-keys)
- ;; Patch dynamically loaded libraries with their absolute paths.
- (let* ((library-path (search-path-as-string->list
- (getenv "LIBRARY_PATH")))
- (find-so (lambda (soname)
- (search-path
- library-path
- (format #f "~a.so" soname)))))
- (substitute* "collects/db/private/sqlite3/ffi.rkt"
- (("ffi-lib sqlite-so")
- (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
- (substitute* "collects/openssl/libssl.rkt"
- (("ffi-lib libssl-so")
- (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
- (substitute* "collects/openssl/libcrypto.rkt"
- (("ffi-lib libcrypto-so")
- (format #f "ffi-lib \"~a\"" (find-so "libcrypto")))))
(chdir "src")
#t))
- (add-before 'pre-configure-minimal 'pre-configure
- (lambda* (#:key inputs #:allow-other-keys)
- ;; Patch dynamically loaded libraries with their absolute paths.
- (let* ((library-path (search-path-as-string->list
- (getenv "LIBRARY_PATH")))
- (find-so (lambda (soname)
- (search-path
- library-path
- (format #f "~a.so" soname))))
- (patch-ffi-libs (lambda (file libs)
- (for-each
- (lambda (lib)
- (substitute* file
- (((format #f "\"~a\"" lib))
- (format #f "\"~a\"" (find-so lib)))))
- libs))))
- (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
- (("ffi-lib libgmp-so")
- (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
- (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
- (("ffi-lib libmpfr-so")
- (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
- (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
- (("\\(getenv \"PLT_READLINE_LIB\"\\)")
- (format #f "\"~a\"" (find-so "libedit"))))
- (for-each
- (lambda (x) (apply patch-ffi-libs x))
- '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
- ("libfontconfig" "libcairo"))
- ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
- ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
- ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
- ("libjpeg"))
- ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
- ("libpango-1.0" "libpangocairo-1.0"))
- ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
- ("libpng"))
- ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
- ("libodbc"))
- ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
- ("libX11"))
- ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
- ("libgio-2.0"))
- ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
- ("libgdk-3" "libgtk-3"))
- ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
- ("libunique-1.0"))
- ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
- ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
- ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
- ("libGL"))
- ("share/pkgs/sgl/gl.rkt"
- ("libGL" "libGLU")))))
- #t))
- (add-after 'unpack 'patch-/bin/sh
- (lambda _
- (substitute* "collects/racket/system.rkt"
- (("/bin/sh") (which "sh")))
+ (add-after 'build 'patch-config.rktd-lib-search-dirs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; We do this between the `build` and `install` phases
+ ;; so that we have racket to read and write the hash table,
+ ;; but it comes before `raco setup`, when foreign libraries
+ ;; are needed to build the documentation.
+ (define out (assoc-ref outputs "out"))
+ (apply invoke
+ "./cs/c/racketcs"
+ "-e"
+ ,(format #f
+ "~s"
+ '(let* ((args
+ (vector->list
+ (current-command-line-arguments)))
+ (file (car args))
+ (extra-lib-search-dirs (cdr args)))
+ (write-to-file
+ (hash-update
+ (file->value file)
+ 'lib-search-dirs
+ (lambda (dirs)
+ (append dirs extra-lib-search-dirs))
+ null)
+ #:exists 'truncate/replace
+ file)))
+ "--"
+ "../etc/config.rktd"
+ (filter-map (lambda (lib)
+ (cond
+ ((assoc-ref inputs lib)
+ => (lambda (pth)
+ (string-append pth "/lib")))
+ (else
+ #f)))
+ '("cairo"
+ "fontconfig"
+ "glib"
+ "glu"
+ "gmp"
+ "gtk+"
+ "libjpeg"
+ "libpng"
+ "libx11"
+ "mesa"
+ "mpfr"
+ "openssl"
+ "pango"
+ "sqlite"
+ "unixodbc"
+ "libedit")))
#t)))
;; XXX: how to run them?
#:tests? #f))
(inputs
- `(("libffi" ,libffi)
- ;; Hardcode dynamically loaded libraries for better functionality.
- ;; sqlite and libraries for `racket/draw' are needed to build the doc.
+ `(;; sqlite and libraries for `racket/draw' are needed to build the doc.
+ ("sh" ,bash-minimal)
+ ("zlib" ,zlib)
+ ("zlib:static" ,zlib "static")
+ ("lz4" ,lz4)
+ ("lz4:static" ,lz4 "static")
("cairo" ,cairo)
("fontconfig" ,fontconfig)
("glib" ,glib)
(home-page "https://racket-lang.org")
(synopsis "Implementation of Scheme and related languages")
(description
- "Racket is an implementation of the Scheme programming language (R5RS and
-R6RS) and related languages, such as Typed Racket. It features a compiler and
-a virtual machine with just-in-time native compilation, as well as a large set
-of libraries.")
+ "Racket is a general-purpose programming language in the Scheme family,
+with a large set of libraries and a compiler based on Chez Scheme. Racket is
+also a platform for language-oriented programming, from small domain-specific
+languages to complete language implementations.
+
+The main Racket distribution comes with many bundled packages, including
+the DrRacket IDE, libraries for GUI and web programming, and implementations
+of languages such as Typed Racket, R5RS and R6RS Scheme, and Datalog.")
;; https://download.racket-lang.org/license.html
(license (list lgpl3+ asl2.0 expat))))
(inherit racket)
(name "racket-minimal")
(version (package-version racket))
- (source (origin
- (method url-fetch)
- (uri (list (string-append "http://mirror.racket-lang.org/installers/"
- version "/racket-minimal-" version "-src.tgz")
- (string-append
- "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
- version "/racket-minimal-" version "-src.tgz")))
- (sha256
- (base32
- "0id094q9024hj2n3907l7dblp3iix1v5289xzskmh5c26xfygp9y"))
- (patches (search-patches
- "racket-store-checksum-override.patch"))))
+ (source
+ (origin
+ (inherit (package-source racket))
+ (uri (list (string-append "https://mirror.racket-lang.org/installers/"
+ version "/racket-minimal-src.tgz")
+ ;; this mirror seems to have broken HTTPS:
+ (string-append
+ "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
+ version "/racket-minimal-src.tgz")))
+ (sha256 "0mwyffw4gcci8wmzxa3j28h03h0gsz55aard8qrk3lri8r2xyg21")))
(synopsis "Racket without bundled packages such as Dr. Racket")
- (arguments
- (substitute-keyword-arguments (package-arguments racket)
- ((#:phases phases)
- `(modify-phases ,phases
- ;; Delete fix that applies to files not included in the minimal package.
- (delete 'pre-configure)))))
(inputs
- `(("libffi" ,libffi)
- ("openssl" ,openssl)
- ("sqlite" ,sqlite)))
+ `(("openssl" ,openssl)
+ ("sqlite" ,sqlite)
+ ("sh" ,bash-minimal)
+ ("zlib" ,zlib)
+ ("zlib:static" ,zlib "static")
+ ("lz4" ,lz4)
+ ("lz4:static" ,lz4 "static")))
(description
- "Racket is an implementation of the Scheme programming language (R5RS and
-R6RS) and related languages, such as Typed Racket. It features a compiler and
-a virtual machine with just-in-time native compilation, as well as a large set
-of libraries.
+ "Racket is a general-purpose programming language in the Scheme family,
+with a large set of libraries and a compiler based on Chez Scheme. Racket is
+also a platform for language-oriented programming, from small domain-specific
+languages to complete language implementations.
-In this minimal package, the essential package racket-libs is included, as
-well as libraries that live in collections. In particular, @command{raco} and
-the @code{pkg} library are still bundled.")))
+The ``minimal Racket'' distribution includes just enough of Racket for you to
+use @command{raco pkg} to install more. Bundled packages, such as the
+Dr. Racket IDE, are not included.")))
(define-public gambit-c
(package
(define-public chibi-scheme
(package
(name "chibi-scheme")
- (version "0.8")
+ (version "0.9")
(home-page "https://github.com/ashinn/chibi-scheme")
(source
(origin
(file-name (git-file-name name version))
(sha256
(base32
- "0269d5fhaz7nqjb41vh7yz63mp5s4z08fn4sspwc06z32xksigw9"))))
+ "1lnap41gl9vg82h557f4rlr69jgmd2gh0iqs6cxm77d39kv1scb8"))))
(build-system gnu-build-system)
(arguments
`(#:phases (modify-phases %standard-phases
(inputs `(("slib" ,slib)))
(native-inputs `(("unzip" ,unzip)
("texinfo" ,texinfo)))
- (home-page "http://people.csail.mit.edu/jaffer/SCM")
+ (home-page "https://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
(define-public tinyscheme
(package
(name "tinyscheme")
- (version "1.41")
+ (version "1.42")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/" name "/" name "/"
name "-" version "/" name "-" version ".zip"))
(sha256
(base32
- "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
+ "0rik3qnxqd8wjlazx8rw996pfzkjjg60v6hcbpcqzi7rgml8q4n8"))))
(build-system gnu-build-system)
(native-inputs
`(("unzip" ,unzip)))
;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
(method git-fetch)
(uri (git-reference
- (url "https://github.com/barak/stalin.git")
+ (url "https://github.com/barak/stalin")
(commit commit)))
(file-name (string-append name "-" version "-checkout"))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/JeffBezanson/femtolisp.git")
+ (url "https://github.com/JeffBezanson/femtolisp")
(commit commit)))
(file-name (string-append name "-" version "-checkout"))
(sha256
(define-public gauche
(package
(name "gauche")
- (version "0.9.9")
- (home-page "http://practical-scheme.net/gauche/index.html")
+ (version "0.9.10")
+ (home-page "https://practical-scheme.net/gauche/index.html")
(source
(origin
(method url-fetch)
"mirror://sourceforge/gauche/Gauche/Gauche-"
version ".tgz"))
(sha256
- (base32 "1yzpszhw52vkpr65r5d4khf3489mnnvnw58dd2wsvvx7499k5aac"))
+ (base32 "0ci57ak5cp3lkmfy3nh50hifh8nbg58hh6r18asq0rn5mqfxyf8g"))
(modules '((guix build utils)))
(snippet '(begin
;; Remove libatomic-ops.
(build-system gnu-build-system)
(inputs
`(("libatomic-ops" ,libatomic-ops)
+ ("slib" ,slib)
("zlib" ,zlib)))
(native-inputs
`(("texinfo" ,texinfo)
("openssl" ,openssl) ; needed for tests
("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
(arguments
- `(#:phases
+ `(#:configure-flags
+ (list (string-append "--with-slib="
+ (assoc-ref %build-inputs "slib")
+ "/lib/slib"))
+ #:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-/bin/sh
;; Needed only for tests.
(lambda _
- (substitute* '("configure"
- "test/www.scm"
+ (substitute* '("test/www.scm"
"ext/tls/test.scm"
- "gc/configure"
- "lib/gauche/configure.scm"
"lib/gauche/package/util.scm"
- "lib/gauche/process.scm")
+ "libsrc/gauche/process.scm")
(("/bin/sh") (which "sh")))
#t))
(add-after 'build 'build-doc
(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"))
+ (delete-file "ext/net/test.scm")
+ (invoke "touch" "ext/net/test.scm")
#t))
(add-after 'install 'install-docs
(lambda _
manager/installer @code{gauche-package} which can download, compile, install
and list gauche extension packages.")
(license bsd-3)))
+
+(define-public gerbil
+ (package
+ (name "gerbil")
+ (version "0.16")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/vyzo/gerbil")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f"))))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'bootstrap)
+ (add-before 'configure 'chdir
+ (lambda _
+ (chdir "src")
+ #t))
+ (replace 'configure
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (invoke "chmod" "755" "-R" ".")
+ ;; Otherwise fails when editing an r--r--r-- file.
+ (invoke "gsi-script" "configure"
+ "--prefix" (assoc-ref outputs "out")
+ "--with-gambit" (assoc-ref inputs "gambit-c"))))
+ (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs
+ (lambda _
+ ;; Some .ss files refer to gxi using /usr/bin/env gxi
+ ;; and 'patch-generated-file-shebangs can't fix that
+ ;; because gxi has not been compiled yet.
+ ;; We know where gxi is going to end up so we
+ ;; Doctor Who our fix here before the problem
+ ;; happens towards the end of the build.sh script.
+ (let ((abs-srcdir (getcwd)))
+ (for-each
+ (lambda (f)
+ (substitute* f
+ (("#!/usr/bin/env gxi")
+ (string-append "#!" abs-srcdir "/../bin/gxi"))))
+ '("./gerbil/gxc"
+ "./lang/build.ss"
+ "./misc/http-perf/build.ss"
+ "./misc/rpc-perf/build.ss"
+ "./misc/scripts/docsnarf.ss"
+ "./misc/scripts/docstub.ss"
+ "./misc/scripts/docsyms.ss"
+ "./r7rs-large/build.ss"
+ "./release.ss"
+ "./std/build.ss"
+ "./std/run-tests.ss"
+ "./std/web/fastcgi-test.ss"
+ "./std/web/rack-test.ss"
+ "./tools/build.ss"
+ "./tutorial/httpd/build.ss"
+ "./tutorial/kvstore/build.ss"
+ "./tutorial/lang/build.ss"
+ "./tutorial/proxy/build-static.ss"
+ "./tutorial/proxy/build.ss")))
+ #t))
+ (replace
+ 'build
+ (lambda*
+ (#:key inputs #:allow-other-keys)
+ (setenv "HOME" (getcwd))
+ (invoke
+ ;; The build script needs a tty or it'll crash on an ioctl
+ ;; trying to find the width of the terminal it's running on.
+ ;; Calling in script prevents that.
+ "script"
+ "-qefc"
+ "./build.sh")))
+ (delete 'check)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (lib (string-append out "/lib")))
+ (mkdir-p bin)
+ (mkdir-p lib)
+ (copy-recursively "../bin" bin)
+ (copy-recursively "../lib" lib)))))))
+ (native-inputs
+ `(("coreutils" ,coreutils)
+ ("util-linux" ,util-linux)))
+ (propagated-inputs
+ `(("gambit-c" ,gambit-c)
+ ("zlib" ,zlib)
+ ("openssl" ,openssl)
+ ("sqlite" ,sqlite)))
+ (build-system gnu-build-system)
+ (synopsis "Meta-dialect of Scheme with post-modern features")
+ (description "Gerbil is an opinionated dialect of Scheme designed for Systems
+Programming, with a state of the art macro and module system on top of the Gambit
+runtime. The macro system is based on quote-syntax, and provides the full meta-syntactic
+tower with a native implementation of syntax-case. It also provides a full-blown module
+system, similar to PLT Scheme's (sorry, Racket) modules. The main difference from Racket
+is that Gerbil modules are single instantiation, supporting high performance ahead of
+time compilation and compiled macros.")
+ (home-page "https://cons.io")
+ (license `(,lgpl2.1 ,asl2.0))))