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 gP3zKdG1DmJ4fAAAgWs5BA (envelope-from ) for ; Thu, 17 Feb 2022 21:53:37 +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 2D3rJtG1DmL5KAAAauVa8A (envelope-from ) for ; Thu, 17 Feb 2022 21:53:37 +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 322CB3824D for ; Thu, 17 Feb 2022 21:53:37 +0100 (CET) Received: from localhost ([::1]:35898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKnmS-0006lO-E1 for larch@yhetil.org; Thu, 17 Feb 2022 15:53:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKnlu-0006hU-8h for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKnlt-0001ca-Ut for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKnlt-0003Zd-UW for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v2 06/15] gnu: Add stex. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Feb 2022 20:53:01 +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 , zimoun , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164513112613559 (code B ref 53878); Thu, 17 Feb 2022 20:53:01 +0000 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:06 +0000 Received: from localhost ([127.0.0.1]:52777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkz-0003Wa-Hz for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:06 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:37864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkq-0003Uc-PG for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:57 -0500 Received: by mail-qv1-f47.google.com with SMTP id a19so10740263qvm.4 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:56 -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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=KcCJBDq2jWD3Yxwfk9BN4dJLu1o6yv/biOCpMh7l+Wots6eMSBeWBfMaJc7+XhQmAB SdGsJO2+IuCTmFkTZf6lfrkE0JpTf316esF03+uBekzlq2BiMj8XA5rWpas9IL+6QA5n YwzxcuoZuVtoEmvNqkBJmHy3BFCk74LQX5F/ZOQQXhjizT87e+g4+b05iBlOdE+b5MUV e+MX/lq5lTkDWxih3n0gbgY/DPC8szJ5kQcwv9aNtTu7NMLmTf1awZfyVhMGESxPIdqH Y0va3MS/Cm9LlHmkytUX/paMYcPxh170bkK1MR0EX/JTYKogj6UiL24ylpX1AQkWEySy imaA== 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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=1kNLuE7Txt3YEen/gqKlaWU2LZ4u57uw2lwHvzx9GG3zHJ5IoM6C2zxCtoRiDkxtQM gcGFmIucIejg5IkLwTYwsJB7r99gKy1nOJv1Ak1r8ON+AK8KYtTqRbZqcbjcWCf/wmwl icdFBo21ph62tpVMZGKIEOuq/586qAJg7MwG+gDRb+72nWxJS6jvKr+tfO/d21uCY1hZ CBeDmXUuAVgZFyGH2ItHPLrsSI0qABs61EKIyB7LDa1kgyY6T3pvVla7QasGLvQyMNWK eAlw1C80UE3vBBLeh7F8MdsiaOCDTNcODVY/3rpe5z2cCvhaL719LFyWMIO3YmxTulVX yPNA== X-Gm-Message-State: AOAM53102hnxJ0JEtxREi6Mjr4Gj9TZGyRf+YV2iWgMmt7BTYBtDvwMH fK9sSV92zCGowq/tFhfjq85/cstwQU7JHCDmEc0= X-Google-Smtp-Source: ABdhPJy6rbVY2UySe3wPyYMkjfCfZKgGCKhpoZ3Tw8HLOCsfUqxvPg+N2905NpvtXsGnmDe1HaDa3Q== X-Received: by 2002:ac8:5bd6:0:b0:2dd:92e7:bd1b with SMTP id b22-20020ac85bd6000000b002dd92e7bd1bmr1290179qtb.208.1645131111180; Thu, 17 Feb 2022 12:51:51 -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 az38sm20851773qkb.124.2022.02.17.12.51.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:50 -0800 (PST) From: Philip McGrath Date: Thu, 17 Feb 2022 15:50:39 -0500 Message-Id: <20220217205048.967383-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-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=1645131217; 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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=B67f6p+em9tU8rnGm/E6BaYnn+IC2fWRVXuESDa9BVOdYc+R7Vyfj/9PdThWjjjIXXK3H3 yviGzXGsiY+S5MKmFCPfgL1YUVFZnk+qandVo4F6q4ngbVLawiTpTi+fQel1MfLHaU8Wdg 16sIKT1kx3y/8Jy6G/wbnB6R2hwcLhQamttIOuaEMXaqVSZXjddQ92a0x8mTB9+C7+ALfQ rIjSy4JhFpDp2nnIENIuS8VFxcVEgphS2llu5fPOeVtDf1c/qj8YYV2daeJoQoa+E8xAGm Q7vd/Vb4RRanzQXhSp1/dDuxR0Ydabo8QYPMdR3Xp5a+1d2krCME1r1k9lLoiw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645131217; a=rsa-sha256; cv=none; b=Ysv7bBT8YYR664VcxwWCTFL0FVvz5+Lo1qxk/j8ctKU8A9Ha/I2G64Z04RG8OcftdCx5Ud mPEqk3SbtSCbabN4lw9HN1BezPFTcP3fIi0zr0avRfeMc0VmCA+N6sPlmak2qXON8jD7zb VBPn0GN0gCgLk2WIa4lf6tk6IX7+pnmoDl/sWiFPowWaBAvfKge7D0v9asPEfcQdhyz71Q KiAjRPVVF2U+n9gODo1MAe6diPfHm8Dm5YVJsh/fSDFmBeF6td0CSO16X0irghY2NzaHKN 0kuforo1CAghPxrR069X+p5ip8eXgBfAiOore05bdhirt+UJK8JbKRzRtO3dAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=KcCJBDq2; 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.87 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=KcCJBDq2; 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: 322CB3824D X-Spam-Score: 0.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: uOz/OyMt8iE5 * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap'. (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 215 +++++++++++++++------ gnu/packages/racket.scm | 2 +- 2 files changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 81ac8f0774..83bf15b5fb 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -31,6 +31,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -172,30 +173,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(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 stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -232,15 +209,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,9 +232,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -301,32 +272,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -334,7 +282,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -370,3 +320,146 @@ (define* (stex-make #:optional (suffix "")) generates native code for each target processor, with support for x86, x86_64, and 32-bit PowerPC architectures.") (license license:asl2.0))) + +;; +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license license:expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (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))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a1ba57cca3..d8338bcd6f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,7 +333,7 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,stex) + ("stex" ,(package-source stex)) ("nanopass" ,nanopass))) (arguments `(#:phases -- 2.32.0