From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 8M/HE9mnAmIaOwEAgWs5BA (envelope-from ) for ; Tue, 08 Feb 2022 18:26:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QIuIENmnAmK59wAAauVa8A (envelope-from ) for ; Tue, 08 Feb 2022 18:26:49 +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 858DF24A26 for ; Tue, 8 Feb 2022 18:26:48 +0100 (CET) Received: from localhost ([::1]:60648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHUGN-0001xZ-L6 for larch@yhetil.org; Tue, 08 Feb 2022 12:26:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHSIr-00063Q-3d for guix-patches@gnu.org; Tue, 08 Feb 2022 10:21:16 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHSIi-0008Sh-H0 for guix-patches@gnu.org; Tue, 08 Feb 2022 10:21:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHSIi-0006tE-Dm for guix-patches@gnu.org; Tue, 08 Feb 2022 10:21:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [RFC PATCH 6/9] gnu: Add chez-nanopass. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Feb 2022 15:21:04 +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 Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164433361526315 (code B ref 53878); Tue, 08 Feb 2022 15:21:04 +0000 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:15 +0000 Received: from localhost ([127.0.0.1]:48339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHu-0006qM-92 for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:14 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:36654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHs-0006ph-48 for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:12 -0500 Received: by mail-qk1-f169.google.com with SMTP id g145so13938387qke.3 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:12 -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=OHi5UQoFB1TOERCpD+rOBVLSgC5wmclNxCKp0Fgy8WU=; b=f8ecb/8y+elp+xDM+uAdt82sVaeHSHu5dxLbzaKPJiAgsuRCtWyneUQdPW8LkV6xd6 C742R4APLmFsKF/aU/DyBGy2cI6srVdak9GelIASkvK0ti26nTQEDUmXayFXwdcoS2I1 aDZBvkeFH7MJKlsCV7hviGQhdsodb/1vMqN0zeP0NMsnJ2pz3/6vnHjRPaEY09naZO5Q wf/q0yT0/fXeUOkNVqjxRfcSKg+SVu0hDxI97QTttpVhuami2RdDAfR0/2jUxO1sLOQr 0EH4TrJIuWDMVfQwpZHzztLQ2yn1KR8a+H+/a8mAVxl4da6WMG86cX/0Rh4p5QE4tQXa PU9Q== 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=OHi5UQoFB1TOERCpD+rOBVLSgC5wmclNxCKp0Fgy8WU=; b=cuvRYro26Tr9YNNduwgd9IF0IiHkuQbhaMCD3eDZujbpUMcu9FuUZH3VkC4Kb8zdrn drgqDddRKVVQ+/AhFnPDGUtxP9dLvVSQKzZLvisczYWl+76NwUro7P0mq8s1iR/z9PLP V8lprbeSFGL1ay/NKE+vu/UwGH9CU0l4QIHcdI57s9KHTEu/dxK0pGt1JLUi1GNMSdin 5lQnZHrrbfUYQN4QlyPKNd9igu5v4c7hNlyMJzgPigP5tCwPX5P28wEViW9fRSuoS2ZR vOZwHirqngdVqGvzBclGCVW2Dtc82kLy41sGVfgLdVZOCTELl8InhdYbADkKPV2wzk4I aK9g== X-Gm-Message-State: AOAM531SUZkf1sgAprU+mFgBh2TvcGUM4K45iixDRD9RC7i4HszZ021L 2uI8GhgEFgZgiUkH2Vrseq9DHIMXQg2nhCose2g= X-Google-Smtp-Source: ABdhPJxfaejY4Cf44sISOIusr2dGu026KSyGPKAGfjEKbor0xK9F8ykoXnnZS87z2kT+r+OFXGmZ7g== X-Received: by 2002:a37:6257:: with SMTP id w84mr2810206qkb.364.1644333606551; Tue, 08 Feb 2022 07:20:06 -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 n19sm7454564qtk.66.2022.02.08.07.20.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:06 -0800 (PST) From: Philip McGrath Date: Tue, 8 Feb 2022 10:18:54 -0500 Message-Id: <20220208151857.1900389-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-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=1644341209; 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=OHi5UQoFB1TOERCpD+rOBVLSgC5wmclNxCKp0Fgy8WU=; b=NKh8x40/6ZG8VD2+pt52Ij9npNpLBFMXtDF1lLSZdJ16V/6tUndAC4dU8P0XdYgBw8pXO8 Xjinog/XEK7QlVnj2b0yKbZHIT6kFFm8xFG/okSD/Mrfc21KxELx2Y/Wq8Y9+UkzMAAYCT FqxEQ47B03xWXUcjIVCcHJpz8OmBDQIADeuhrL+Y/BRKUmY+fzAaKqm9wjeFldKwMQ4GFC aoBgI4by2Af/UllyPzPurdqd8H/eTQrQjMw9Tlh9qEBX3dnWsb9jz/xAxu6FejgqY2FffK nJOj0S42T+VhcSTgdF4ybKsa3vEvRmYziOfpXdE/08bl969bZdbtyS/LALU+0A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644341209; a=rsa-sha256; cv=none; b=oWWhW2smBAkPPNty5ovU/P4V4hgtZfKnoda87zWVnUXf+UBA/C7VzY4LIsY9kjeuucMtun P/nZIH7fhKHsEHwWGXAsHTrAayZDB1d2PvHHaweSRH0x2uglr5v2gqkuFg6SwWqmybQDIl YviPbaIR3v8mfWPjWvQYAQDwpifT6CNxgZZyit8/nNkkq6vUHIqXDEa5a/oOqLr2oKXQ2h 6wuv5fhcM65qTLeSyJx3RwlRT0iGLhzuCiCurudM+hKrbj7FwQ7mGdVl1IRPdSoqSXKIhN 35m+VbMZ/NMi2kmqDVArHwXswDNYiljV3eWYc2k6+GkksjI8eLQewNdaTv710A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b="f8ecb/8y"; 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.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b="f8ecb/8y"; 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: 858DF24A26 X-Spam-Score: -2.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: opVqqhSk5v4N * 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. (chez-nanopass): New variable. (unpack-nanopass+stex): Adapt accordingly. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Likewise. --- 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 c0d5e2897d..9125d34ab7 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -203,12 +203,13 @@ (define unbundle-chez-submodules "lz4" "zlib")))) -(define (unpack-nanopass+stex) - ;; delayed resolution of `nanopass` +(define unpack-nanopass+stex #~(begin - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (copy-recursively + (dirname (search-input-file %build-inputs + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) (mkdir-p "stex") (with-output-to-file "stex/Mf-stex" (lambda () @@ -241,7 +242,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -261,7 +262,7 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - #$(unpack-nanopass+stex))) + #$unpack-nanopass+stex)) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -490,12 +491,75 @@ (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