From 313cc9f2533f36491e613e83703db16acefcfeb1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 27 May 2024 16:24:46 +0200 Subject: 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 --- gnu/packages/tex.scm | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) 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 @@ (define-public texlive-ptex 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 @@ (define-public texlive-ptex 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") -- cgit v1.2.3