From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 cClPHFJ+CWInhwAAgWs5BA (envelope-from ) for ; Sun, 13 Feb 2022 22:55:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CFj+FFJ+CWK4XgEAG6o9tA (envelope-from ) for ; Sun, 13 Feb 2022 22:55:30 +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 E326D1A41C for ; Sun, 13 Feb 2022 22:55:29 +0100 (CET) Received: from localhost ([::1]:58928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJMq8-00070G-KG for larch@yhetil.org; Sun, 13 Feb 2022 16:55:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJMom-0005cN-MJ for guix-patches@gnu.org; Sun, 13 Feb 2022 16:54:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJMom-0001uC-DI for guix-patches@gnu.org; Sun, 13 Feb 2022 16:54:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJMom-0003EF-Dc for guix-patches@gnu.org; Sun, 13 Feb 2022 16:54:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH 06/11] gnu: Add chez-nanopass. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Feb 2022 21:54: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: Liliana Marie Prikler , Philip McGrath Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164478919512251 (code B ref 53878); Sun, 13 Feb 2022 21:54:04 +0000 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:15 +0000 Received: from localhost ([127.0.0.1]:39063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMny-0003BS-Sh for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:15 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:40881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnw-0003Ax-It for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:12 -0500 Received: by mail-qk1-f179.google.com with SMTP id o25so12986269qkj.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53: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=0RoPqjGuiAdlkTJfEuvvQASmSYaOTDgT7ADK6BvAjY0=; b=SNH3cAF0xRaq78IK5sHzA1dJwvRiu138+v4cv5nSV9RK7J+XCAANYeEKK91UvBFIrc zmO3+s447pjM8v+olvD0/FsjPy3iNQsCo5pQBGamtc7XKZVXBJWpqbd2pXRMeRQH07IL baiYYMa1g06KuGMPReWWpilIUXTgnU6YYCIupxuaCvMLa0OgMa45cOhy91RsUiRDvnf5 xCtW0VmgHcxzl/L7U7hWA6CY4GbYVpeinQDZ/Iwd7wPhuAIUDC+d7cuFN4E1iIMyEbgh Au1V7FooH56DXXZB0FHZataIDbN3Uitdfvzek3Lm8Ixv82M36zWBGAThMsY7/BSKr190 4QHg== 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=0RoPqjGuiAdlkTJfEuvvQASmSYaOTDgT7ADK6BvAjY0=; b=zfm32rTkeSqa76qkPxeQYZfk8VHX5dap83qkZt268uquRQprEv8WQu1OUZM7Pt2894 qtBAxzfqoW0Fgfv/YTWk9KE6+C2L2etByTuEcttMMjbIboSP9FZXTyxEMq3ysFvZ+i3u vGcdGwN9CSWqyrGYNPGvy6paxWaA0VSuaWaXfj5wAVof6TB0tpbqZSb6wNaXWUl3ZRP7 8hlc4YzyXC5LG53gkN6Sz3M0WEZyD+UytILlZTtXbz1N7o8xcZgYuJJZGMR4M+fUbw37 3biCT/q80FKbwtxV9QIxBby3lAtdOQH3GNFcE3JESa7iXGrHRdKB/NCI/mIsZqqtylyW VQOA== X-Gm-Message-State: AOAM5312Z+C42/h6yvgWNqqUk0l/fzve0mlxTwZi2L5X2TqOW7fIqj2Q M1nQP6qBuaW1mA40Iaiq4qd/y8qCna3LQDrSmak= X-Google-Smtp-Source: ABdhPJxl1oFGTbGXdsiJLScfAl5adcMTPLpqe4jpF7b/UEc7/2TkRWNrw2UUdIB/UIZ9m/oVZCYm4g== X-Received: by 2002:a05:620a:e1d:: with SMTP id y29mr4776400qkm.274.1644789187066; Sun, 13 Feb 2022 13:53:07 -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 f20sm17374305qte.14.2022.02.13.13.53.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:06 -0800 (PST) From: Philip McGrath Date: Sun, 13 Feb 2022 16:51:22 -0500 Message-Id: <20220213215127.218952-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-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=1644789330; 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=0RoPqjGuiAdlkTJfEuvvQASmSYaOTDgT7ADK6BvAjY0=; b=Ey7ddoYfWnMLHfOOFzjDpiNpdp5AzpkhIibDUnLcHZ/IwT1tegbqp6/BbhSHOkuXEesoZ1 OUl8mKEUzpcY8IDBRKW/VPkUDVM7mz6TSKqx5ogjB4kioW+UGZ4VuHSNLcvjTD4vU3NQ6+ BnZc3uyDV3c5SgLsXJ4q/kPhC+mctBKVCiaQh/m7OijexUF+VLr7u4XkHb7eODdFHgl+sm nZVYxtCst+clgRBwG5SFImNEGTFlWRdfT7YsUvPJ7CjTejNV5AEsPV986UcfkwKFCU9saC K9wAgAMPayH4PpR3h2Y3AYkGEJBDcdWs6ynCYqvzqskjSqecRARvLEoXk7yUOA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644789330; a=rsa-sha256; cv=none; b=kjWedve+0enye8DJ3C9ElSoAc6IOzyVgQ4CvZCyQeUCE0qeL9YRXWFxxNRXTmuUoDS8L+I 8ihtKV+OcrSCAaQkCJhGyd2ubFr2btSUGElsFYX3scu5M8gSxsEM6vgYJIeKJuFSpZk7Bc aGetXXKd/7E5arDUyc+DyUsdIMfXCLFe1185tNCzyS8+su3H/S2fwfUZXrJHM4wvvue0br DscPCBwatUd2tZMLYN+VwdjHQ4onDQdezNp34bjqV/kRsUOpz/9nhdQ8zSwaS1T7HcGHWG KH4iqPVN9UzIQ00be5dpjiEG92lGf8aRCNpmBBU0J4E04vvKPAZZnMBn/WjIeA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=SNH3cAF0; 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=SNH3cAF0; 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: E326D1A41C X-Spam-Score: 0.37 X-Migadu-Scanner: scn0.migadu.com X-TUID: nrCYkRSFvr0X * 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 | 97 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 82 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 945d1ce2ed..90fd63b5ae 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`. @@ -485,12 +486,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