diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 16086263e3..eb433a23ab 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Ivan Gankevich ;;; Copyright © 2021 Julien Lepiller +;;; Copyright © 2021 Thiago Jung Bauermann ;;; ;;; This file is part of GNU Guix. ;;; @@ -3387,7 +3388,12 @@ (define-public texlive-latex-l3kernel "0w82d5a4d3rc950ms6ymj4mpw5ndz6qs5x53szcfgzgjxsns9l4w")))) (build-system texlive-build-system) (arguments - '(#:tex-directory "latex/l3kernel")) + '(#:tex-directory "latex/l3kernel" + #:tex-engine "tex" + #:tex-format #f + #:texlive-latex-base #f)) + (native-inputs + `(("texlive-docstrip" ,texlive-docstrip))) (home-page "https://www.ctan.org/pkg/l3kernel") (synopsis "LaTeX3 programmers’ interface") (description @@ -3412,6 +3418,9 @@ (define-public texlive-latex-l3packages (build-system texlive-build-system) (arguments '(#:tex-directory "latex/l3packages" + #:tex-engine "tex" + #:tex-format #f + #:texlive-latex-base #f ;; build-targets must be specified manually since they are in ;; sub-directories. #:build-targets '("l3keys2e.ins" "xparse.ins" "xfrac.ins" "xfp.ins" "xtemplate.ins") @@ -3433,6 +3442,8 @@ (define-public texlive-latex-l3packages ":"))) #t))) )) + (native-inputs + `(("texlive-docstrip" ,texlive-docstrip))) (propagated-inputs `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel))) (home-page "https://www.ctan.org/pkg/l3packages") diff --git a/guix/build-system/texlive.scm b/guix/build-system/texlive.scm index 005aad819e..f3838e580a 100644 --- a/guix/build-system/texlive.scm +++ b/guix/build-system/texlive.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2021 Ludovic Courtès +;;; Copyright © 2021 Thiago Jung Bauermann ;;; ;;; This file is part of GNU Guix. ;;; @@ -116,7 +117,9 @@ (define private-keywords ;; Keep the standard inputs of 'gnu-build-system'. ,@(standard-packages))) (build-inputs `(("texlive-bin" ,texlive-bin) - ("texlive-latex-base" ,texlive-latex-base) + ,@(if texlive-latex-base + `(("texlive-latex-base" ,texlive-latex-base)) + '()) ,@native-inputs)) (outputs outputs) (build texlive-build) @@ -128,6 +131,7 @@ (define* (texlive-build name inputs (tests? #f) tex-directory (build-targets #f) + (tex-engine #f) ;; FIXME: This would normally default to "luatex" but ;; LuaTeX has a bug where sometimes it corrupts the @@ -158,6 +162,9 @@ (define builder #:source #+source #:tex-directory #$tex-directory #:build-targets #$build-targets + #:tex-engine #$(if tex-engine + tex-engine + tex-format) #:tex-format #$tex-format #:system #$system #:tests? #$tests? diff --git a/guix/build/texlive-build-system.scm b/guix/build/texlive-build-system.scm index 4c255700bb..353fb934a6 100644 --- a/guix/build/texlive-build-system.scm +++ b/guix/build/texlive-build-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021 Thiago Jung Bauermann ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,16 +35,17 @@ (define-module (guix build texlive-build-system) ;; ;; Code: -(define (compile-with-latex format file) - (invoke format +(define (compile-with-latex engine format file) + (invoke engine "-interaction=nonstopmode" "-output-directory=build" - (string-append "&" format) + (if format (string-append "&" format) "-ini") file)) -(define* (build #:key inputs build-targets tex-format #:allow-other-keys) +(define* (build #:key inputs build-targets tex-engine tex-format + #:allow-other-keys) (mkdir "build") - (for-each (cut compile-with-latex tex-format <>) + (for-each (cut compile-with-latex tex-engine tex-format <>) (if build-targets build-targets (scandir "." (cut string-suffix? ".ins" <>)))))