From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 UDbMFti1DmLhvQAAgWs5BA (envelope-from ) for ; Thu, 17 Feb 2022 21:53:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kGjGE9i1DmLwTgAAauVa8A (envelope-from ) for ; Thu, 17 Feb 2022 21:53:44 +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 E97443E483 for ; Thu, 17 Feb 2022 21:53:43 +0100 (CET) Received: from localhost ([::1]:36598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKnmZ-0007JI-5p for larch@yhetil.org; Thu, 17 Feb 2022 15:53:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKnlu-0006ih-N7 for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKnlu-0001cj-BF for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKnlu-0003Zk-Aw for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v2 07/15] gnu: Add chez-nanopass. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Feb 2022 20:53: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 Cc: Philip McGrath , zimoun , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164513112613565 (code B ref 53878); Thu, 17 Feb 2022 20:53:02 +0000 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:06 +0000 Received: from localhost ([127.0.0.1]:52779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnl0-0003We-7o for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:06 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:43698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnku-0003Ux-U9 for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:01 -0500 Received: by mail-qk1-f182.google.com with SMTP id z66so193634qke.10 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:00 -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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=VZUWLcmh90wWzcu/fh/Me74DacccZt1nEAGbTLFNQk0Jx1O2BPuCWdCdYrN2Jeta+f GP9ObkBYIunqeTj8G5YzlVpj8pFn9O0ihmt19cdhDYC/yu3WtaX7kCFyFGgn2ZtJ9knL 4OPZ08UuNgfLuw7+ZpDMYVNKMxZJE4YTXMdczvsZ0i9M6g+bbjV+3/tXFv4PSQoq0/JI gsDs1rTW/ZFjSYKSRhXnI5TV7vNylfKVIxjkcag5BvS4hFhl3zItt9UQSzO9gRH+BDBk m2Bc+XZMxAvQMgpY15eZrSYFzcxRkHuWxoIZ86uBCvydL0ejQMNfvMH4akMOo7LsQ6h1 NnbA== 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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=OFIGJE9ySIOSMlfi/nq3eUJK9Os1JRdnj/AYhovQGeOLq9rrYC3ntDuAEDBqxWPLSZ ZaDaOSihPUwvGjFJ3VbRDmtQq7d3bhMEofQ3JzeqCn+6e8lBPvUiL+0sYqIpq9ygUKSL E/kdWJEvMwm6FRXkUX35ejNA+RZN3VFfEdaCbCEnnpfRA40qwUyBnLe5TZB6wpI3i5lU NkXu5Xif+jLFBA4AjInIGvsTTzgIoAtki3lNXhERQWN3k7oCTIV1x6UN8Vbe75yblg2R WZ5NVqFSZfn4TWtNnIov4/be3NJMxboYIS3z7VYGDpi436ZxnpiNMSAOiPyX6G1T1PMY GQow== X-Gm-Message-State: AOAM532LbLCeqqxFjkrtUcI3CU4DZIKSSbtPuLHZBybaZxHZpvB7rARO XfJ0+N+N5XbL1N0CmA6XIVBDblv9jQbv3OnE2TI= X-Google-Smtp-Source: ABdhPJyTQ8TTUYYU4hZRa4DSJbNU7KZzmb11TxM0puqLnSJeDZHEaHcw2xwvJyVCM8JayMOpXm1GMg== X-Received: by 2002:a37:a7d7:0:b0:5f1:9141:9c0c with SMTP id q206-20020a37a7d7000000b005f191419c0cmr2722540qke.783.1645131115323; Thu, 17 Feb 2022 12:51: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 p15sm24460629qtk.56.2022.02.17.12.51.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:55 -0800 (PST) From: Philip McGrath Date: Thu, 17 Feb 2022 15:50:40 -0500 Message-Id: <20220217205048.967383-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-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=1645131224; 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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=ZBQZ5AnnRUagI8UDI/UneWo4258y1vgdw/83XIY5D/aH4nP+0rP6mauVZmoiYN7/lTnKnx /PxEH/+ES5iJSp/ecFNMcz2R87UAGcaC4fAG4IQLWPLAC4Txm+iKfn3lc1TaM30pWOpnLu +XJ5SSty8EpEdUolrzbQQHUpNSy/ZfieS6sKe4YPdJWOjH7hkG8RRW6VroXNbImWMwndcL 9qQWisSILXVmhaWNsz3SHpFmyYhncjOG0cKqvnRojcgQwTkVg/U1fXAP20nV30GySNEFYP 37eQkSkbgEskkOTwhnsceRtTOPcBEYBsXK6OK76Q3Wm42XHhztZvF4eP7iYbSw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645131224; a=rsa-sha256; cv=none; b=K1Kbc1XcMpqM3kUaEYRFhKjy6l0q77iGXFeg+GfmGj7ra3TB74P3rYw2EeVMEY9PL3oODv Tf+pj6/Wy9LauTA4TB3xvxsOz/RmmUF97i+HDtLTVfV9fyoliv/wn+VuHbVvkhnpWGayeZ q38SyVZ+7i44Nie8BAP0CEKn7VyN00WVDRsWWWcUNyopfUPd50vZob5h+C1S8jSgLuGfrV o66ZhP0FjBAvaUt/IhoRNirMcBqrq/r9bSoU7uPyks02lD/J2nKDurQu1/OC/k8WHYp4qB azAiRkfBJpTY1U/6io3KeUUNwDYPhX7ZFVhBhBbx64dloNUR7TJksGQBKRxwUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=VZUWLcmh; 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: 0.87 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=VZUWLcmh; 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: E97443E483 X-Spam-Score: 0.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: zmAC+2Rezt31 * gnu/packages/chez-and-racket-bootstrap.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex'. (chez-nanopass): New variable. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Adapt accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 96 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 83bf15b5fb..d66955d50d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -207,9 +207,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -228,10 +226,12 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (copy-recursively + (dirname (search-input-file (or native-inputs inputs) + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) (mkdir-p "stex") (with-output-to-file "stex/Mf-stex" (lambda () @@ -454,12 +454,76 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license license:expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d8338bcd6f..e8d016c07b 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -334,7 +334,7 @@ (define-public racket-bootstrap-chez-bootfiles racket-minimal racket-minimal-bc-3m)) ("stex" ,(package-source stex)) - ("nanopass" ,nanopass))) + ("nanopass" ,(package-source chez-nanopass)))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0