GNU bug report logs - #53454
[PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output.

Previous Next

Package: guix-patches;

Reported by: Simon South <simon <at> simonsouth.net>

Date: Sat, 22 Jan 2022 19:25:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53454 in the body.
You can then email your comments to 53454 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53454; Package guix-patches. (Sat, 22 Jan 2022 19:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon South <simon <at> simonsouth.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 22 Jan 2022 19:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon South <simon <at> simonsouth.net>
To: guix-patches <at> gnu.org
Subject: [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build;
 add "doc" output.
Date: Sat, 22 Jan 2022 14:24:01 -0500
This patch fixes the texlive-psnfss package, adding a number of missing files
as well as a "doc" output with the package's PDF documentation.

The current texlive-psnfss package is clearly incomplete: It contains only the
package's source and its generated .sty files, the latter of which are
actually included twice.  Mostly this is due to the package definition not
chdir'ing back out of a work directory before the "copy-files" phase runs.

This patch adds the missing installation steps, which include arranging files
in the output to match the instructions in the package's README file.[0]

I've tested this as best I can: The package and its immediate dependencies[1]
build fine on both x86-64 and AArch64, and the updated package now works as
expected with the TeX source I'm using.

[0] https://ctan.math.ca/tex-archive/macros/latex/required/psnfss/README
[1] texlive-base, texlive-charter and texlive-tiny.

--
Simon South
simon <at> simonsouth.net


Simon South (1):
  gnu: texlive-psnfss: Fix build; add "doc" output.

 gnu/packages/tex.scm | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)


base-commit: 80194d9e47f9f50602a5a97ecd33fb9a95dfe03d
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53454; Package guix-patches. (Sat, 22 Jan 2022 19:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 53454 <at> debbugs.gnu.org (full text, mbox):

From: Simon South <simon <at> simonsouth.net>
To: 53454 <at> debbugs.gnu.org
Subject: [PATCH core-updates 1/1] gnu: texlive-psnfss: Fix build;
 add "doc" output.
Date: Sat, 22 Jan 2022 14:28:43 -0500
* gnu/packages/tex.scm (texlive-psnfss)[outputs]: Add "doc".
[arguments]<phases>: Add "chdir-back", "clean-installed-files" and
"move-doc-files" phases to ensure files are correctly arranged in package's
outputs, matching installation instructions in README.
---
 gnu/packages/tex.scm | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index ebb7f86552..a81d326b6d 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich <at> spbu.ru>
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Thiago Jung Bauermann <bauermann <at> kolabnow.com>
+;;; Copyright © 2022 Simon South <simon <at> simonsouth.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4089,6 +4090,7 @@ (define-public texlive-psnfss
                     "11f14dzhwsy4pli21acccip43d36nf3pac33ihjffnps1i2mhqkd"))))
     (package
       (inherit template)
+      (outputs '("out" "doc"))
       (arguments
        (substitute-keyword-arguments (package-arguments template)
          ((#:tex-directory _ #t)
@@ -4097,7 +4099,37 @@ (define-public texlive-psnfss
           `(modify-phases ,phases
              (add-after 'unpack 'chdir
                (lambda _
-                 (chdir "source/latex/psnfss") #t))))))
+                 (chdir "source/latex/psnfss") #t))
+             (add-after 'install 'chdir-back
+               (lambda _
+                 (chdir "../../..") #t))
+             (add-after 'chdir-back 'clean-installed-files
+               (lambda _
+                 ;; Remove the generated .sty files from the build area as
+                 ;; these were already copied to the default output in the
+                 ;; "install" phase.
+                 (delete-file-recursively "source/latex/psnfss/build")
+                 #t))
+             (add-after 'clean-installed-files 'move-doc-files
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (let* ((doc (assoc-ref outputs "doc"))
+                        (doc-root (string-append doc "/share/texmf-dist"))
+                        (doc-path "doc/latex/psnfss")
+                        (source-path "source/latex/psnfss"))
+                   ;; Move the PDF documentation to the "doc" output.
+                   (let* ((file-name "psnfss2e.pdf")
+                          (source (string-append doc-path "/" file-name))
+                          (target-dir (string-append doc-root "/" doc-path)))
+                     (mkdir-p target-dir)
+                     (copy-file source
+                                (string-append target-dir "/" file-name))
+                     (delete-file source))
+
+                   ;; Keep the remaining files together with the package's
+                   ;; source, as per the installation instructions.
+                   (copy-recursively doc-path source-path)
+                   (delete-file-recursively "doc"))
+                 #t))))))
       (native-inputs
        (list texlive-cm))
       (home-page "https://www.ctan.org/pkg/psnfss")
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53454; Package guix-patches. (Sat, 22 Jan 2022 19:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 53454 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Simon South <simon <at> simonsouth.net>, 53454 <at> debbugs.gnu.org
Subject: Re: [bug#53454] [PATCH core-updates 1/1] gnu: texlive-psnfss: Fix
 build; add "doc" output.
Date: Sat, 22 Jan 2022 20:35:42 +0100
Simon South schreef op za 22-01-2022 om 14:28 [-0500]:
> +             (add-after 'install 'chdir-back
> +               (lambda _
> +                 (chdir "../../..") #t))

Trailing #t are no longer necessary.

Greetings,
Maxime.





Information forwarded to guix-patches <at> gnu.org:
bug#53454; Package guix-patches. (Sat, 22 Jan 2022 23:20:01 GMT) Full text and rfc822 format available.

Message #14 received at 53454 <at> debbugs.gnu.org (full text, mbox):

From: Simon South <simon <at> simonsouth.net>
To: 53454 <at> debbugs.gnu.org
Subject: [PATCH core-updates v2 0/2] gnu: texlive-psnfss: Fix build;
 add "doc" output.
Date: Sat, 22 Jan 2022 18:19:22 -0500
Here's v2 of this fix for the texlive-psnfss package.  This version omits the
trailing "#t" from phases, based on Maxime's feedback, and adds a commit that
removes the "#t" from the existing "chdir" phase.  Other than a small tweak to
the commit message in the second patch everything else is unchanged from v1.

Here's the original description:

This patch fixes the texlive-psnfss package, adding a number of missing files
as well as a "doc" output with the package's PDF documentation.

The current texlive-psnfss package is clearly incomplete: It contains only the
package's source and its generated .sty files, the latter of which are
actually included twice.  Mostly this is due to the package definition not
chdir'ing back out of a work directory before the "copy-files" phase runs.

This patch adds the missing installation steps, which include arranging files
in the output to match the instructions in the package's README file.[0]

I've tested this as best I can: The package and its immediate dependencies[1]
build fine on both x86-64 and AArch64, and the updated package now works as
expected with the TeX source I'm using.

[0] https://ctan.math.ca/tex-archive/macros/latex/required/psnfss/README
[1] texlive-base, texlive-charter and texlive-tiny.

--
Simon South
simon <at> simonsouth.net


Simon South (2):
  gnu: texlive-psnfss: Do not return #t from custom phase.
  gnu: texlive-psnfss: Fix build; add "doc" output.

 gnu/packages/tex.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)


base-commit: 80194d9e47f9f50602a5a97ecd33fb9a95dfe03d
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53454; Package guix-patches. (Sat, 22 Jan 2022 23:20:02 GMT) Full text and rfc822 format available.

Message #17 received at 53454 <at> debbugs.gnu.org (full text, mbox):

From: Simon South <simon <at> simonsouth.net>
To: 53454 <at> debbugs.gnu.org
Subject: [PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t
 from custom phase.
Date: Sat, 22 Jan 2022 18:19:23 -0500
* gnu/packages/tex.scm (texlive-psnfss)[arguments]<#:phases>: Remove
trailing #t from "chdir" phase.
---
 gnu/packages/tex.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index ebb7f86552..9649b1361b 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -4097,7 +4097,7 @@ (define-public texlive-psnfss
           `(modify-phases ,phases
              (add-after 'unpack 'chdir
                (lambda _
-                 (chdir "source/latex/psnfss") #t))))))
+                 (chdir "source/latex/psnfss")))))))
       (native-inputs
        (list texlive-cm))
       (home-page "https://www.ctan.org/pkg/psnfss")
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53454; Package guix-patches. (Sat, 22 Jan 2022 23:20:02 GMT) Full text and rfc822 format available.

Message #20 received at 53454 <at> debbugs.gnu.org (full text, mbox):

From: Simon South <simon <at> simonsouth.net>
To: 53454 <at> debbugs.gnu.org
Subject: [PATCH core-updates v2 2/2] gnu: texlive-psnfss: Fix build;
 add "doc" output.
Date: Sat, 22 Jan 2022 18:19:24 -0500
* gnu/packages/tex.scm (texlive-psnfss)[outputs]: Add "doc".
[arguments]<#:phases>: Add "chdir-back", "clean-installed-files" and
"move-doc-files" phases to ensure files are correctly arranged in package's
outputs, matching installation instructions in README.
---
 gnu/packages/tex.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 9649b1361b..5ac4012e36 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich <at> spbu.ru>
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Thiago Jung Bauermann <bauermann <at> kolabnow.com>
+;;; Copyright © 2022 Simon South <simon <at> simonsouth.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4089,6 +4090,7 @@ (define-public texlive-psnfss
                     "11f14dzhwsy4pli21acccip43d36nf3pac33ihjffnps1i2mhqkd"))))
     (package
       (inherit template)
+      (outputs '("out" "doc"))
       (arguments
        (substitute-keyword-arguments (package-arguments template)
          ((#:tex-directory _ #t)
@@ -4097,7 +4099,35 @@ (define-public texlive-psnfss
           `(modify-phases ,phases
              (add-after 'unpack 'chdir
                (lambda _
-                 (chdir "source/latex/psnfss")))))))
+                 (chdir "source/latex/psnfss")))
+             (add-after 'install 'chdir-back
+               (lambda _
+                 (chdir "../../..")))
+             (add-after 'chdir-back 'clean-installed-files
+               (lambda _
+                 ;; Remove the generated .sty files from the build area as
+                 ;; these were already copied to the default output in the
+                 ;; "install" phase.
+                 (delete-file-recursively "source/latex/psnfss/build")))
+             (add-after 'clean-installed-files 'move-doc-files
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (let* ((doc (assoc-ref outputs "doc"))
+                        (doc-root (string-append doc "/share/texmf-dist"))
+                        (doc-path "doc/latex/psnfss")
+                        (source-path "source/latex/psnfss"))
+                   ;; Move the PDF documentation to the "doc" output.
+                   (let* ((file-name "psnfss2e.pdf")
+                          (source (string-append doc-path "/" file-name))
+                          (target-dir (string-append doc-root "/" doc-path)))
+                     (mkdir-p target-dir)
+                     (copy-file source
+                                (string-append target-dir "/" file-name))
+                     (delete-file source))
+
+                   ;; Keep the remaining files together with the package's
+                   ;; source, as per the installation instructions.
+                   (copy-recursively doc-path source-path)
+                   (delete-file-recursively "doc"))))))))
       (native-inputs
        (list texlive-cm))
       (home-page "https://www.ctan.org/pkg/psnfss")
-- 
2.34.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 28 Mar 2022 10:05:01 GMT) Full text and rfc822 format available.

Notification sent to Simon South <simon <at> simonsouth.net>:
bug acknowledged by developer. (Mon, 28 Mar 2022 10:05:01 GMT) Full text and rfc822 format available.

Message #25 received at 53454-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Simon South <simon <at> simonsouth.net>
Cc: 53454-done <at> debbugs.gnu.org
Subject: Re: bug#53454: [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix
 build; add "doc" output.
Date: Mon, 28 Mar 2022 12:04:12 +0200
Hi Simon,

Simon South <simon <at> simonsouth.net> skribis:

> Here's v2 of this fix for the texlive-psnfss package.  This version omits the
> trailing "#t" from phases, based on Maxime's feedback, and adds a commit that
> removes the "#t" from the existing "chdir" phase.  Other than a small tweak to
> the commit message in the second patch everything else is unchanged from v1.

Pushed in ‘core-updates’ as 08bb73749e55a8b8078062a0ab6f4f0eed53a475.

Thank you and sorry for the delay!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 Apr 2022 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.