[PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output.

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • Simon South
Owner
unassigned
Submitted by
Simon South
Severity
normal
S
S
Simon South wrote on 22 Jan 2022 20:24
(address . guix-patches@gnu.org)
cover.1642877796.git.simon@simonsouth.net
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.

[1] texlive-base, texlive-charter and texlive-tiny.

--
Simon South
simon@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
S
S
Simon South wrote on 22 Jan 2022 20:28
[PATCH core-updates 1/1] gnu: texlive-psnfss: Fix build; add "doc" output.
(address . 53454@debbugs.gnu.org)
6de30164aa84e0b7ce303177637f995b177e1778.1642877796.git.simon@simonsouth.net
* 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(-)

Toggle diff (61 lines)
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@spbu.ru>
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2021 Thiago Jung Bauermann <bauermann@kolabnow.com>
+;;; Copyright © 2022 Simon South <simon@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
M
M
Maxime Devos wrote on 22 Jan 2022 20:35
a3c501efe42fa39080da4b337bef338aca2b883e.camel@telenet.be
Simon South schreef op za 22-01-2022 om 14:28 [-0500]:
Toggle quote (4 lines)
> +             (add-after 'install 'chdir-back
> +               (lambda _
> +                 (chdir "../../..") #t))

Trailing #t are no longer necessary.

Greetings,
Maxime.
S
S
Simon South wrote on 23 Jan 2022 00:19
[PATCH core-updates v2 0/2] gnu: texlive-psnfss: Fix build; add "doc" output.
(address . 53454@debbugs.gnu.org)
cover.1642892611.git.simon@simonsouth.net
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.

[1] texlive-base, texlive-charter and texlive-tiny.

--
Simon South
simon@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
S
S
Simon South wrote on 23 Jan 2022 00:19
[PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t from custom phase.
(address . 53454@debbugs.gnu.org)
c882572c5138f85b467dee529ee5b8e4c2bdef97.1642892611.git.simon@simonsouth.net
* 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(-)

Toggle diff (15 lines)
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
S
S
Simon South wrote on 23 Jan 2022 00:19
[PATCH core-updates v2 2/2] gnu: texlive-psnfss: Fix build; add "doc" output.
(address . 53454@debbugs.gnu.org)
2bd3449f24d3d85e9bce5e0bdd7c69408a1aa06f.1642892611.git.simon@simonsouth.net
* 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(-)

Toggle diff (59 lines)
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@spbu.ru>
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2021 Thiago Jung Bauermann <bauermann@kolabnow.com>
+;;; Copyright © 2022 Simon South <simon@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
L
L
Ludovic Courtès wrote on 28 Mar 2022 12:04
Re: bug#53454: [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output.
(name . Simon South)(address . simon@simonsouth.net)(address . 53454-done@debbugs.gnu.org)
87v8vy4cmb.fsf_-_@gnu.org
Hi Simon,

Simon South <simon@simonsouth.net> skribis:

Toggle quote (5 lines)
> 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’.
Closed
?