From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id SL18Be9ZCmawzwAAqHPOHw:P1 (envelope-from ) for ; Mon, 01 Apr 2024 08:53:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id SL18Be9ZCmawzwAAqHPOHw (envelope-from ) for ; Mon, 01 Apr 2024 08:53:35 +0200 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=J2X6Fro+; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="C OmhmJW"; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711954414; 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=x4hBBMGyE+8aZYCzBasoduM9roNhogIlgm9wdggAfZs=; b=MTy8J9/K4yMJAol+qTojvlNJabtb4JMcRHFxWeRLAyAGw4Y945f7rxFq3Aaw1lowXnXIYO dru4UXUD7Tx6VJnLbiEP+KaoUSl/rZMqaNzgOrRmrYxiFciqI+EF0kyVwz5AbKqlCPC31j tNq3uSaRXoLDLyDovyocBGWlJXMfPc59tPCqy69S/fXTiB/z3cxLvufGdXnOfoel0Dw7gG mh9aOB1Mtoa99/9MO93IDgjnotUxhlLA3jt7H+oDbRrKzWhStJEcQpH3wnmgudzvkU5UwF Jfjl3KMLmg0srNT/oJESKkdiEBJfHVdkaQJpGReueWFIku8AL9U8T4bT1Cfc0g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm2 header.b=J2X6Fro+; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="C OmhmJW"; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711954414; a=rsa-sha256; cv=none; b=Rc1BrfNOmMcvPtuikBLYcYXo7iM5m2s7MedscfQetFKYisiQIJ3QQhr5dg8Pod/uzqK8f0 juC1/0FGtLGnNTO5if8XxYBhoQ+2kmJjmrzGXi2dQxG6QEWYFR1s3rEdQE+3SejKS/2cle USaMaTITxgMFds75hQMP05eVPJNkW1ThWMS/4sR/cyfY6qFZuWNp/H/zxEMNTMfKBfDD2w t6f1OY6TsAKxwnKGjcwNR5ks3Q8d827ll13PrPB18Dv/u/QWCe7DLpOsLWSbQna+XlcUGf Np398TZisDBi3nLyrWmV+sljUp9K/p4Wmumkt4g6FvLGMG7aUA0Jj8tw5jW3Bw== 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 BB7BB24208 for ; Mon, 1 Apr 2024 08:53:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrBXS-0003f3-3U; Mon, 01 Apr 2024 02:53:02 -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 1rrBXQ-0003e4-Hr for guix-patches@gnu.org; Mon, 01 Apr 2024 02:53:00 -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 1rrBXQ-0007wi-A0 for guix-patches@gnu.org; Mon, 01 Apr 2024 02:53:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrBXT-0003Pv-81; Mon, 01 Apr 2024 02:53:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH v2 3/8] 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: Mon, 01 Apr 2024 06:53: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: Katherine Cox-Buday , Liliana Marie Prikler , Andrew Tropin , Philip McGrath , Skyler Ferris , Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171195434913018 (code B ref 70065); Mon, 01 Apr 2024 06:53:03 +0000 Received: (at 70065) by debbugs.gnu.org; 1 Apr 2024 06:52:29 +0000 Received: from localhost ([127.0.0.1]:49360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrBWu-0003Np-Bt for submit@debbugs.gnu.org; Mon, 01 Apr 2024 02:52:29 -0400 Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]:59847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrBWr-0003NS-43 for 70065@debbugs.gnu.org; Mon, 01 Apr 2024 02:52:26 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 023AA1140125; Mon, 1 Apr 2024 02:52:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 01 Apr 2024 02:52:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc: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=1711954336; x=1712040736; bh=x4hBBMGyE+8aZYCzBasod uM9roNhogIlgm9wdggAfZs=; b=J2X6Fro+HJ6vStulffisfgPc3MEtpjRsQkX2j xz5UPSQLvm+egI1mrZxtSxI6lUP33LQOMrggszbpXNOR1UPrvb+igQGDVd+B9THf wfu1IpjUBZnW0DYdegwHA96I+Sz9q0y/HRVCaoEGFdnCJCWYTdexIMTOY0ntAcn+ MKuMmOKziPO34eQbmblQsqypxh59l87MxrWA3DwIBhupJ2f3fM34kWtpjq3uLLnP hKFLEF0z8e5WtylrY6XLBGybbvGR9iGJ4TjpSV6vA9K+hAKc6GuqAd3snYk5Klud gFvjVttn+YPqllSZo8VPjoMAYKMR4tIjlW2yno0no9Th9LXpw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1711954336; x= 1712040736; bh=x4hBBMGyE+8aZYCzBasoduM9roNhogIlgm9wdggAfZs=; b=C OmhmJWk1ceUFocEIeMHxpQ3uj1uuUMS86WgHljJZLg2UAXJzK6Ahd2inlzhk9wF3 375NCiWW6HU1YPlBldCUg7se1054pqdaEZ1ggRWrO8X3phViBW1NBa87agxvHMZP GfCZMuMrdkVelgykV1uqRNwprN+UkveySeLKKX1ZO+PdM7SKpUYjfmyvG3QWA/MM asNbFT1YkrFCDKBNlfjcqySQX6r6SoXCKqb7TrhXPSM1L3fvN5FohTaFVyLjrfBo OkliaqO/66xI3bAq7BTWa/XVY8ykh/6ljQA0k7YLM7s8riP+oZc6lTsSN+uK/ErJ 3hHlkqpJRKVddo4itokeA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvledguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefhvfevufffkffojghf ggfgsedtkeertdertddtnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphh hilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhep ueevheefteejieeuveeuhfdugfevteefheegveejkeeufefggffhteegteefgfdunecuff homhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuhgsrdhiohenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhlih hpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Apr 2024 02:52:16 -0400 (EDT) From: Philip McGrath Date: Mon, 1 Apr 2024 02:51:08 -0400 Message-ID: <92971b8c18a5d69577472b97c8b91b5319527049.1711953507.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: BB7BB24208 X-Spam-Score: -2.45 X-Migadu-Spam-Score: -2.45 X-Migadu-Scanner: mx10.migadu.com X-TUID: ujCNL6r/sA8A 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 f651cdce0c..19520cdf4a 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 @@ -689,39 +504,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 @@ -803,6 +773,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