gnu: Add python-pyshp.
[jackhill/guix/guix.git] / gnu / packages / racket.scm
index 925a639..2d60607 100644 (file)
@@ -32,8 +32,6 @@
   #:use-module (ice-9 match)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
-  #:use-module ((gnu packages chez)
-                #:select (chez-scheme))
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xorg))
 
-(define-public racket
+
+(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")
-    (version "8.0")            ; note: remember to also update racket-minimal!
-    (source (origin
-              (method url-fetch)
-              (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-src.tgz")))
-              (sha256
-               (base32
-                "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"))))
+    (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
         (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)
              (chdir "src")
                                   "unixodbc"
                                   "libedit")))
              #t)))
-       ;; XXX: how to run them?
+       ;; 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.
-       ("sh" ,bash-minimal)
-       ("zlib" ,zlib)
-       ("zlib:static" ,zlib "static")
-       ("lz4" ,lz4)
-       ("lz4:static" ,lz4 "static")
        ("cairo" ,cairo)
        ("fontconfig" ,fontconfig)
        ("glib" ,glib)
        ("libx11" ,libx11)
        ("mesa" ,mesa)
        ("mpfr" ,mpfr)
-       ("openssl" ,openssl)
        ("pango" ,pango)
-       ("sqlite" ,sqlite)
        ("unixodbc" ,unixodbc)
-       ("libedit" ,libedit)))
-    (home-page "https://racket-lang.org")
+       ("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,
@@ -203,40 +210,4 @@ 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.")
-    ;; https://download.racket-lang.org/license.html
-    (license (list lgpl3+ asl2.0 expat))))
-
-(define-public racket-minimal
-  (package
-    (inherit racket)
-    (name "racket-minimal")
-    (version (package-version racket))
-    (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 DrRacket")
-    (inputs
-     `(("openssl" ,openssl)
-       ("sqlite" ,sqlite)
-       ("sh" ,bash-minimal)
-       ("zlib" ,zlib)
-       ("zlib:static" ,zlib "static")
-       ("lz4" ,lz4)
-       ("lz4:static" ,lz4 "static")))
-    (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.")))
+languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))