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

commit 15a3fa24055677c52dce3c1c9ceea3bf0caabc28
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
AuthorDate: Sun Jun 2 01:02:06 2024 +0200

    gnu: Add texlive-luajittex-bin.
    
    * gnu/packages/tex.scm (texlive-luajittex-bin): New variable.
    (texlive-luajittex)[arguments]<#:create-formats>: Build "luajithbtex" and
    "luajittex" formats only on platforms where LuaJIT is supported.
    [propagated-inputs]: Likewise, only add TEXLIVE-LUAJITTEX-BIN on such
    platforms.
    
    Change-Id: I7ce923642268e0db12802f368042703f14dc4a64
---
 gnu/packages/tex.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index f5d97f04e4..a042d8f453 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -40083,16 +40083,24 @@ environments and another with all extracted 
environments converted to
               "1qfbg0r6gsncgymh00yc83kcayd4m7bvryap8f63sm9s9bzfl6yv")))
     (outputs '("out" "doc"))
     (build-system texlive-build-system)
-    (arguments (list #:create-formats #~(list "luajithbtex" "luajittex")))
+    (arguments
+     (list #:create-formats
+           #~(and (not #$(or (target-ppc64le?)
+                             (target-riscv64?)))
+                  (list "luajithbtex" "luajittex"))))
     (propagated-inputs
-     (list texlive-cm
-           texlive-etex
-           texlive-hyphen-complete
-           texlive-knuth-lib
-           texlive-luatex
-           texlive-plain
-           texlive-tex-ini-files
-           texlive-unicode-data))
+     (append (if (or (target-ppc64le?)
+                     (target-riscv64?))
+                 '()
+                 (list texlive-luajittex-bin))
+             (list texlive-cm
+                   texlive-etex
+                   texlive-hyphen-complete
+                   texlive-knuth-lib
+                   texlive-luatex
+                   texlive-plain
+                   texlive-tex-ini-files
+                   texlive-unicode-data)))
     (home-page "https://ctan.org/pkg/luajittex";)
     (synopsis "LuaTeX with JIT compiler, with and without HarfBuzz")
     (description
@@ -40100,6 +40108,44 @@ environments and another with all extracted 
environments converted to
 without HarfBuzz.")
     (license license:gpl2)))
 
+(define-public texlive-luajittex-bin
+  (package
+    (inherit texlive-bin)
+    (name "texlive-luajittex-bin")
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons* "--disable-web2c"
+                 "--enable-luajithbtex"
+                 "--enable-luajittex"
+                 (delete "--disable-luajittex"
+                         (delete "--disable-luajithbtex"
+                                 (delete "--enable-web2c" #$flags)))))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'force-libs-build
+              ;; Once Web2C is disabled, build process refuses to build
+              ;; libraries in the source tree, in particular pplib and luajit,
+              ;; required for LuajitTeX.  The following change forces building
+              ;; them.
+              (lambda _
+                (substitute* "libs/configure"
+                  (("x\\$need_(pplib|luajit)") "xyes"))))
+            (add-after 'install 'install-binaries
+              (lambda _
+                (with-directory-excursion "texk/web2c"
+                  (invoke "make" "luajittex")
+                  (invoke "make" "luajithbtex")
+                  (let ((bin (string-append #$output "/bin")))
+                    (install-file ".libs/luajittex" bin)
+                    (install-file ".libs/luajithbtex" bin)))))))))
+    (native-inputs (list pkg-config))
+    (home-page (package-home-page texlive-luajittex))
+    (synopsis "Binaries for @code{texlive-luajittex}")
+    (description
+     "This package provides the binaries for @code{texlive-luajittex}.")
+    (license (package-license texlive-luajittex))))
+
 (define-public texlive-match-parens
   (package
     (name "texlive-match-parens")

Reply via email to