gnu: gerbil: Use G-expressions.

* gnu/packages/scheme.scm (gerbil)[source, arguments]: Reindent.
[arguments]: Rewrite using G-expressions. Do not return #t from custom
phases. Use #:tests? instead of deleting the check phase.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Juliana Sims 2023-03-28 23:05:15 -04:00 committed by Maxim Cournoyer
parent 5cf4448b5d
commit a9b63e2be1
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -1115,101 +1115,99 @@ (define-public gerbil
(package (package
(name "gerbil") (name "gerbil")
(version "0.17.0") (version "0.17.0")
(source (source (origin
(origin (method git-fetch)
(method git-fetch) (uri (git-reference
(uri (git-reference (url "https://github.com/vyzo/gerbil")
(url "https://github.com/vyzo/gerbil") (commit (string-append "v" version))))
(commit (string-append "v" version)))) (file-name (git-file-name name version))
(file-name (git-file-name name version)) (sha256
(sha256 (base32
(base32 "0c0nspm659ybgmqlppdv7sxzll4hwkvcp9qmcsip6d0kz0p8r9c3")))) "0c0nspm659ybgmqlppdv7sxzll4hwkvcp9qmcsip6d0kz0p8r9c3"))))
(arguments (arguments
`(#:phases (list #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(delete 'bootstrap) (delete 'bootstrap)
(add-before 'configure 'chdir (add-before 'configure 'chdir
(lambda _ (lambda _
(chdir "src") (chdir "src")))
#t)) (replace 'configure
(replace 'configure (lambda _
(lambda* (#:key outputs inputs #:allow-other-keys) (invoke "chmod" "755" "-R" ".")
(invoke "chmod" "755" "-R" ".") ;; Otherwise fails when editing an r--r--r-- file.
;; Otherwise fails when editing an r--r--r-- file. (invoke "gsi-script"
(invoke "gsi-script" "configure" "configure"
"--prefix" (assoc-ref outputs "out") "--prefix"
"--with-gambit" (assoc-ref inputs "gambit-c")))) #$output
(add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs "--with-gambit"
(lambda _ #$gambit-c)))
;; Some .ss files refer to gxi using /usr/bin/env gxi (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs
;; and 'patch-generated-file-shebangs can't fix that (lambda _
;; because gxi has not been compiled yet. ;; Some .ss files refer to gxi using /usr/bin/env gxi
;; We know where gxi is going to end up so we ;; and 'patch-generated-file-shebangs can't fix that
;; Doctor Who our fix here before the problem ;; because gxi has not been compiled yet.
;; happens towards the end of the build.sh script. ;; We know where gxi is going to end up so we
(let ((abs-srcdir (getcwd))) ;; Doctor Who our fix here before the problem
(for-each ;; happens towards the end of the build.sh script.
(lambda (f) (let ((abs-srcdir (getcwd)))
(substitute* f (for-each (lambda (f)
(("#!/usr/bin/env gxi") (substitute* f
(string-append "#!" abs-srcdir "/../bin/gxi")))) (("#!/usr/bin/env gxi")
'("./gerbil/gxc" (string-append "#!" abs-srcdir
"./lang/build.ss" "/../bin/gxi"))))
"./misc/http-perf/build.ss" '("./gerbil/gxc" "./lang/build.ss"
"./misc/rpc-perf/build.ss" "./misc/http-perf/build.ss"
"./misc/scripts/docsnarf.ss" "./misc/rpc-perf/build.ss"
"./misc/scripts/docstub.ss" "./misc/scripts/docsnarf.ss"
"./misc/scripts/docsyms.ss" "./misc/scripts/docstub.ss"
"./r7rs-large/build.ss" "./misc/scripts/docsyms.ss"
"./release.ss" "./r7rs-large/build.ss"
"./std/build.ss" "./release.ss"
"./std/run-tests.ss" "./std/build.ss"
"./std/web/fastcgi-test.ss" "./std/run-tests.ss"
"./std/web/rack-test.ss" "./std/web/fastcgi-test.ss"
"./tools/build.ss" "./std/web/rack-test.ss"
"./tutorial/httpd/build.ss" "./tools/build.ss"
"./tutorial/kvstore/build.ss" "./tutorial/httpd/build.ss"
"./tutorial/lang/build.ss" "./tutorial/kvstore/build.ss"
"./tutorial/proxy/build-static.ss" "./tutorial/lang/build.ss"
"./tutorial/proxy/build.ss"))) "./tutorial/proxy/build-static.ss"
#t)) "./tutorial/proxy/build.ss")))))
(add-after 'configure 'create-gx-version.scm (add-after 'configure 'create-gx-version.scm
(lambda _ (lambda _
(with-output-to-file (string-append (with-output-to-file (string-append (getcwd)
(getcwd) "/gerbil/runtime/gx-version.scm")
"/gerbil/runtime/gx-version.scm") (lambda _
(lambda _ (write `(define (gerbil-version-string)
(write `(define (gerbil-version-string) ,(string-append "v"
,(string-append "v" ,(version-major+minor version)))))))) #$(version-major+minor
(replace version))))))))
'build (replace 'build
(lambda* (lambda _
(#:key inputs #:allow-other-keys) (setenv "HOME"
(setenv "HOME" (getcwd)) (getcwd))
(invoke (invoke
;; The build script needs a tty or it'll crash on an ioctl ;; 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. ;; trying to find the width of the terminal it's running on.
;; Calling in script prevents that. ;; Calling in script prevents that.
"script" "script"
"-qefc" "-qefc"
"./build.sh"))) "./build.sh")))
(delete 'check) (replace 'install
(replace 'install (lambda _
(lambda* (#:key outputs #:allow-other-keys) (let* ((bin (string-append #$output "/bin"))
(let* ((out (assoc-ref outputs "out")) (lib (string-append #$output "/lib")))
(bin (string-append out "/bin")) (mkdir-p bin)
(lib (string-append out "/lib"))) (mkdir-p lib)
(mkdir-p bin) (copy-recursively "../bin" bin)
(mkdir-p lib) (copy-recursively "../lib" lib)))))
(copy-recursively "../bin" bin) #:tests? #f))
(copy-recursively "../lib" lib))))))) (native-inputs (list coreutils gambit-c util-linux))
(native-inputs (propagated-inputs (list gambit-c openssl sqlite zlib))
(list coreutils gambit-c util-linux))
(propagated-inputs
(list gambit-c zlib openssl sqlite))
(build-system gnu-build-system) (build-system gnu-build-system)
(synopsis "Meta-dialect of Scheme with post-modern features") (synopsis "Meta-dialect of Scheme with post-modern features")
(description "Gerbil is an opinionated dialect of Scheme designed for Systems (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 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 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 tower with a native implementation of syntax-case. It also provides a full-blown module