From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eDFJJo2YEGJZlAAAgWs5BA (envelope-from ) for ; Sat, 19 Feb 2022 08:13:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ONSOI42YEGIDFAAA9RJhRA (envelope-from ) for ; Sat, 19 Feb 2022 08:13:17 +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 14BB01C269 for ; Sat, 19 Feb 2022 08:13:16 +0100 (CET) Received: from localhost ([::1]:54374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLJvf-0001pf-NS for larch@yhetil.org; Sat, 19 Feb 2022 02:13:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLJTT-00071T-3C for guix-patches@gnu.org; Sat, 19 Feb 2022 01:44:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLJTR-00082W-Uf for guix-patches@gnu.org; Sat, 19 Feb 2022 01:44:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLJTR-0004nd-T7 for guix-patches@gnu.org; Sat, 19 Feb 2022 01:44:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v3 07/15] gnu: Add chez-nanopass. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Feb 2022 06:44:05 +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 Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164525301618269 (code B ref 53878); Sat, 19 Feb 2022 06:44:05 +0000 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:36 +0000 Received: from localhost ([127.0.0.1]:56732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSx-0004kW-K5 for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:36 -0500 Received: from mail-qv1-f45.google.com ([209.85.219.45]:41586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSu-0004jn-P5 for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:33 -0500 Received: by mail-qv1-f45.google.com with SMTP id x3so19174541qvd.8 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:32 -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=QbBHSzf4hnZ6Jjrj/8rbponDQC/HIJs6ty7J+dhTRMkV7Y+mwg9UIExqIE6ViNUcJF GPpTK8Wn8yqIzOgg8NTISnzouXxhNm1z9X0rFBY0fnO5EunDg9GmiTk5RUws3NdPoE+7 4/PvQgfvF21/x8kvsYDThuOL2ZiDEyVk+fNTbYb2/50yL8T3SIytL2wURQOvrm01MTm8 oaMxo5vkq8te+pEx9CWSMRjnL5YYENtwoRNLOfuV5QgAZI2RRxyv2DE7CxdRP+ZcpnKH x7AbFxEOpNHcLQjBeXz0YNSXN26I2AZ7Jo4an+30n6dmrJBJRVe6oZM3FZusbzRBxiZO Th9Q== 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=HJ6dywr+I/kVfim6L9Bh0ZJ2eFCm4J72Se9iES648CN+dAG2mQjfAoM/Sqbk8wD40C SSUmSCJA+7uVA6WwR7LXfdOoKj7GTMYs5i888Jgef9ntwSbkE+H0iBBJlBI6Sd2g0Am8 nt2JdYtY5pE3cwHBojUam8dk6k10DmNfSo44NVBk2RAZ9qqXEUNd8gQCIFEdHXN43C1C WZfeFJNpXqwiWq/2z5jhoC4WJFVcsi3hKnlAUS0TNIRAlkVRmUB0PtInjXJ0m6CyTE/i M9k4c4etThZhtHMBgydXUlU6gng3jhpru+spWECwAH4DDdAqs7MMWvlkHFH0QDZO/q1j CO0Q== X-Gm-Message-State: AOAM531BWmGJseAD1UupjhXy4ldtr7delviN3BVDs03BdQuoITsmbRls mf5aUXl0bf4Povu1En0KqTiQLgls1Y1GhBFq2sA= X-Google-Smtp-Source: ABdhPJw13Bk3i6Toe7XuuVpAt0c2yIBWDbDStP6YwgED/R36PVK/tT15KcMSuE783reh9NcqPIiFww== X-Received: by 2002:a05:622a:5d2:b0:2dd:2d7b:db15 with SMTP id d18-20020a05622a05d200b002dd2d7bdb15mr9837872qtb.570.1645253007094; Fri, 18 Feb 2022 22:43:27 -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 d23sm5805725qka.50.2022.02.18.22.43.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:26 -0800 (PST) From: Philip McGrath Date: Sat, 19 Feb 2022 01:42:20 -0500 Message-Id: <20220219064228.246917-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-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=1645254797; 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=K+iv8xyGIW6bLNFJ+nptVH+37+ro7uEy5PPgfugM19Vit7EPVuWhNd+bC+b5QbNxlqgIIp e8ZHa1YJaqUzpvGp4h/C5nMeI4fdJozEOuCPg3Uh157Cb9qjKTNp9vjyEMJgDdq6P8AEK0 XvH5dFRvJVnRN2LIyzjIVJyJQR0KV0bpOQ4OHJGK/fOVK6AJ3et6/Xroh56ZzpOw8FO+13 zu61ZGOLbg/AAax26pq7GWRskcUKCAujUnlvHOlZxuLbNxlYqYTH2bURAQly9kRiufeU6Q yGhQZBx2nsGOm1Sdj9XRl/6QK+Tbq3yrUDmtceFb/jx83v+DvxntMcEKVsGUPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645254797; a=rsa-sha256; cv=none; b=ZEHVcdEy3Da0UYRx3EY6iNX8v1Amell5i6OpZEg5bq68oiCoLl64Q1ZG8yeLtJd9uZUs1+ QdeQR6De/8BSNI52+PV2fq0qYwrJm/mB+5emhzeBgCMVBiA5YwjvXpk5PjhVXKYvrZzcO4 AsC6PFuOmgH2kPwwGXkGdUQnIOQgYsnP78pIQ6n1oKZ7HjZLdbZACc+AkBtJ4QmhgQOtzd CHJfjSx+2fqJggJEub6TYgZqf9GhTe+5aiP/dMxa7xk00Mf8MNJ0JIvjY6ROG7yZGcNx+u 8gMWmD56KIr6GXrGPGZMRLJs/oJZJ5AmaAdfwLMTejCal1A3m4nYIoHtXya2pQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=QbBHSzf4; 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.37 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=QbBHSzf4; 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: 14BB01C269 X-Spam-Score: 0.37 X-Migadu-Scanner: scn0.migadu.com X-TUID: SZWl2rczNheC * 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