From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 6OpTC7FPBmYVaAAA62LTzQ:P1 (envelope-from ) for ; Fri, 29 Mar 2024 06:20:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 6OpTC7FPBmYVaAAA62LTzQ (envelope-from ) for ; Fri, 29 Mar 2024 06:20:49 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm2 header.b="X/epFJ4Y"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=c3ABSD0m; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711689649; a=rsa-sha256; cv=none; b=c4PfEiWnB2v4NS7B0lunlH+Md3lm1Ma+SDXwLAUjg6sJrJSDoJYtYyATn41EnyqVD3x5fJ MarsNAHWDT6256gs2ru9e1alv1/92w378DrD+XmiSOGxD9OyNTJNdWl0RM6Tn/bz2Fl+ZV 4Xb9fe5E86x4l0BYXXNva8UziMLeKdNNIZudHktmTAHTLlNnruqov+EfoFaw1X9twbuU/2 vCBzu5iPuxiveXKULxgkJ8LZ87X9p8r+GPpdFt5P6Ey8M6daWE4Wn9C4iyjIUMoGqEK/Hr 5FhWiolM/c+ATC7cCPWIaEhj1Le8+OUXq93MhK2hSXRysJIocaLI2OFgFXv9Zw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm2 header.b="X/epFJ4Y"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=c3ABSD0m; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711689649; 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=vQqPRe3LRDGDDpUSHjZ4K7+PW2DVaq300T3tV3JtIDk=; b=SiXlkDOnjIDz6B4oWQUcfuuEwrIifYYCeL6OrKYi9pHATx1JjSFGDtf4FD+UksGM5GwuuU tESRteAOiTw83br1/OtAHiYDRnN/LFPrcEbLL6N0qiH4ex17PU1TmkuzSlrnSAoyR/JOjS 0145R7fPFSA0tgBVBncP7QJEF8NFKkIe3KOE433Y/xzQqOqtfUGQjFyvB/D3c8elHyhjay EUavwh6e/oh4k4f92sv+KaaXTNzkoiBKFBap2osJnpl5CCufA8BF+iCrqCKIvurLDkOtTN tnQoc9LbP4xmmOeT0uQ0RV9he4ItBlk7JoWq8Aeici30ASrlUqn3Cijk5r5V7g== 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 4465012686 for ; Fri, 29 Mar 2024 06:20:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4f8-0003NK-NK; Fri, 29 Mar 2024 01:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4eo-0003J1-DP for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4eo-00067A-2e for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4ep-0004zZ-4k; Fri, 29 Mar 2024 01:20:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 3/6] gnu: chez-scheme: Reorganize package definitions. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168956019087 (code B ref 70065); Fri, 29 Mar 2024 05:20:03 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:20 +0000 Received: from localhost ([127.0.0.1]:41488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e7-0004xa-IT for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:20 -0400 Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]:59851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4dy-0004wd-QD for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:12 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id 85ADD1C00089 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 29 Mar 2024 01:19:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1711689543; x=1711775943; bh=vQqPRe3LRDGDDpUSHjZ4K7+PW2DVaq30 0T3tV3JtIDk=; b=X/epFJ4Yo2HEzRhP9l61V34Hrt1ZvJaBA2SBeXOtyijHM+RJ nHoEMz8JpIcz0U1julXuPtSiP2rNT+bcjLdqF2VoYrFqBOo7BJc+sAEvV1qrCDTP hd5QFW05RPMwdmqQxqMG0ROYo2r6/qS3EDNH3/RJKj2CZh2JffqyiPHw2J/gXSPj WK+XHmAA+3hL6Xo4Im3pGeDT9ucVSy3UVQpwBPNB03+P6SwiFZaEjo8M0ORxka7w jAs3NW4lCUAfUCGVeHtWbho/RHj7KibPGPe/k9gdaC8XNpGPc7kpLLs4jHmRPkcd wv/bcWp9KbnpPZjtWBg7CnN7v/UTCCLFW4CedQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1711689543; x=1711775943; bh=vQqPRe3LRDGDD pUSHjZ4K7+PW2DVaq300T3tV3JtIDk=; b=c3ABSD0m0+ksX+zsTfXfxHsykljr9 I3Ulpz8Ge+Aj1cLXVYpS/jV4VuK4veFa6aQ4SMxH3L0wx0A6v6ksN5rBwfVRUe8u kV5xBYUU5FPkevoKauRzBh2lB/xSnqlfA/MAfAHXESVt5+wbCGlKDQDr6QbNWEF/ Tpw3DMkXtk7zUPBgEy3+wL/IEKSwIcuPFsLUVTKdTKa3rJYC3TojAp8jcE+ddFl5 8W20wC0m0IkYt7CjGLGSE+e+TvQk7ecRSWIubkXDFOsBYtHu7eylXkxFq5KBTvtC 9Wg0pJbpNgN2xFJNitmU7huWA0Yzztkj4Wk+ToYTBB6l5oGaQFZSkSBkw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhilhhi phcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh eqnecuggftrfgrthhtvghrnhepteevudeuteeuteehteeuteeiffefieefjeejtdeltdej feehteeuvdejvdehvedunecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuh gsrdhiohenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:02 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:52 -0400 Message-ID: <5c84a4bda522531288944d78c505c4328735ac5d.1711688274.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -0.95 X-Migadu-Queue-Id: 4465012686 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -0.95 X-TUID: rPDrb1MAOObF A future commit will change 'chez-scheme' to inherit from 'chez-scheme-for-racket', so 'chez-scheme-for-racket' will need to be defined before 'chez-scheme'. In an attempt to produce better diffs, this commit re-orders the definitions while keeping their contents exactly the same. * gnu/packages/chez.scm (chez-scheme): Move below 'chez-scheme-for-racket'. (chez-scheme-bootstrap-bootfiles): Move below 'chez-scheme-for-racket-bootstrap-bootfiles'. Change-Id: Ie088abea2b44329f9d8399fbfb95c51d8912b05e --- gnu/packages/chez.scm | 426 +++++++++++++++++++++--------------------- 1 file changed, 213 insertions(+), 213 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index c71d6fafd5..3b7e6a67b3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -282,191 +282,6 @@ (define unpack-nanopass "lib/chez-scheme/nanopass.ss")) "nanopass")))) -(define-public chez-scheme - (package - (name "chez-scheme") - ;; The version should match `(scheme-version-number)`. - ;; See s/cmacros.ss c. line 360. - (version "9.5.8") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 - "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) - (file-name (git-file-name name version)) - (patches (search-patches "chez-scheme-bin-sh.patch")) - (snippet #~(begin - (use-modules (guix build utils)) - ;; TODO: consider putting this in a (guix ...) or - ;; (guix build ...) module so it can be shared - ;; with the Racket origin without cyclic issues. - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))))) - (build-system gnu-build-system) - (inputs - (list - chez-scheme-bootstrap-bootfiles - `(,util-linux "lib") ;<-- libuuid - zlib - lz4 - ncurses ;<-- for expeditor - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - libx11)) - (native-inputs (list chez-nanopass-bootstrap - stex-bootstrap)) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files '("lib/chez-scheme"))))) - (outputs '("out" "doc")) - (arguments - (list - #:modules - '((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - #~`(,(string-append "--installprefix=" #$output) - #$@(if (and=> (chez-upstream-features-for-system) - (cut memq 'threads <>)) - #~("--threads") - #~()) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do 'compress-man-pages', - ;; and letting Chez try causes an error - "--nogzip-man-pages") - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (begin - (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 () - ;; otherwise, it will try to download submodules - (display "# to placate ../configure")))))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (when (directory-exists? "boot") - (delete-file-recursively "boot")) - (copy-recursively - (search-input-directory inputs - "lib/chez-scheme-bootfiles") - "boot"))) - ;; NOTE: The custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. This replacement phase uses only - ;; the explicitly provided `#:configure-flags`. - (replace 'configure - (lambda* (#:key inputs (configure-flags '()) out-of-source? - #:allow-other-keys) - (let* ((abs-srcdir (getcwd)) - (srcdir (if out-of-source? - (string-append "../" (basename abs-srcdir)) - "."))) - (format #t "source directory: ~s (relative from build: ~s)~%" - abs-srcdir srcdir) - (if out-of-source? - (begin - (mkdir "../build") - (chdir "../build"))) - (format #t "build directory: ~s~%" (getcwd)) - (format #t "configure flags: ~s~%" configure-flags) - (apply invoke - (string-append srcdir "/configure") - configure-flags)))) - (add-after 'configure 'configure-environment-variables - (lambda args - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - ;; Likewise, some tests have needed HOME to be set: - (setenv "HOME" "/tmp"))) - ;; The binary file name is called "scheme" as is the one from - ;; MIT/GNU Scheme. We add a symlink to use in case both are - ;; installed. - (add-after 'install 'install-symlink - (lambda* (#:key outputs #:allow-other-keys) - (let* ((scheme (search-input-file outputs "/bin/scheme")) - (bin-dir (dirname scheme))) - (symlink scheme - (string-append bin-dir "/chez-scheme")) - (match (find-files (string-append bin-dir "/../lib") - "scheme.boot") - ((scheme.boot) - (symlink scheme.boot - (string-append (dirname scheme.boot) - "/chez-scheme.boot"))))))) - ;; Building the documentation requires stex and a running scheme. - (add-after 'install-symlink 'install-docs - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((doc-prefix (or (assoc-ref outputs "doc") - (assoc-ref outputs "out"))) - (chez+version (strip-store-file-name #$output)) - (scheme (search-input-file outputs "/bin/scheme")) - (stexlib (search-input-directory (or native-inputs - inputs) - "/lib/stex")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (define* (stex-make #:optional (suffix "")) - (invoke "make" "install" - (string-append "Scheme=" scheme) - (string-append "STEXLIB=" stexlib) - (string-append "installdir=" doc-dir suffix))) - (with-directory-excursion "csug" - (stex-make "/csug")) - (with-directory-excursion "release_notes" - (stex-make "/release_notes"))))) - (add-after 'install-docs 'link-doc-pdfs - ;; otherwise, it's hard to notice them in a forest of HTML files - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion - (string-append (or (assoc-ref outputs "doc") - (assoc-ref outputs "out")) - "/share/doc/" - (strip-store-file-name #$output)) - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (match (find-files "csug" - "csug.*\\.pdf$" ;; embeded version number - #:fail-on-error? #t) - ((pth) - (symlink pth - "csug.pdf"))))))))) - (supported-systems - (delete - "armhf-linux" ;; XXX reportedly broken, needs checking - (filter chez-upstream-features-for-system - %supported-systems))) - (home-page "https://cisco.github.io/ChezScheme/") - (synopsis "R6RS Scheme compiler and run-time") - (description - "Chez Scheme is a compiler and run-time system for the language of the -Revised^6 Report on Scheme (R6RS), with numerous extensions. The compiler -generates native code for each target processor, with support for x86, x86_64, -and 32-bit PowerPC architectures.") - (license asl2.0))) - (define chez-configure ;; The custom Chez 'configure' script doesn't allow unrecognized flags, such ;; as those automatically added by `gnu-build-system`. This replacement @@ -686,39 +501,194 @@ (define-public chez-scheme-for-racket version of Chez Scheme.") (license asl2.0))) -;; -;; Bootfiles: -;; - -(define-public chez-scheme-bootstrap-bootfiles +(define-public chez-scheme (package - (inherit chez-scheme) - (name "chez-scheme-bootstrap-bootfiles") - (inputs '()) - (native-inputs '()) - (outputs '("out")) - (build-system copy-build-system) - ;; TODO: cross compilation + (name "chez-scheme") + ;; The version should match `(scheme-version-number)`. + ;; See s/cmacros.ss c. line 360. + (version "9.5.8") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) + (file-name (git-file-name name version)) + (patches (search-patches "chez-scheme-bin-sh.patch")) + (snippet #~(begin + (use-modules (guix build utils)) + ;; TODO: consider putting this in a (guix ...) or + ;; (guix build ...) module so it can be shared + ;; with the Racket origin without cyclic issues. + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) + (build-system gnu-build-system) + (inputs + (list + chez-scheme-bootstrap-bootfiles + `(,util-linux "lib") ;<-- libuuid + zlib + lz4 + ncurses ;<-- for expeditor + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + libx11)) + (native-inputs (list chez-nanopass-bootstrap + stex-bootstrap)) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files '("lib/chez-scheme"))))) + (outputs '("out" "doc")) (arguments - (list #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (list + #:modules + '((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + #~`(,(string-append "--installprefix=" #$output) + #$@(if (and=> (chez-upstream-features-for-system) + (cut memq 'threads <>)) + #~("--threads") + #~()) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try causes an error + "--nogzip-man-pages") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (begin + (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 () + ;; otherwise, it will try to download submodules + (display "# to placate ../configure")))))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory inputs + "lib/chez-scheme-bootfiles") + "boot"))) + ;; NOTE: The custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. This replacement phase uses only + ;; the explicitly provided `#:configure-flags`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (if out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + ;; Likewise, some tests have needed HOME to be set: + (setenv "HOME" "/tmp"))) + ;; The binary file name is called "scheme" as is the one from + ;; MIT/GNU Scheme. We add a symlink to use in case both are + ;; installed. + (add-after 'install 'install-symlink + (lambda* (#:key outputs #:allow-other-keys) + (let* ((scheme (search-input-file outputs "/bin/scheme")) + (bin-dir (dirname scheme))) + (symlink scheme + (string-append bin-dir "/chez-scheme")) + (match (find-files (string-append bin-dir "/../lib") + "scheme.boot") + ((scheme.boot) + (symlink scheme.boot + (string-append (dirname scheme.boot) + "/chez-scheme.boot"))))))) + ;; Building the documentation requires stex and a running scheme. + (add-after 'install-symlink 'install-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((doc-prefix (or (assoc-ref outputs "doc") + (assoc-ref outputs "out"))) + (chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) + (doc-dir (string-append doc-prefix + "/share/doc/" + chez+version))) + (define* (stex-make #:optional (suffix "")) + (invoke "make" "install" + (string-append "Scheme=" scheme) + (string-append "STEXLIB=" stexlib) + (string-append "installdir=" doc-dir suffix))) + (with-directory-excursion "csug" + (stex-make "/csug")) + (with-directory-excursion "release_notes" + (stex-make "/release_notes"))))) + (add-after 'install-docs 'link-doc-pdfs + ;; otherwise, it's hard to notice them in a forest of HTML files + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion + (string-append (or (assoc-ref outputs "doc") + (assoc-ref outputs "out")) + "/share/doc/" + (strip-store-file-name #$output)) + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (match (find-files "csug" + "csug.*\\.pdf$" ;; embeded version number + #:fail-on-error? #t) + ((pth) + (symlink pth + "csug.pdf"))))))))) (supported-systems - (filter (lambda (system) - (and=> (chez-upstream-features-for-system system) - (cut memq 'bootstrap-bootfiles <>))) - %supported-systems)) - (synopsis "Chez Scheme bootfiles (binary seed)") + (delete + "armhf-linux" ;; XXX reportedly broken, needs checking + (filter chez-upstream-features-for-system + %supported-systems))) + (home-page "https://cisco.github.io/ChezScheme/") + (synopsis "R6RS Scheme compiler and run-time") (description - "Chez Scheme is a self-hosting compiler: building it requires -``bootfiles'' containing the Scheme-implemented portions compiled for the -current platform. (Chez can then cross-compile bootfiles for all other -supported platforms.) + "Chez Scheme is a compiler and run-time system for the language of the +Revised^6 Report on Scheme (R6RS), with numerous extensions. The compiler +generates native code for each target processor, with support for x86, x86_64, +and 32-bit PowerPC architectures.") + (license asl2.0))) -This package provides bootstrap bootfiles for upstream Chez Scheme. -Currently, it simply packages the binaries checked in to the upstream -repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to -work with upstream Chez Scheme so that we can bootstrap these files from -source."))) +;; +;; Bootfiles: +;; (define-public chez-scheme-for-racket-bootstrap-bootfiles (package @@ -800,6 +770,36 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles 7.1 and later, including the Racket BC variant.") (license asl2.0))) +(define-public chez-scheme-bootstrap-bootfiles + (package + (inherit chez-scheme) + (name "chez-scheme-bootstrap-bootfiles") + (inputs '()) + (native-inputs '()) + (outputs '("out")) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + (filter (lambda (system) + (and=> (chez-upstream-features-for-system system) + (cut memq 'bootstrap-bootfiles <>))) + %supported-systems)) + (synopsis "Chez Scheme bootfiles (binary seed)") + (description + "Chez Scheme is a self-hosting compiler: building it requires +``bootfiles'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile bootfiles for all other +supported platforms.) + +This package provides bootstrap bootfiles for upstream Chez Scheme. +Currently, it simply packages the binaries checked in to the upstream +repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to +work with upstream Chez Scheme so that we can bootstrap these files from +source."))) + ;; ;; Chez's bootstrap dependencies: ;; -- 2.41.0