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

commit d944a8612aef8c7990bac106b3eef2028a59668b
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
AuthorDate: Tue May 28 00:39:50 2024 +0200

    gnu: Add texlive-upmendex-bin.
    
    * gnu/packages/tex.scm (texlive-upmendex-bin): New variable.
    (texlive-upmendex)[propagated-inputs]: Add TEXLIVE-UPMENDEX-BIN.
    
    Change-Id: I4212732a116800942577fc2e1fa7b8179fe094b0
---
 gnu/packages/tex.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 827358af7e..c89b0aab1d 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -46062,6 +46062,7 @@ chosen and developed with an emphasis on drawing graphs 
in economics.")
               "0mj8nmqr3z7b802kvjmnkckq89l694an7s639yghf3b9b5v7xihx")))
     (outputs '("out" "doc"))
     (build-system texlive-build-system)
+    (propagated-inputs (list texlive-upmendex-bin))
     (home-page "https://ctan.org/pkg/upmendex";)
     (synopsis "Multilingual index processor")
     (description
@@ -46087,6 +46088,52 @@ Zhuyin) for Chinese Han scripts (Hanzi ideographs).
 @end itemize")
     (license license:bsd-3)))
 
+(define-public texlive-upmendex-bin
+  (package
+    (inherit texlive-bin)
+    (name "texlive-upmendex-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/" '("upmendex"))))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons "--enable-upmendex" (delete "--enable-web2c" #$flags)))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "texk/upmendex"
+                    (invoke "make" "check")))))
+            (replace 'install
+              (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                (with-directory-excursion "texk/upmendex"
+                  (invoke "make" "install"))))))))
+    (native-inputs (list pkg-config))
+    (inputs (list icu4c texlive-libkpathsea))
+    (propagated-inputs '())
+    (home-page (package-home-page texlive-upmendex))
+    (synopsis "Binary for @code{texlive-upmendex}")
+    (description
+     "This package provides the binary for @code{texlive-upmendex}.")
+    (license (package-license texlive-upmendex))))
+
 (define-public texlive-utf8mex
   (package
     (name "texlive-utf8mex")

Reply via email to