me
/
guix
Archived
1
0
Fork 0

gnu: configure-layer.rkt: Adjust indentation.

* gnu/packages/racket.scm (configure-layer.rkt): Wrap 'command-line' in
'define-values' to reduce rightward drift.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
master
Philip McGrath 2022-02-27 16:29:05 -05:00 committed by Liliana Marie Prikler
parent 049a27d8a8
commit f6cd4279a0
No known key found for this signature in database
GPG Key ID: 442A84B8C70E2F87
1 changed files with 83 additions and 81 deletions

View File

@ -927,84 +927,86 @@ languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")
;; Guile's reader doesn't support #rx"racket" ;; Guile's reader doesn't support #rx"racket"
(regexp "racket")) (regexp "racket"))
(define extra-foreign-lib-search-dirs '()) (define extra-foreign-lib-search-dirs '())
(command-line (define-values [parent-layer prefix]
#:once-each (command-line
[("--extra-foreign-lib-search-dirs") dir-list #:once-each
"foreign library directories, as a list of strings in `read` syntax" [("--extra-foreign-lib-search-dirs") dir-list
(set! extra-foreign-lib-search-dirs "foreign library directories, as a list of strings in `read` syntax"
(call-with-input-string dir-list read))] (set! extra-foreign-lib-search-dirs
#:args (parent-layer prefix) (call-with-input-string dir-list read))]
(let* ([config #:args (parent-layer prefix)
(for/fold (values parent-layer prefix)))
([config (file->value (build-path parent-layer (let* ([config
config-file-pth))]) (for/fold
([spec (in-list ([config (file->value (build-path parent-layer
'((lib-dir lib-search-dirs "lib/racket") config-file-pth))])
(share-dir share-search-dirs "share/racket") ([spec (in-list
(links-file '((lib-dir lib-search-dirs "lib/racket")
links-search-files (share-dir share-search-dirs "share/racket")
"share/racket/links.rktd") (links-file
(pkgs-dir pkgs-search-dirs "share/racket/pkgs") links-search-files
(bin-dir bin-search-dirs "bin") "share/racket/links.rktd")
(man-dir man-search-dirs "share/man") (pkgs-dir pkgs-search-dirs "share/racket/pkgs")
(doc-dir doc-search-dirs "share/doc/racket") (bin-dir bin-search-dirs "bin")
(include-dir (man-dir man-search-dirs "share/man")
include-search-dirs (doc-dir doc-search-dirs "share/doc/racket")
"include/racket")))]) (include-dir
(match-define (list main-key search-key pth) spec) include-search-dirs
(hash-set* "include/racket")))])
config (match-define (list main-key search-key pth) spec)
main-key (hash-set*
(build-path-string prefix pth) config
search-key main-key
(list* #f (build-path-string prefix pth)
(hash-ref config search-key
main-key (list* #f
(build-path-string parent-layer pth)) (hash-ref config
(filter values (hash-ref config search-key null)))))] main-key
[config (build-path-string parent-layer pth))
(hash-update config (filter values (hash-ref config search-key null)))))]
'lib-search-dirs [config
(lambda (dirs) (hash-update config
;; add after other layers, but before older 'lib-search-dirs
;; foreign lib search directories (lambda (dirs)
(define-values [rkt old-foreign-dirs] ;; add after other layers, but before older
(partition (lambda (pth) ;; foreign lib search directories
(or (not pth) (define-values [rkt old-foreign-dirs]
(regexp-match? rx:racket pth))) (partition (lambda (pth)
dirs)) (or (not pth)
(append rkt (regexp-match? rx:racket pth)))
extra-foreign-lib-search-dirs dirs))
old-foreign-dirs)))] (append rkt
[config extra-foreign-lib-search-dirs
(hash-set* config old-foreign-dirs)))]
'apps-dir [config
(build-path-string prefix "share/applications") (hash-set* config
'absolute-installation? #t 'apps-dir
;; Let Guix coexist with other installation (build-path-string prefix "share/applications")
;; methods without clobbering user-specific packages. 'absolute-installation? #t
;; This could be set in various places, but doing ;; Let Guix coexist with other installation
;; it here is convienient, at least until we support ;; methods without clobbering user-specific packages.
;; cross-compilation. ;; This could be set in various places, but doing
'installation-name ;; it here is convienient, at least until we support
(string-append (version) ;; cross-compilation.
"-guix" 'installation-name
(match (system-type 'gc) (string-append (version)
['cgc "-cgc"] "-guix"
;; workaround Guile reader/printer: (match (system-type 'gc)
['|3m| "-bc"] ['cgc "-cgc"]
[_ ""])))] ;; workaround Guile reader/printer:
[bin-dir ['|3m| "-bc"]
(hash-ref config 'bin-dir)] [_ ""])))]
[config [bin-dir
(hash-set* config (hash-ref config 'bin-dir)]
'config-tethered-apps-dir (hash-ref config 'apps-dir) [config
'config-tethered-console-bin-dir bin-dir (hash-set* config
'config-tethered-gui-bin-dir bin-dir)] 'config-tethered-apps-dir (hash-ref config 'apps-dir)
[new-config-pth 'config-tethered-console-bin-dir bin-dir
(build-path prefix config-file-pth)]) 'config-tethered-gui-bin-dir bin-dir)]
(make-parent-directory* new-config-pth) [new-config-pth
(call-with-output-file* (build-path prefix config-file-pth)])
new-config-pth (make-parent-directory* new-config-pth)
(lambda (out) (call-with-output-file*
(pretty-write config out)))))))) new-config-pth
(lambda (out)
(pretty-write config out)))))))