1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
5 ;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages racket)
23 #:use-module ((guix licenses)
24 #:select (asl2.0 expat lgpl3+))
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix utils)
29 #:use-module (guix gexp)
30 #:use-module (guix build-system gnu)
31 #:use-module (srfi srfi-1)
32 #:use-module (ice-9 match)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages bash)
35 #:use-module ((gnu packages chez)
36 #:select (chez-scheme))
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages gl)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages libedit)
45 #:use-module (gnu packages multiprecision)
46 #:use-module (gnu packages sqlite)
47 #:use-module (gnu packages tls)
48 #:use-module (gnu packages xorg))
51 (define %installer-mirrors
53 ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58
54 ;; Matthew Flatt says: "note that many are commented out"
55 ;; INVARIANT: End with a trailing "/"!
56 '("https://mirror.racket-lang.org/installers/"
57 "https://www.cs.utah.edu/plt/installers/"
58 "https://plt.cs.northwestern.edu/racket-mirror/"
59 "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/"
60 ;; Universität Tübingen is using a self-signed HTTPS certificate:
61 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
62 "https://racket.infogroep.be/"
66 (define-public racket-minimal
68 (name "racket-minimal")
69 (version "8.1") ; note: remember to also update racket!
73 (uri (map (lambda (base)
74 (string-append base version "/racket-minimal-src.tgz"))
76 (sha256 "04zzqybpxss50n1jrwwq98539gw0y0ygpw9civl2sq3s4ww7m8l3")
77 (patches (search-patches
78 "racket-sh-via-rktio.patch"))))
79 (home-page "https://racket-lang.org")
80 (synopsis "Racket without bundled packages such as DrRacket")
82 `(("openssl" ,openssl)
86 ("zlib:static" ,zlib "static")
88 ("lz4:static" ,lz4 "static")))
89 (build-system gnu-build-system)
92 `(,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH="
93 (assoc-ref %build-inputs "sh")
98 ((guix build gnu-build-system)
102 (modify-phases %standard-phases
103 (add-before 'configure 'pre-configure-minimal
104 (lambda* (#:key inputs #:allow-other-keys)
107 (add-after 'build 'patch-config.rktd-lib-search-dirs
108 (lambda* (#:key inputs outputs #:allow-other-keys)
109 ;; We do this between the `build` and `install` phases
110 ;; so that we have racket to read and write the hash table,
111 ;; but it comes before `raco setup`, when foreign libraries
112 ;; are needed to build the documentation.
113 (define out (assoc-ref outputs "out"))
121 (current-command-line-arguments)))
123 (extra-lib-search-dirs (cdr args)))
129 (append dirs extra-lib-search-dirs))
131 #:exists 'truncate/replace
135 (filter-map (lambda (lib)
137 ((assoc-ref inputs lib)
139 (string-append pth "/lib")))
159 ;; Tests are in packages like racket-test-core and
160 ;; main-distribution-test that aren't part of the main distribution.
163 "Racket is a general-purpose programming language in the Scheme family,
164 with a large set of libraries and a compiler based on Chez Scheme. Racket is
165 also a platform for language-oriented programming, from small domain-specific
166 languages to complete language implementations.
168 The ``minimal Racket'' distribution includes just enough of Racket for you to
169 use @command{raco pkg} to install more. Bundled packages, such as the
170 DrRacket IDE, are not included.")
171 ;; https://download.racket-lang.org/license.html
172 (license (list lgpl3+ asl2.0 expat))))
175 (define-public racket
179 (version (package-version racket-minimal)) ; needed for origin uri to work
182 (inherit (package-source racket-minimal))
183 (uri (map (lambda (base)
184 (string-append base version "/racket-src.tgz"))
188 "0xdqwrwm604bbnr97h75dps2ixxz2svlw0fn0f674bn04dcfd60f"))))
190 `(;; sqlite and libraries for `racket/draw' are needed to build the doc.
192 ("fontconfig" ,fontconfig)
196 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
197 ("libjpeg" ,libjpeg-turbo)
203 ("unixodbc" ,unixodbc)
205 ,@(package-inputs racket-minimal)))
206 (synopsis "A programmable programming language in the Scheme family")
208 "Racket is a general-purpose programming language in the Scheme family,
209 with a large set of libraries and a compiler based on Chez Scheme. Racket is
210 also a platform for language-oriented programming, from small domain-specific
211 languages to complete language implementations.
213 The main Racket distribution comes with many bundled packages, including the
214 DrRacket IDE, libraries for GUI and web programming, and implementations of
215 languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))