From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IG/NEXclGmKnTAAAgWs5BA (envelope-from ) for ; Sat, 26 Feb 2022 14:04:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aHSMCnclGmLeXQAAG6o9tA (envelope-from ) for ; Sat, 26 Feb 2022 14:04:55 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AF0703F570 for ; Sat, 26 Feb 2022 14:04:54 +0100 (CET) Received: from localhost ([::1]:51790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNwkn-0007ql-RZ for larch@yhetil.org; Sat, 26 Feb 2022 08:04:53 -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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645880694; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/ykUrrV+AsCKmY04Y1T+UOzhOPgVKEdMra2E59t4oOE=; b=NwOE+1PxJDiNqoK45UU9Xr8Gbx0c8hVkZwaSrUdW0Dw8/0LqWhuff0F7Zx2+OLuhTSavfb kf/kdcuL1NoRAxwbSI4nBiogPM+fX7YfBLWTLLT0/aWp5+gBQTvz5JiUgzdzGoZk31p6e5 xpkdKtR6vrvKElusOYZUOKzuB5xleEuYvWHL7fVu5WwkL8Q26NX8c7OQx+fjEcwVKXBIsS svR04Ch99rkYI6ebtY0eCtoZSmUELOwCzV90j4evkhmef7EMRd0MqTqwJOHS/ubf6RP8qa xAlGynTDOxpTG8EB31NZLsnb8U8lJAI/uquZYEzW1hnQIedEP2/YxkEZaWJTVg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645880694; a=rsa-sha256; cv=none; b=hc5QYDy9h+VhPG/lqS0dz+X2LE2n8v0RYCnVfbT2L1dnRSvdS2gVQ0j89nEzVQqRViaAtz R21S5JVV/3Fg9vGKYlBAc+UIhjslZ/cbXV0u+8A/ynoBDhAYURNOLe4lboGlfVbp70DRlz dTt8BvndzhPtg0joaeh/SrRjjU007/ALE7ceoYZ3u+1BYSsgwu2hzdfYeR7g1zCqUaHqLo mD4KzQsdlhBD8c3g3p0wVMwbHTjqSSZsBVrzACeZY+s/WZ5tLKDN3a7Q1NA+n0ZiTL5sOk IbDxieeOQikve5KdhCDdxWNZb20lmA7rqNnns9S6UFcdTf04D25hOyCbvGFz6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=cLPXlDM0; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.88 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=cLPXlDM0; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AF0703F570 X-Spam-Score: 2.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: sQyDZHoTf2xR * 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))))))) -- 2.32.0