From patchwork Sun Feb 27 21:29:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 37537 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F1EA327BBEB; Sun, 27 Feb 2022 21:32:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5CF6627BBEA for ; Sun, 27 Feb 2022 21:32:27 +0000 (GMT) Received: from localhost ([::1]:59270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOR9W-0000Vq-De for patchwork@mira.cbaines.net; Sun, 27 Feb 2022 16:32:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOR99-0000Vc-1F for guix-patches@gnu.org; Sun, 27 Feb 2022 16:32:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOR98-0005ej-P6 for guix-patches@gnu.org; Sun, 27 Feb 2022 16:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOR98-0008HQ-La for guix-patches@gnu.org; Sun, 27 Feb 2022 16:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v7 09/24] gnu: configure-layer.rkt: Adjust indentation. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Cc: Philip McGrath , Ludovic =?utf-8?q?Court=C3=A8?= =?utf-8?q?s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164599747031698 (code B ref 53878); Sun, 27 Feb 2022 21:32:02 +0000 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:10 +0000 Received: from localhost ([127.0.0.1]:59354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8H-0008F3-NR for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:10 -0500 Received: from mail-ua1-f48.google.com ([209.85.222.48]:36505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7u-0008Ch-5o for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:46 -0500 Received: by mail-ua1-f48.google.com with SMTP id t25so5115051uaa.3 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PutN4x7jn6ODMb7ESFDxkatnHChHdH/PL2YoIfBEHJk=; b=YnS7e0SOeJ+O+8baFRg7g1XaHQmczNeyJWouiE4NittF04DjwcDIVYyNpUDVIbDJf6 vihqlJKD8WrpCQIRcc18SBSglxV+V9w4ybVqsXEKWKGkNcVfp60VSmgwF47xBjaUikUh jidJJSxXfvD6oiekp61rtsoniEk0hvUPI1odsJe45aEqWeiyJyUrHvpjVznetZOMrq+S Zt3Og4L3TUfjSu32rqAMcz1sK7urW9GeiDArTwI4l1nWDNlW4oTI3BMzgaciqGNqscC5 WfAeS6eFb52ndXGvLeqMlBpUThgNb9MTJCtvPiGuCL07L3W80a2xt7c3d60X1CuvFhZf 0ZBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PutN4x7jn6ODMb7ESFDxkatnHChHdH/PL2YoIfBEHJk=; b=lKedBHTbAYbh5fX2jARs7ZAlav+RctPDWuf5BbPCH0KpJWPT5DDl8MjzhchW9TI+FX Vqvmk769uG0EL/vvMDAxGBlVujEDBoDereJTzZfrJd4iLt1/nKgLODhPaZsS1iGbsNlH u/NjOnPeg9pjEJrxDcLLdpMSLRRXoLeQcP16XlhM1ojvS2fM3aDwST1/687hs36+qSba GAXzOBmCHW52A9U975pN3TydouZGtEFarSgGT/IQYAWmpfcS67d9JxNrS1OrItbQ1qAs 6dtz1FellGF/RvZktmxXgOcags//C/G+a9QN6ANEjYAWmLWrYeBeJCIYEDWvkZbyOPpc +P6w== X-Gm-Message-State: AOAM5326tnpS8arycmw7zIJUGVV/FHZ75R2YzzZa+8fZaB8vBxdLinJ+ xNNB34RaA8ClVZlNLNjM33VZmf3eT9HZ/rHzZrk= X-Google-Smtp-Source: ABdhPJxpd9rpWpB8fqmjJEe/qCv4q0E0FvT+JcN0hGnEIZrjg2AI8VVQjUElsmPIf6Et/mXSxxlJ8w== X-Received: by 2002:ab0:30d6:0:b0:341:eb4f:d2d2 with SMTP id c22-20020ab030d6000000b00341eb4fd2d2mr7172073uam.103.1645997440592; Sun, 27 Feb 2022 13:30:40 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id b5-20020a1f1b05000000b0032597a7ba97sm1550366vkb.9.2022.02.27.13.30.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:40 -0800 (PST) From: Philip McGrath Date: Sun, 27 Feb 2022 16:29:05 -0500 Message-Id: <20220227212920.2009000-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 011577cc2e..3877837d38 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)))))))