all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Paul A. Patience" <paul@apatience.com>
To: 49517@debbugs.gnu.org
Cc: Kaz Kylheku <kaz@kylheku.com>
Subject: [bug#49517] [PATCH] gnu: txr: Build documentation and update to 265.
Date: Tue, 13 Jul 2021 23:45:34 +0000	[thread overview]
Message-ID: <lkKu4cCvlVCKZHf_KZjvAknH_CGNYkXBxzN6ZqKiVi8rt3DSUFUsyo8eyklsX9hu-ax2vNVRa89nuZQeRW_3USrnCs5fwqYqk0vXQssOlqg=@apatience.com> (raw)
In-Reply-To: <CWYO-z9r2mu9y0WLMjXvUW4eG15F1gWB_fxOcHt9H7qS_LDeJMBL7XjpLYFjq1IjEdrdDbPezgLxkmoBNR_WHvsExCTGt5fBajbScQSj2s0=@apatience.com>

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

On Sunday, July 11th, 2021 at 21:01, Paul A. Patience <paul@apatience.com> wrote:

> I've managed to fix one of the failing tests
> and narrowed down the problem of the others.

Kaz Kylheku has determined the cause of the failing tests,
so I've updated the comment to reflect his conclusions.

There has been a new release so I've updated the package
to TXR version 266.

Once again, only the second attached patch is different
from my initial submission.

Best regards,
Paul

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-txr-Build-documentation.patch --]
[-- Type: text/x-patch; name=0001-gnu-txr-Build-documentation.patch, Size: 7002 bytes --]

From 078e028b34497a928399151db1a5edd12d7c9196 Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul@apatience.com>
Date: Sat, 10 Jul 2021 20:23:49 -0400
Subject: [PATCH 1/2] gnu: txr: Build documentation.

* gnu/packages/lisp.scm (man-for-txr): New variable.
(txr)[native-inputs]: New field.
[inputs]: Move above the arguments field.
[arguments]<#:phases>{inhibit-doc-syms-generation, build-doc}
{install-doc}: New phases.
{fix-tests}: Add after the unpack phase rather than after the configure
phase so that all file-modifying phases are performed after unpacking.
---
 gnu/packages/lisp.scm | 95 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 89 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 382f48beb1..8f3be7dafe 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -59,8 +60,10 @@
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages groff)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
@@ -846,6 +849,60 @@ enough to play the original mainframe Zork all the way through.")
       (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
       (license license:gpl3+))))
 
+(define man-for-txr
+  (let ((commit "dfbf19b9a96474b8c1bacac85e43605e5691ceb2")
+        ;; Number of additional commits since the last tag (see the output of
+        ;; "git describe --tags").
+        (revision "41"))
+    (package
+      (name "man-for-txr")
+      (version (git-version "1.6g" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "http://www.kylheku.com/git/man/")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1zy0g8fj9nsfwzvg88hyaiy94r8j14xhs8vy2ln2niqdm6x2lvy2"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; There are no tests.
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-man2html-makefile
+             (lambda _
+               (substitute* "man2html/Makefile.in"
+                 ;; It inadvertently ignores @bindir@.
+                 (("^(bindir = \\$\\(DESTDIR\\)\\$\\(PREFIX\\)).*" _ prefix)
+                  (string-append prefix "@bindir@\n")))
+               #t))
+           (add-after 'unpack 'delete-generated-files
+             (lambda _
+               (for-each delete-file
+                         (append
+                          (list "conf_script")
+                          (map (lambda (d) (string-append d "/Makefile"))
+                               '("." "man" "man2html" "src"))
+                          (map (lambda (f) (string-append "src/" f))
+                               '("makewhatis.in" "man.conf"
+                                 "paths.h" "version.h"))))
+               #t))
+           (replace 'configure
+             (lambda* (#:key outputs #:allow-other-keys)
+               (setenv "CC" ,(cc-for-target))
+               ;; Humor the manually written configure script.
+               (invoke "./configure" "+lang" "en" "+fhs"
+                       (string-append "-prefix=" (assoc-ref outputs "out")))
+               #t)))))
+      (home-page "http://www.kylheku.com/cgit/man/")
+      (synopsis "Modifications to the man utilities, specifically man2html")
+      (description
+       "This is a fork of the man utilities intended specifically for building
+the HTML documentation of TXR.")
+      (license license:gpl2))))
+
 (define-public txr
   (package
     (name "txr")
@@ -860,6 +917,13 @@ enough to play the original mainframe Zork all the way through.")
        (sha256
         (base32 "14zaziymnbr2ld79x4h7sf88bzzzj82w3xpavmcx7mhwannb2swh"))))
     (build-system gnu-build-system)
+    (native-inputs
+     ;; Required to build the documentation.
+     `(("ghostscript" ,ghostscript)
+       ("groff" ,groff)
+       ("man2html" ,man-for-txr)))
+    (inputs
+     `(("libffi" ,libffi)))
     (arguments
      `(#:configure-flags
        (list ,(string-append "cc=" (cc-for-target))
@@ -867,6 +931,22 @@ enough to play the original mainframe Zork all the way through.")
        #:test-target "tests"
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'inhibit-doc-syms-generation
+           (lambda _
+             (substitute* "genman.txr"
+               ;; Exit from genman.txr before it tries to write to
+               ;; stdlib/doc-syms.tl, which is anyway kept up to date with
+               ;; each release (and is already compiled to stdlib/doc-syms.tlo
+               ;; when genman.txr is run).
+               (("^@\\(output \"share/txr/stdlib/doc-syms\\.tl\"\\).*" line)
+                (string-append "@(do (exit))\n" line)))
+             #t))
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             (substitute* (list "tests/017/realpath.tl"
+                                "tests/017/realpath.expected")
+               (("/usr/bin") "/"))
+             #t))
          (replace 'configure
            ;; ./configure is a hand-written script that can't handle standard
            ;; autotools arguments like CONFIG_SHELL.
@@ -874,14 +954,17 @@ enough to play the original mainframe Zork all the way through.")
              (setenv "txr_shell" (which "bash"))
              (apply invoke "./configure" configure-flags)
              #t))
-         (add-after 'configure 'fix-tests
+         (add-after 'build 'build-doc
            (lambda _
-             (substitute* (list "tests/017/realpath.tl"
-                                "tests/017/realpath.expected")
-               (("/usr/bin") "/"))
+             (invoke "make" "txr-manpage.html" "txr-manpage.pdf")
+             #t))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((doc (string-append (assoc-ref outputs "out")
+                                       "/share/doc/" ,name "-" ,version)))
+               (for-each (lambda (f) (install-file f doc))
+                         '("txr-manpage.html" "txr-manpage.pdf")))
              #t)))))
-    (inputs
-     `(("libffi" ,libffi)))
     (synopsis "General-purpose, multi-paradigm programming language")
     (description
      "TXR is a general-purpose, multi-paradigm programming language.  It
-- 
2.32.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-txr-Update-to-266.patch --]
[-- Type: text/x-patch; name=0002-gnu-txr-Update-to-266.patch, Size: 3033 bytes --]

From c1295a3b83c7d446ea42a683b1384acd5645bfe8 Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul@apatience.com>
Date: Tue, 13 Jul 2021 19:38:12 -0400
Subject: [PATCH 2/2] gnu: txr: Update to 266.

* gnu/packages/lisp.scm (txr)[version]: Update to 266.
[arguments]<#:phases>{inhibit-doc-syms-generation}: Correct the path to
doc-syms.tl to its new location.
{fix-tests}: Fix another test.
{disable-failing-tests}: New phase.
---
 gnu/packages/lisp.scm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 8f3be7dafe..8d2acc81e2 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -906,7 +906,7 @@ the HTML documentation of TXR.")
 (define-public txr
   (package
     (name "txr")
-    (version "263")
+    (version "266")
     (source
      (origin
        (method git-fetch)
@@ -915,7 +915,7 @@ the HTML documentation of TXR.")
              (commit (string-append "txr-" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "14zaziymnbr2ld79x4h7sf88bzzzj82w3xpavmcx7mhwannb2swh"))))
+        (base32 "1k9mj3zaxdsylgnb8g6cq0cmp6420x7fp3nnsqdmds4gh8ib95wn"))))
     (build-system gnu-build-system)
     (native-inputs
      ;; Required to build the documentation.
@@ -938,7 +938,7 @@ the HTML documentation of TXR.")
                ;; stdlib/doc-syms.tl, which is anyway kept up to date with
                ;; each release (and is already compiled to stdlib/doc-syms.tlo
                ;; when genman.txr is run).
-               (("^@\\(output \"share/txr/stdlib/doc-syms\\.tl\"\\).*" line)
+               (("^@\\(output \"stdlib/doc-syms\\.tl\"\\).*" line)
                 (string-append "@(do (exit))\n" line)))
              #t))
          (add-after 'unpack 'fix-tests
@@ -946,6 +946,22 @@ the HTML documentation of TXR.")
              (substitute* (list "tests/017/realpath.tl"
                                 "tests/017/realpath.expected")
                (("/usr/bin") "/"))
+             (substitute* "tests/018/path-test.tl"
+               (("/bin") (dirname (which "sh"))))
+             #t))
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (for-each delete-file
+                       ;; These tests fail because they call external commands
+                       ;; (like ls and cat) that don't run because the forked
+                       ;; child processes' execvp calls cannot find the
+                       ;; hardcoded /bin/sh.
+                       ;; (The tests pass when run manually in the directory
+                       ;; left by --keep-failed.)
+                       (map (lambda (f) (string-append "tests/" f))
+                            '("002/query-1.txr"
+                              "010/json.tl"
+                              "018/process.tl")))
              #t))
          (replace 'configure
            ;; ./configure is a hand-written script that can't handle standard
-- 
2.32.0


  reply	other threads:[~2021-07-13 23:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-11  0:37 [bug#49517] [PATCH] gnu: txr: Build documentation and update to 265 Paul A. Patience
2021-07-12  1:01 ` Paul A. Patience
2021-07-13 23:45   ` Paul A. Patience [this message]
2021-07-17  9:57     ` Guillaume Le Vaillant
2021-07-17 22:51       ` Kaz Kylheku
2021-07-18  3:43         ` Kaz Kylheku
2021-07-18 10:36           ` Guillaume Le Vaillant
2021-07-18 12:59             ` Paul A. Patience
2021-07-20  9:07               ` bug#49517: " Guillaume Le Vaillant
2021-07-18 20:27             ` [bug#49517] " Kaz Kylheku
2021-07-18 21:28               ` Paul A. Patience
2021-07-19 12:08                 ` Guillaume Le Vaillant
2021-07-19 21:31                   ` Kaz Kylheku
2021-07-20  9:18                     ` Guillaume Le Vaillant
2021-07-19  3:23             ` Kaz Kylheku

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='lkKu4cCvlVCKZHf_KZjvAknH_CGNYkXBxzN6ZqKiVi8rt3DSUFUsyo8eyklsX9hu-ax2vNVRa89nuZQeRW_3USrnCs5fwqYqk0vXQssOlqg=@apatience.com' \
    --to=paul@apatience.com \
    --cc=49517@debbugs.gnu.org \
    --cc=kaz@kylheku.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.