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

commit 3abbb3be642388f2ed5232c78fe060b7e7bf313f
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
AuthorDate: Sun May 12 18:43:11 2024 +0200

    gnu: texlive-dvipdfmx: Build executables.
    
    * gnu/packages/tex.scm (texlive-dvipdfmx-bin): New variable.
    (texlive-dvipdfmx)[arguments]<#:phases>: Include executables.
    [native-inputs]: Add TEXLIVE-DVIPDFMX-BIN.
    
    Change-Id: Ic10c4f74505689c1e1ba59103c7811de922362dc
---
 gnu/packages/tex.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index d647f2c006..b4bcce3b8e 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -38856,6 +38856,47 @@ running the script, you should have a working font 
installation in your local
 TeX tree.")
     (license license:lppl)))
 
+(define texlive-dvipdfmx-bin
+  (package
+    (inherit texlive-bin)
+    (name "texlive-dvipdfmx-bin")
+    (source
+     (origin
+       (inherit texlive-source)
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(let ((delete-other-directories
+                 (lambda (root dirs)
+                   (with-directory-excursion root
+                     (for-each
+                      delete-file-recursively
+                      (scandir "."
+                               (lambda (file)
+                                 (and (not (member file (append '("." "..") 
dirs)))
+                                      (eq? 'directory (stat:type (stat 
file)))))))))))
+            (delete-other-directories "libs" '())
+            (delete-other-directories "utils" '())
+            (delete-other-directories "texk" '("dvipdfm-x"))))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons* "--disable-all-pkgs"
+                 "--enable-dvipdfm-x"
+                 (delete "--disable-dvipdfm-x" #$flags)))
+       ((#:phases _)
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "texk/dvipdfm-x"
+                    (invoke "make" "check")))))
+            (replace 'install
+              (lambda _
+                (with-directory-excursion "texk/dvipdfm-x"
+                  (invoke "make" "install"))))))))
+    (inputs (list libpaper libpng))))
+
 (define-public texlive-dvipdfmx
   (package
     (name "texlive-dvipdfmx")
@@ -38890,7 +38931,14 @@ TeX tree.")
           (add-after 'unpack 'delete-map-file
             ;; This map file is supposed to be generated in a profile hook.
             (lambda _
-              (delete-file "fonts/map/dvipdfmx/updmap/kanjix.map"))))))
+              (delete-file "fonts/map/dvipdfmx/updmap/kanjix.map")))
+          (add-after 'install 'install-bin
+            (lambda _
+              (let ((source
+                     #$(this-package-native-input "texlive-dvipdfmx-bin")))
+                (copy-recursively (string-append source "/bin")
+                                  (string-append #$output "/bin"))))))))
+    (native-inputs (list texlive-dvipdfmx-bin))
     (propagated-inputs (list texlive-glyphlist))
     (home-page "https://ctan.org/pkg/dvipdfmx";)
     (synopsis "Extended version of dvipdfm")

Reply via email to