From patchwork Sat Feb 26 13:02:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 37465 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 723ED27BBEA; Sat, 26 Feb 2022 13:04:54 +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,URIBL_BLOCKED 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 D793327BBE9 for ; Sat, 26 Feb 2022 13:04:53 +0000 (GMT) Received: from localhost ([::1]:51790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNwkm-0007ql-VZ for patchwork@mira.cbaines.net; Sat, 26 Feb 2022 08:04:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNwk4-00070A-1G for guix-patches@gnu.org; Sat, 26 Feb 2022 08:04:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNwk3-0003Bf-MH for guix-patches@gnu.org; Sat, 26 Feb 2022 08:04:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNwk3-0005Y6-HU; Sat, 26 Feb 2022 08:04:07 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v5 08/22] gnu: make-installation-layer.rkt: Adjust indentation. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sat, 26 Feb 2022 13:04:07 +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: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom , philip@philipmcgrath.com X-Debbugs-Original-Xcc: philip@philipmcgrath.com Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164588062521161 (code B ref 53878); Sat, 26 Feb 2022 13:04:07 +0000 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:45 +0000 Received: from localhost ([127.0.0.1]:54440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjg-0005V9-SH for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:45 -0500 Received: from mail-qk1-f173.google.com ([209.85.222.173]:36470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjW-0005Tu-P8 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:35 -0500 Received: by mail-qk1-f173.google.com with SMTP id g24so6816189qkl.3 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:34 -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=/ykUrrV+AsCKmY04Y1T+UOzhOPgVKEdMra2E59t4oOE=; b=cLPXlDM0l3/IqWaJw+2eRR7UFnVGiMFvKXCEIVAgOpQrg3Lk5/NBEimKV+hFoSIE/R foQAHo1RLia23ER/mMWRwPBvNy76x4TKRQ5UdsmPUnIZUGLhO+GBW5cN6cwaEitrA2Fc 1BrFjI4sG2INpgHVddMfBVfafSvRSE1JGMx5BdoU3GderbkyfOO+BZhPUb1N6Kb9d3kT W6yvB1+T1OY6Mtyf7X2mHL2qM3JQFSKHwkMuY0o8KJzf5bsvuSmjvKBpM4YlBwpMaXRc cAkyC9J9eMEO10wIPHOfF12CEN3SKGu2fW9la8j6CuPnW27RG3bo5g9Nt8dho/1NUs+2 BnAw== 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=/ykUrrV+AsCKmY04Y1T+UOzhOPgVKEdMra2E59t4oOE=; b=2JDoxyhIR1wNzxfFRhL5OIvnymHBKgqJUDtI5wpfxGvvXpB2xVHG6DnibqQXiZGcBV OMs8q39OdOj3z+Iu5shm79nxSaNePW1UbSliaQ6eF7CfM0bkykIn5pN94UR6wPLQMbwO xOFKI+kEk6G0IzfNw8ruUCHT/YAbnQl2wgPTBX0zXkAB4CrgKpoAbC0zi1bLiS5Det/c DuhV1Rui0HRgI7Vugrrovhil6BLrw67jezCBunn+uDCwzQpkmLHZq/NhNCuos9MDpmsC Ftgb4xJbrMrMb6ps0zN9QJyTZ9VoooGpqf5TKkM6eb77F4dVG99wJcVAFoRAQTInX/gU +ltQ== X-Gm-Message-State: AOAM530MpC8CBB5IBytgz35KzDc29Z8flb4S+0Bhxq9bKpSm/FOxgSWK 8n9LM/nUk6xZQGiffXgWC6ag6W8KFXf7O45Dq7Q= X-Google-Smtp-Source: ABdhPJw5/2uHWe75rTO1+jKaBk1VENublSO6BiNzkhyU8tl6buhmiqRGE6qi38BklG8DTnE06M3Ptg== X-Received: by 2002:a37:5503:0:b0:4e1:2b66:dc53 with SMTP id j3-20020a375503000000b004e12b66dc53mr7102819qkb.706.1645880609197; Sat, 26 Feb 2022 05:03:29 -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 r14-20020a05622a034e00b002de72634a7asm3197129qtw.37.2022.02.26.05.03.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:29 -0800 (PST) From: Philip McGrath Date: Sat, 26 Feb 2022 08:02:40 -0500 Message-Id: <20220226130254.1301333-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220226130254.1301333-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-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 (make-installation-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 ddbeb68a37..1670f478ff 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -1358,84 +1358,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"] - ;; workaroung 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"] + ;; workaroung 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)))))))