all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#53454] [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output.
@ 2022-01-22 19:24 Simon South
  2022-01-22 19:28 ` [bug#53454] [PATCH core-updates 1/1] " Simon South
  2022-01-22 23:19 ` [bug#53454] [PATCH core-updates v2 0/2] " Simon South
  0 siblings, 2 replies; 7+ messages in thread
From: Simon South @ 2022-01-22 19:24 UTC (permalink / raw)
  To: 53454

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@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#53454] [PATCH core-updates 1/1] gnu: texlive-psnfss: Fix build; add "doc" output.
  2022-01-22 19:24 [bug#53454] [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output Simon South
@ 2022-01-22 19:28 ` Simon South
  2022-01-22 19:35   ` Maxime Devos
  2022-01-22 23:19 ` [bug#53454] [PATCH core-updates v2 0/2] " Simon South
  1 sibling, 1 reply; 7+ messages in thread
From: Simon South @ 2022-01-22 19:28 UTC (permalink / raw)
  To: 53454

* 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@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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#53454] [PATCH core-updates 1/1] gnu: texlive-psnfss: Fix build; add "doc" output.
  2022-01-22 19:28 ` [bug#53454] [PATCH core-updates 1/1] " Simon South
@ 2022-01-22 19:35   ` Maxime Devos
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Devos @ 2022-01-22 19:35 UTC (permalink / raw)
  To: Simon South, 53454

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#53454] [PATCH core-updates v2 0/2] gnu: texlive-psnfss: Fix build; add "doc" output.
  2022-01-22 19:24 [bug#53454] [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output Simon South
  2022-01-22 19:28 ` [bug#53454] [PATCH core-updates 1/1] " Simon South
@ 2022-01-22 23:19 ` Simon South
  2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t from custom phase Simon South
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Simon South @ 2022-01-22 23:19 UTC (permalink / raw)
  To: 53454

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@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#53454] [PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t from custom phase.
  2022-01-22 23:19 ` [bug#53454] [PATCH core-updates v2 0/2] " Simon South
@ 2022-01-22 23:19   ` Simon South
  2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 2/2] gnu: texlive-psnfss: Fix build; add "doc" output Simon South
  2022-03-28 10:04   ` bug#53454: [PATCH core-updates 0/1] " Ludovic Courtès
  2 siblings, 0 replies; 7+ messages in thread
From: Simon South @ 2022-01-22 23:19 UTC (permalink / raw)
  To: 53454

* 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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#53454] [PATCH core-updates v2 2/2] gnu: texlive-psnfss: Fix build; add "doc" output.
  2022-01-22 23:19 ` [bug#53454] [PATCH core-updates v2 0/2] " Simon South
  2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t from custom phase Simon South
@ 2022-01-22 23:19   ` Simon South
  2022-03-28 10:04   ` bug#53454: [PATCH core-updates 0/1] " Ludovic Courtès
  2 siblings, 0 replies; 7+ messages in thread
From: Simon South @ 2022-01-22 23:19 UTC (permalink / raw)
  To: 53454

* 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@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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#53454: [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output.
  2022-01-22 23:19 ` [bug#53454] [PATCH core-updates v2 0/2] " Simon South
  2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t from custom phase Simon South
  2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 2/2] gnu: texlive-psnfss: Fix build; add "doc" output Simon South
@ 2022-03-28 10:04   ` Ludovic Courtès
  2 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2022-03-28 10:04 UTC (permalink / raw)
  To: Simon South; +Cc: 53454-done

Hi Simon,

Simon South <simon@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’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-28 10:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 19:24 [bug#53454] [PATCH core-updates 0/1] gnu: texlive-psnfss: Fix build; add "doc" output Simon South
2022-01-22 19:28 ` [bug#53454] [PATCH core-updates 1/1] " Simon South
2022-01-22 19:35   ` Maxime Devos
2022-01-22 23:19 ` [bug#53454] [PATCH core-updates v2 0/2] " Simon South
2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 1/2] gnu: texlive-psnfss: Do not return #t from custom phase Simon South
2022-01-22 23:19   ` [bug#53454] [PATCH core-updates v2 2/2] gnu: texlive-psnfss: Fix build; add "doc" output Simon South
2022-03-28 10:04   ` bug#53454: [PATCH core-updates 0/1] " Ludovic Courtès

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.