[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#53878] [PATCH v6 09/24] gnu: configure-layer.rkt: Adjust indentatio
From: |
Philip McGrath |
Subject: |
[bug#53878] [PATCH v6 09/24] gnu: configure-layer.rkt: Adjust indentation. |
Date: |
Sat, 26 Feb 2022 21:34:35 -0500 |
* gnu/packages/racket.scm (configure-layer.rkt): Wrap 'command-line' in
'define-values' to reduce rightward drift.
---
gnu/packages/racket.scm | 164 ++++++++++++++++++++--------------------
1 file changed, 83 insertions(+), 81 deletions(-)
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 69c99f5764..4f5f0c1df2 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -926,84 +926,86 @@ (define rx:racket
;; Guile's reader doesn't support #rx"racket"
(regexp "racket"))
(define extra-foreign-lib-search-dirs '())
- (command-line
- #:once-each
- [("--extra-foreign-lib-search-dirs") dir-list
- "foreign library directories, as a list of strings in `read` syntax"
- (set! extra-foreign-lib-search-dirs
- (call-with-input-string dir-list read))]
- #:args (parent-layer prefix)
- (let* ([config
- (for/fold
- ([config (file->value (build-path parent-layer
- config-file-pth))])
- ([spec (in-list
- '((lib-dir lib-search-dirs "lib/racket")
- (share-dir share-search-dirs "share/racket")
- (links-file
- links-search-files
- "share/racket/links.rktd")
- (pkgs-dir pkgs-search-dirs "share/racket/pkgs")
- (bin-dir bin-search-dirs "bin")
- (man-dir man-search-dirs "share/man")
- (doc-dir doc-search-dirs "share/doc/racket")
- (include-dir
- include-search-dirs
- "include/racket")))])
- (match-define (list main-key search-key pth) spec)
- (hash-set*
- config
- main-key
- (build-path-string prefix pth)
- search-key
- (list* #f
- (hash-ref config
- main-key
- (build-path-string parent-layer pth))
- (filter values (hash-ref config search-key null)))))]
- [config
- (hash-update config
- 'lib-search-dirs
- (lambda (dirs)
- ;; add after other layers, but before older
- ;; foreign lib search directories
- (define-values [rkt old-foreign-dirs]
- (partition (lambda (pth)
- (or (not pth)
- (regexp-match? rx:racket pth)))
- dirs))
- (append rkt
- extra-foreign-lib-search-dirs
- old-foreign-dirs)))]
- [config
- (hash-set* config
- 'apps-dir
- (build-path-string prefix "share/applications")
- 'absolute-installation? #t
- ;; Let Guix coexist with other installation
- ;; methods without clobbering user-specific packages.
- ;; This could be set in various places, but doing
- ;; it here is convienient, at least until we support
- ;; cross-compilation.
- 'installation-name
- (string-append (version)
- "-guix"
- (match (system-type 'gc)
- ['cgc "-cgc"]
- ;; workaround Guile reader/printer:
- ['|3m| "-bc"]
- [_ ""])))]
- [bin-dir
- (hash-ref config 'bin-dir)]
- [config
- (hash-set* config
- 'config-tethered-apps-dir (hash-ref config 'apps-dir)
- 'config-tethered-console-bin-dir bin-dir
- 'config-tethered-gui-bin-dir bin-dir)]
- [new-config-pth
- (build-path prefix config-file-pth)])
- (make-parent-directory* new-config-pth)
- (call-with-output-file*
- new-config-pth
- (lambda (out)
- (pretty-write config out))))))))
+ (define-values [parent-layer prefix]
+ (command-line
+ #:once-each
+ [("--extra-foreign-lib-search-dirs") dir-list
+ "foreign library directories, as a list of strings in `read` syntax"
+ (set! extra-foreign-lib-search-dirs
+ (call-with-input-string dir-list read))]
+ #:args (parent-layer prefix)
+ (values parent-layer prefix)))
+ (let* ([config
+ (for/fold
+ ([config (file->value (build-path parent-layer
+ config-file-pth))])
+ ([spec (in-list
+ '((lib-dir lib-search-dirs "lib/racket")
+ (share-dir share-search-dirs "share/racket")
+ (links-file
+ links-search-files
+ "share/racket/links.rktd")
+ (pkgs-dir pkgs-search-dirs "share/racket/pkgs")
+ (bin-dir bin-search-dirs "bin")
+ (man-dir man-search-dirs "share/man")
+ (doc-dir doc-search-dirs "share/doc/racket")
+ (include-dir
+ include-search-dirs
+ "include/racket")))])
+ (match-define (list main-key search-key pth) spec)
+ (hash-set*
+ config
+ main-key
+ (build-path-string prefix pth)
+ search-key
+ (list* #f
+ (hash-ref config
+ main-key
+ (build-path-string parent-layer pth))
+ (filter values (hash-ref config search-key null)))))]
+ [config
+ (hash-update config
+ 'lib-search-dirs
+ (lambda (dirs)
+ ;; add after other layers, but before older
+ ;; foreign lib search directories
+ (define-values [rkt old-foreign-dirs]
+ (partition (lambda (pth)
+ (or (not pth)
+ (regexp-match? rx:racket pth)))
+ dirs))
+ (append rkt
+ extra-foreign-lib-search-dirs
+ old-foreign-dirs)))]
+ [config
+ (hash-set* config
+ 'apps-dir
+ (build-path-string prefix "share/applications")
+ 'absolute-installation? #t
+ ;; Let Guix coexist with other installation
+ ;; methods without clobbering user-specific packages.
+ ;; This could be set in various places, but doing
+ ;; it here is convienient, at least until we support
+ ;; cross-compilation.
+ 'installation-name
+ (string-append (version)
+ "-guix"
+ (match (system-type 'gc)
+ ['cgc "-cgc"]
+ ;; workaround Guile reader/printer:
+ ['|3m| "-bc"]
+ [_ ""])))]
+ [bin-dir
+ (hash-ref config 'bin-dir)]
+ [config
+ (hash-set* config
+ 'config-tethered-apps-dir (hash-ref config 'apps-dir)
+ 'config-tethered-console-bin-dir bin-dir
+ 'config-tethered-gui-bin-dir bin-dir)]
+ [new-config-pth
+ (build-path prefix config-file-pth)])
+ (make-parent-directory* new-config-pth)
+ (call-with-output-file*
+ new-config-pth
+ (lambda (out)
+ (pretty-write config out)))))))
--
2.32.0
- [bug#53878] [PATCH v6 00/24] Update Racket to 8.4. Adjust Chez Scheme packages., (continued)
- [bug#53878] [PATCH v6 00/24] Update Racket to 8.4. Adjust Chez Scheme packages., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 04/24] gnu: racket-minimal: Use new package style., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 05/24] gnu: racket-minimal: Don't configure non-existant catalogs., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 06/24] gnu: racket-minimal: Change inheritance to follow bootstrapping., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 08/24] gnu: racket-minimal: Add "debug" output., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 07/24] gnu: racket-minimal: Adjust indentation., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 09/24] gnu: configure-layer.rkt: Adjust indentation.,
Philip McGrath <=
- [bug#53878] [PATCH v6 10/24] gnu: racket-minimal: Separate from the Racket VM., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 11/24] gnu: racket: Move Chez bootfiles to (gnu packages chez)., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 12/24] gnu: chez: Add utilities for Chez machine types., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 13/24] gnu: racket: Add 'racket-vm-for-system'., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 15/24] gnu: chez-scheme: Use "lib/chez-scheme" for search path., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 15/24] gnu: chez-scheme: Use "lib/chez-scheme" for search path., Liliana Marie Prikler, 2022/02/27
- [bug#53878] [PATCH v6 14/24] gnu: chez-scheme: Use new style for Chez packages., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 16/24] gnu: chez-scheme: Use shared zlib and lz4., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 17/24] gnu: chez-scheme: Use new package style., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 20/24] gnu: chez-scheme: Explicitly package bootstrap bootfiles., Philip McGrath, 2022/02/26