ngz pushed a commit to branch tex-team
in repository guix.

commit 8bfffca3621e75b13fed19725714efc1607c1407
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
AuthorDate: Sun May 12 19:10:38 2024 +0200

    gnu: texlive-dviljk: Build executables.
    
    * gnu/packages/tex.scm (texlive-dviljk): Inherit from TEXLIVE-BIN.
    [source]: Build from a trimmed TEXLIVE-SOURCE.
    [arguments]: Build `dviljk' as a single package.
    
    Change-Id: I6c046ce05ee87f1956f4d3c910c599b6c01389a6
---
 gnu/packages/tex.scm | 57 ++++++++++++++++++++++++++++++++++------------------
 1 file changed, 38 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index b20edf8c02..8b28f00484 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -34501,26 +34501,45 @@ file.  It also supports XeTeX XDV format.")
 
 (define-public texlive-dviljk
   (package
+    (inherit texlive-bin)
     (name "texlive-dviljk")
-    (version (number->string %texlive-revision))
-    (source (texlive-origin
-             name version
-             (list "doc/man/man1/dvihp.1"
-                   "doc/man/man1/dvihp.man1.pdf"
-                   "doc/man/man1/dvilj.1"
-                   "doc/man/man1/dvilj.man1.pdf"
-                   "doc/man/man1/dvilj2p.1"
-                   "doc/man/man1/dvilj2p.man1.pdf"
-                   "doc/man/man1/dvilj4.1"
-                   "doc/man/man1/dvilj4.man1.pdf"
-                   "doc/man/man1/dvilj4l.1"
-                   "doc/man/man1/dvilj4l.man1.pdf"
-                   "doc/man/man1/dvilj6.1"
-                   "doc/man/man1/dvilj6.man1.pdf")
-             (base32
-              "03pi78c8ghy2gghzk1ffrvf5x7h8c1r0pv5pcspwxz365x2rsbjw")))
-    (outputs '("out" "doc"))
-    (build-system texlive-build-system)
+    (source
+     (origin
+       (inherit texlive-source)
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(let ((delete-other-directories
+                 (lambda (root keep)
+                   (with-directory-excursion root
+                     (for-each
+                      delete-file-recursively
+                      (scandir
+                       "."
+                       (lambda (file)
+                         (and (not (member file (append keep '("." ".."))))
+                              (eq? 'directory (stat:type (stat file)))))))))))
+            (delete-other-directories "libs" '())
+            (delete-other-directories "utils" '())
+            (delete-other-directories "texk" '("dviljk"))))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons* "--disable-all-pkgs"
+                 "--enable-dviljk"
+                 (delete "--disable-dviljk" #$flags)))
+       ((#:phases _)
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "texk/dviljk"
+                    (invoke "make" "check")))))
+            (replace 'install
+              (lambda _
+                (with-directory-excursion "texk/dviljk"
+                  (invoke "make" "install"))))))))
+    (inputs '())
     (home-page "https://ctan.org/pkg/dviljk";)
     (synopsis "DVI to Laserjet output")
     (description

Reply via email to