From: Simon South <simon@simonsouth.net>
To: 53454@debbugs.gnu.org
Subject: [bug#53454] [PATCH core-updates 1/1] gnu: texlive-psnfss: Fix build; add "doc" output.
Date: Sat, 22 Jan 2022 14:28:43 -0500 [thread overview]
Message-ID: <6de30164aa84e0b7ce303177637f995b177e1778.1642877796.git.simon@simonsouth.net> (raw)
In-Reply-To: <cover.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(-)
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
next prev parent reply other threads:[~2022-01-22 19:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-01-22 19:35 ` [bug#53454] [PATCH core-updates 1/1] " 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
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=6de30164aa84e0b7ce303177637f995b177e1778.1642877796.git.simon@simonsouth.net \
--to=simon@simonsouth.net \
--cc=53454@debbugs.gnu.org \
/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.