summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2024-05-27 16:24:46 +0200
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:45:22 +0200
commit313cc9f2533f36491e613e83703db16acefcfeb1 (patch)
tree7549bd2be3f9d48abe6abbd0e8fb6449b6e44638
parente161b62314f94bff70139c64a75ff0d9cf9fb656 (diff)
downloadguix-313cc9f2533f36491e613e83703db16acefcfeb1.tar.gz
gnu: Add texlive-ptex-bin.
* gnu/packages/tex.scm (texlive-ptex-bin): New variable.
(texlive-ptex)[propagated-inputs]: Add TEXLIVE-PTEX-BIN.

Change-Id: Ib8ef4d9283cd1bd79f621a864166da56b15bebd2
-rw-r--r--gnu/packages/tex.scm75
1 files changed, 75 insertions, 0 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 8669bcfdcd..cbda3d8a82 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -36397,6 +36397,7 @@ their specific needs.")
            texlive-knuth-lib
            texlive-plain
            texlive-ptex-base
+           texlive-ptex-bin
            texlive-ptex-fonts))
     (home-page "https://ctan.org/pkg/ptex")
     (synopsis "TeX system for publishing in Japanese")
@@ -36406,6 +36407,80 @@ problems in typesetting Japanese.  A manual (in both Japanese and English) is
 distributed as package @code{pTeX-manual}.")
     (license license:bsd-3)))
 
+(define-public texlive-ptex-bin
+  (package
+    (inherit texlive-bin)
+    (name "texlive-ptex-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" '("makejvf" "mendexk" "web2c"))))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons* "--enable-makejvf"
+                 "--enable-mendexk"
+                 (delete "--enable-web2c" #$flags)))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "texk/makejvf"
+                    (invoke "make" "check"))
+                  (with-directory-excursion "texk/mendexk"
+                    (invoke "make" "check")))))
+            (add-after 'build 'build-web2c-binaries
+              (lambda _
+                (with-directory-excursion "texk/web2c"
+                  (for-each (lambda (target) (invoke "make" target))
+                            '("eptex" "pmpost")))))
+            (replace 'install
+              (lambda _
+                (with-directory-excursion "texk/makejvf"
+                  (invoke "make" "install"))
+                (with-directory-excursion "texk/mendexk"
+                  (invoke "make" "install"))
+                ;; Install Web2C parts.
+                (let ((bin (string-append #$output "/bin")))
+                  (with-directory-excursion "texk/web2c"
+                    (for-each (lambda (f) (install-file f bin))
+                              '("eptex" "pmpost")))
+                  (with-directory-excursion bin
+                    (for-each symlink
+                              '("eptex" "pmpost"   "pmpost")
+                              '("ptex"  "pdvitomp" "r-pmpost"))
+                    ;; Some executables are symlinks to TEXLIVE-UPTEX-BIN's.
+                    (let ((uptex #$(this-package-input "texlive-uptex-bin")))
+                      (for-each
+                       symlink
+                       (map (lambda (f) (string-append uptex "/bin/" f))
+                            '("upbibtex" "updvitype" "uppltotf" "uptftopl"))
+                       '("pbibtex" "pdvitype" "ppltotf" "ptftopl")))))))))))
+    (native-inputs (list pkg-config))
+    (inputs
+     (modify-inputs (package-inputs texlive-bin)
+       (append cairo gmp mpfr texlive-libptexenc texlive-uptex-bin)))
+    (home-page (package-home-page texlive-ptex))
+    (synopsis "Binaries for @code{texlive-ptex}")
+    (description
+     "This package provides the binaries for @code{texlive-ptex}.")
+    (license (package-license texlive-ptex))))
+
 (define-public texlive-ptex-base
   (package
     (name "texlive-ptex-base")