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 compression)
36 #:use-module (gnu packages databases)
37 #:use-module (gnu packages fontutils)
38 #:use-module (gnu packages gl)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages libedit)
43 #:use-module (gnu packages multiprecision)
44 #:use-module (gnu packages sqlite)
45 #:use-module (gnu packages tls)
46 #:use-module (gnu packages xorg))
49 (define %installer-mirrors
51 ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58
52 ;; Matthew Flatt says: "note that many are commented out"
53 ;; INVARIANT: End with a trailing "/"!
54 '("https://mirror.racket-lang.org/installers/"
55 "https://www.cs.utah.edu/plt/installers/"
56 "https://plt.cs.northwestern.edu/racket-mirror/"
57 "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/"
58 ;; Universität Tübingen is using a self-signed HTTPS certificate:
59 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
60 "https://racket.infogroep.be/"
64 (define-public racket-minimal
66 (name "racket-minimal")
67 (version "8.1") ; note: remember to also update racket!
71 (uri (map (lambda (base)
72 (string-append base version "/racket-minimal-src.tgz"))
74 (sha256 "04zzqybpxss50n1jrwwq98539gw0y0ygpw9civl2sq3s4ww7m8l3")
75 (patches (search-patches
76 "racket-sh-via-rktio.patch"))))
77 (home-page "https://racket-lang.org")
78 (synopsis "Racket without bundled packages such as DrRacket")
80 `(("openssl" ,openssl)
84 ("zlib:static" ,zlib "static")
86 ("lz4:static" ,lz4 "static")))
87 (build-system gnu-build-system)
90 `(,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH="
91 (assoc-ref %build-inputs "sh")
96 ((guix build gnu-build-system)
100 (modify-phases %standard-phases
101 (add-before 'configure 'pre-configure-minimal
102 (lambda* (#:key inputs #:allow-other-keys)
105 (add-after 'build 'patch-config.rktd-lib-search-dirs
106 (lambda* (#:key inputs outputs #:allow-other-keys)
107 ;; We do this between the `build` and `install` phases
108 ;; so that we have racket to read and write the hash table,
109 ;; but it comes before `raco setup`, when foreign libraries
110 ;; are needed to build the documentation.
111 (define out (assoc-ref outputs "out"))
119 (current-command-line-arguments)))
121 (extra-lib-search-dirs (cdr args)))
127 (append dirs extra-lib-search-dirs))
129 #:exists 'truncate/replace
133 (filter-map (lambda (lib)
135 ((assoc-ref inputs lib)
137 (string-append pth "/lib")))
157 ;; Tests are in packages like racket-test-core and
158 ;; main-distribution-test that aren't part of the main distribution.
161 "Racket is a general-purpose programming language in the Scheme family,
162 with a large set of libraries and a compiler based on Chez Scheme. Racket is
163 also a platform for language-oriented programming, from small domain-specific
164 languages to complete language implementations.
166 The ``minimal Racket'' distribution includes just enough of Racket for you to
167 use @command{raco pkg} to install more. Bundled packages, such as the
168 DrRacket IDE, are not included.")
169 ;; https://download.racket-lang.org/license.html
170 (license (list lgpl3+ asl2.0 expat))))
173 (define-public racket
175 (inherit racket-minimal)
177 (version (package-version racket-minimal)) ; needed for origin uri to work
180 (inherit (package-source racket-minimal))
181 (uri (map (lambda (base)
182 (string-append base version "/racket-src.tgz"))
186 "0xdqwrwm604bbnr97h75dps2ixxz2svlw0fn0f674bn04dcfd60f"))))
188 `(;; sqlite and libraries for `racket/draw' are needed to build the doc.
190 ("fontconfig" ,fontconfig)
194 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
195 ("libjpeg" ,libjpeg-turbo)
201 ("unixodbc" ,unixodbc)
203 ,@(package-inputs racket-minimal)))
204 (synopsis "A programmable programming language in the Scheme family")
206 "Racket is a general-purpose programming language in the Scheme family,
207 with a large set of libraries and a compiler based on Chez Scheme. Racket is
208 also a platform for language-oriented programming, from small domain-specific
209 languages to complete language implementations.
211 The main Racket distribution comes with many bundled packages, including the
212 DrRacket IDE, libraries for GUI and web programming, and implementations of
213 languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))