all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 363f19825b9e7902154303a2c5a4fa05e798aa71 11403 bytes (raw)
name: gnu/packages/racket.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages racket)
  #:use-module ((guix licenses)
                #:select (asl2.0 expat lgpl3+))
  #:use-module (guix packages)
  #:use-module (guix base16)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (guix gexp)
  #:use-module (guix build-system gnu)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match)
  #:use-module (gnu packages)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages image)
  #:use-module (gnu packages libedit)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages xorg))

;; Commentary:
;;
;; Preliminary guidelines on naming things:
;;   - `racket` is the main package. It corresponds to `racket-minimal`
;;     with the Racket-level package "main-distribution" installed.
;;   - `racket-minimal` is Racket runtime system and core libraries:
;;     just enough to implement the package system and install the rest.
;;     Upstream refers to this as "minimal Racket".
;;   - `racket-pkg-` should probably be the prefix for Racket packages
;;     available as Guix packages, once we're able to build those.
;;     More specifically, it should correspond
;;     to packages registered in the catalog at https://pkgs.rackat-lang.org.
;;     This is a social convention to manage the namespace, not a technical
;;     limitation: Racket can use other catalogs (e.g. for pre-built packages
;;     or packages pinned to specific versions), unregistered package source
;;     urls, or purely local packages. But we also need a convention to
;;     manage the namespace, so we should use this one. In practice,
;;     all generally useful libre Racket packages are registered there.
;;     We probably will need a clever encoding scheme to deal with the fact
;;     that Racket package names can contain [A-Za-z_-], i.e. including "_",
;;     which is not allowed in Guix package names.
;;   - `racket-next` is a development version of `racket`, following either
;;     the upstrean Git HEAD or the release candidate, when one exists.
;;   - `racket-next-` is the prefix for other development packages,
;;     including `racket-next-minimal`. When we can build Racket packages
;;     individually, we will need `racket-next-pkg-` for the packages
;;     that make up `racket-next`.
;;
;; Code:


(define %installer-mirrors
  ;; Source:
  ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58
  ;; Matthew Flatt says: "note that many are commented out"
  ;; INVARIANT: End with a trailing "/"!
  '("https://mirror.racket-lang.org/installers/"
    "https://www.cs.utah.edu/plt/installers/"
    "https://plt.cs.northwestern.edu/racket-mirror/"
    "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/"
    ;; Universität Tübingen is using a self-signed HTTPS certificate:
    "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
    "https://racket.infogroep.be/"
    ))


(define-public racket-minimal
  (package
    (name "racket-minimal")
    (version "8.1")            ; note: remember to also update racket!
    (source
     (origin
       (method url-fetch)
       (uri (map (lambda (base)
                   (string-append base version "/racket-minimal-src.tgz"))
                 %installer-mirrors))
       (sha256 "04zzqybpxss50n1jrwwq98539gw0y0ygpw9civl2sq3s4ww7m8l3")
       (patches (search-patches
                 "racket-sh-via-rktio.patch"))))
    (home-page "https://racket-lang.org")
    (synopsis "Racket without bundled packages such as DrRacket")
    (inputs
     `(("openssl" ,openssl)
       ("sqlite" ,sqlite)
       ("sh" ,bash-minimal)
       ("zlib" ,zlib)
       ("zlib:static" ,zlib "static")
       ("lz4" ,lz4)
       ("lz4:static" ,lz4 "static")))
    (build-system gnu-build-system)
    (arguments
     `(#: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-before 'configure 'pre-configure-minimal
           (lambda* (#:key inputs #:allow-other-keys)
             (chdir "src")
             #t))
         (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))
                                  '(#f))
                                 #: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)))
       ;; Tests are in packages like racket-test-core and
       ;; main-distribution-test that aren't part of the main distribution.
       #:tests? #f))
    (description
     "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 ``minimal Racket'' distribution includes just enough of Racket for you to
use @command{raco pkg} to install more.  Bundled packages, such as the
DrRacket IDE, are not included.")
    ;; https://download.racket-lang.org/license.html
    (license (list lgpl3+ asl2.0 expat))))


(define-public racket
  (package
    (inherit racket-minimal)
    (name "racket")
    (version (package-version racket-minimal)) ; needed for origin uri to work
    (source
     (origin
       (inherit (package-source racket-minimal))
       (uri (map (lambda (base)
                   (string-append base version "/racket-src.tgz"))
                 %installer-mirrors))
       (sha256
        (base32
         "0xdqwrwm604bbnr97h75dps2ixxz2svlw0fn0f674bn04dcfd60f"))))
    (inputs
     `(;; sqlite and libraries for `racket/draw' are needed to build the doc.
       ("cairo" ,cairo)
       ("fontconfig" ,fontconfig)
       ("glib" ,glib)
       ("glu" ,glu)
       ("gmp" ,gmp)
       ("gtk+" ,gtk+)                   ; propagates gdk-pixbuf+svg
       ("libjpeg" ,libjpeg-turbo)
       ("libpng" ,libpng)
       ("libx11" ,libx11)
       ("mesa" ,mesa)
       ("mpfr" ,mpfr)
       ("pango" ,pango)
       ("unixodbc" ,unixodbc)
       ("libedit" ,libedit)
       ,@(package-inputs racket-minimal)))
    (synopsis "A programmable programming language in the Scheme family")
    (description
     "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, Algol 60, and Datalog.")))

(define %pre-release-installers
  "https://pre-release.racket-lang.org/installers/")

(define-public racket-next-minimal
  (package
    (inherit racket-minimal)
    (name "racket-next-minimal")
    (version "8.1.900")
    (source
     (origin
       (inherit (package-source racket-minimal))
       (sha256
        (base32
         "0dm849wvlaxpfgz2qmgy2kwdslyi515rxn1m1yff38lagbn21vxq"))
       (uri (string-append %pre-release-installers
                           "racket-minimal-src.tgz"))))))

(define-public racket-next
  (package
    (inherit racket)
    (name "racket-next")
    (version (package-version racket-next-minimal))
    (source
     (origin
       (inherit (package-source racket))
       (sha256
        (base32
         "0ysvzgm0lx4b1p4k9balvcbvh2kapbfx91c9ls80ba062cd8y5qv"))
       (uri (string-append %pre-release-installers
                           "racket-src.tgz"))))))

debug log:

solving 363f19825b ...
found 363f19825b in https://yhetil.org/guix/20210629215742.3112654-2-philip@philipmcgrath.com/
found d0cfed7292 in https://yhetil.org/guix/20210629215742.3112654-1-philip@philipmcgrath.com/
found 2d606071fe in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 2d606071fe026e9b268d20897bb0aa8b6be69bb5	gnu/packages/racket.scm

applying [1/2] https://yhetil.org/guix/20210629215742.3112654-1-philip@philipmcgrath.com/
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 2d606071fe..d0cfed7292 100644


applying [2/2] https://yhetil.org/guix/20210629215742.3112654-2-philip@philipmcgrath.com/
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index d0cfed7292..363f19825b 100644

Checking patch gnu/packages/racket.scm...
Applied patch gnu/packages/racket.scm cleanly.
Checking patch gnu/packages/racket.scm...
Applied patch gnu/packages/racket.scm cleanly.

index at:
100644 363f19825b9e7902154303a2c5a4fa05e798aa71	gnu/packages/racket.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.