From patchwork Sun Feb 27 02:34:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 37495 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 D0EB727BBEA; Sun, 27 Feb 2022 02:39:15 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_FMBLA_NEWDOM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable 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 EF13327BBEB for ; Sun, 27 Feb 2022 02:39:13 +0000 (GMT) Received: from localhost ([::1]:39312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nO9Sr-0006pP-3T for patchwork@mira.cbaines.net; Sat, 26 Feb 2022 21:39:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nO9Sh-0006oe-6C for guix-patches@gnu.org; Sat, 26 Feb 2022 21:39:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nO9Sg-0006Tx-U5 for guix-patches@gnu.org; Sat, 26 Feb 2022 21:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nO9Sg-0004IK-Pk for guix-patches@gnu.org; Sat, 26 Feb 2022 21:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v6 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 02:39: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.164592948416280 (code B ref 53878); Sun, 27 Feb 2022 02:39:02 +0000 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:04 +0000 Received: from localhost ([127.0.0.1]:56554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rj-0004EL-Jl for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:04 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:36570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rh-0004DY-DL for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:01 -0500 Received: by mail-qt1-f175.google.com with SMTP id f18so6101400qtb.3 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:01 -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=O2S2PRHkG8IvVGmB0WnxootYPk4QM0bZwqLu/W8JFKU=; b=TzbthcmPb90eB0ZhJn/q3d/08+LiNd2zrMPuMO6gvfWeku66LpUP7u93gAO6zo7/0n XFBGFCRp+fVedF27sU0e+/dFrZeAeD2ERbFXfrOZ3b0Flhc/ivX1tdm2eU1U1K36BS8W 0huQKByDpEJeUkZ2E58LRiOAR92xtXEpY21c+3EBrJYs1foTzpT7r+szlZ9YjuoUvASL WZKV2u391ap6T7Xnuoka9IjVhNd6kkpP7TqaFqwKJJPxAX+KMFKz8i6oAZzhI+AuHbnI kYZgZqhHmNBfxe0AWICcDzU+2g2GLXEfxiXgmvq9Iqhw454/f2ZGtEG4lTvhOjYBi06j 3abQ== 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=O2S2PRHkG8IvVGmB0WnxootYPk4QM0bZwqLu/W8JFKU=; b=yV44kY2n5ZOpfigIpkQjzLkeRF1d/gHWp3uVvL+6x0hSLrHbXyVZD8Q31H7+tSLXa+ cHUcDkxEJAk9qXXZuHHZ2PRGs+GETGllsrSVNiE7zDdcKVS8HGrqYyqFWV7ez7u2HVd3 bBT/ZHM09up7MENcgwscaNV/UmB6MH8oDemyL4/P9wXfA3akqVVEuzZSf3ADFO1U4XXf KJCRfd7YVjs2tLcZWPBBnaj1mLbjlA9B3z40FO9rM5fMIeXCwyIg4C7/oP+NdsFZbOjP MFfdfEFtyr2BNGw1WBRWyoM3PQehbfQyMqqmLxAV1HyEt3O2kuxdf2aCD+7wHv7s7aPP baig== X-Gm-Message-State: AOAM53000MbeP9NedrHNeL4ICt8vLtcRlgUOwQNu9Nw/4OA17yaLrSHx mZpHaJR9TIfB922T9/p1vCyFxowk83kFlOdnqps= X-Google-Smtp-Source: ABdhPJyGSmvg9wjU/pOR6Kt5I0WdpOxWWAc/Yami+ewkE2PQYN/r+Sv1uxYtKSllsOxpjb5D+gYs7g== X-Received: by 2002:ac8:4e43:0:b0:2df:f8d1:64b3 with SMTP id e3-20020ac84e43000000b002dff8d164b3mr3057230qtw.209.1645929475789; Sat, 26 Feb 2022 18:37:55 -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 e8-20020ac85dc8000000b002de409f360fsm4317833qtx.76.2022.02.26.18.37.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:55 -0800 (PST) From: Philip McGrath Date: Sat, 26 Feb 2022 21:34:35 -0500 Message-Id: <20220227023450.1877215-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-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 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)))))))