From 36d7acf003f14af2203f4a35cdf2a9801cb1c672 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 10 Jun 2023 09:40:38 +0200 Subject: gnu: Deprecate texlive-base in favor of texlive-scheme-basic. * gnu/packages/tex.scm (texlive-base): Deprecate variable. (texlive-updmap.cfg): Use default packages from now deprecated TEXLIVE-BASE. Also remove already implemented TODO. * doc/build.scm (pdf-manual): * gnu/packages/statistics.scm: Replace TEXLIVE-BASE with call to TEXLIVE-UPDMAP.CFG. * guix/profiles.scm (texlive-font-maps): Trigger TeX Live hook whenever a texlive package is included in the manifest. --- guix/profiles.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix/profiles.scm') diff --git a/guix/profiles.scm b/guix/profiles.scm index 6467e464c8..05fa5fa862 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1868,8 +1868,8 @@ (define build (invoke mktexlsr b) (install-file (string-append b "/ls-R") a)))))) - (mlet %store-monad ((texlive-base (manifest-lookup-package manifest "texlive-base"))) - (if (and texlive-base (pair? texlive-inputs)) + (with-monad %store-monad + (if (pair? texlive-inputs) (gexp->derivation "texlive-font-maps" build #:substitutable? #f #:local-build? #t -- cgit v1.2.3 From 0d7e2380b626c7b367ebe4f5d7d7ba8fa487c283 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 12 Jun 2023 10:30:11 +0200 Subject: gnu: Simplify texlive-default-updmap.cfg. * gnu/packages/tex.scm (texlive-default-updmap.cfg): Use TEXLIVE-ORIGIN. (texlive-updmap.cfg): * guix/profiles.scm (texlive-font-maps): Update accordingly. --- gnu/packages/tex.scm | 73 +++++++++++++++++++++------------------------------- guix/profiles.scm | 3 +-- 2 files changed, 31 insertions(+), 45 deletions(-) (limited to 'guix/profiles.scm') diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 19272dbbc5..57de356205 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -4136,16 +4136,11 @@ (define-public texlive-psnfss (define-deprecated-package texlive-latex-psnfss texlive-psnfss) (define-public texlive-default-updmap.cfg - (origin - (method url-fetch) - (uri (string-append "https://tug.org/svn/texlive/tags/" - %texlive-tag "/Master/texmf-dist/web2c/updmap.cfg" - "?revision=" (number->string %texlive-revision))) - (file-name (string-append "updmap.cfg-" - (number->string %texlive-revision))) - (sha256 - (base32 - "0zhpyld702im6352fwp41f2hgfkpj2b4j1kfsjqbkijlcmvb6w2c")))) + (texlive-origin + "updmap.cfg" (number->string %texlive-revision) + (list "web2c/updmap.cfg") + (base32 + "1bb9nmvr14f3lam627mq030hh08h7wsy8i6884q2kvppbpf2a3mf"))) (define-public texlive-updmap.cfg (lambda* (#:optional (packages '())) @@ -4172,16 +4167,7 @@ (define-public texlive-updmap.cfg texlive-tools))) (package (version (number->string %texlive-revision)) - (source (origin - (method url-fetch) - (uri (string-append "https://tug.org/svn/texlive/tags/" - %texlive-tag - "/Master/texmf-dist/web2c/updmap.cfg" - "?revision=" version)) - (file-name "updmap.cfg") - (sha256 - (base32 - "0zhpyld702im6352fwp41f2hgfkpj2b4j1kfsjqbkijlcmvb6w2c")))) + (source texlive-default-updmap.cfg) (name "texlive-updmap.cfg") (build-system copy-build-system) (arguments @@ -4189,33 +4175,34 @@ (define-public texlive-updmap.cfg (guix build utils) (ice-9 popen) (ice-9 textual-ports)) - #:install-plan '(("updmap.cfg" "share/texmf-config/web2c/") - ("map" "share/texmf-dist/fonts/map")) + #:install-plan '(("web2c/updmap.cfg" "share/texmf-config/web2c/") + ("web2c/map" "share/texmf-dist/fonts/map")) #:phases (modify-phases %standard-phases (add-before 'install 'regenerate-updmap.cfg (lambda _ - (make-file-writable "updmap.cfg") - - ;; Disable unavailable map files. - (let* ((port (open-pipe* OPEN_WRITE "updmap-sys" - "--syncwithtrees" - "--nohash" - "--cnffile" "updmap.cfg"))) - (display "Y\n" port) - (when (not (zero? (status:exit-val (close-pipe port)))) - (error "failed to filter updmap.cfg"))) - - ;; Set TEXMFSYSVAR to a sane and writable value; updmap fails - ;; if it cannot create its log file there. - (setenv "TEXMFSYSVAR" (getcwd)) - - ;; Generate maps. - (invoke "updmap-sys" - "--cnffile" "updmap.cfg" - "--dvipdfmxoutputdir" "map/dvipdfmx/updmap/" - "--dvipsoutputdir" "map/dvips/updmap/" - "--pdftexoutputdir" "map/pdftex/updmap/")))))) + (with-directory-excursion "web2c" + (make-file-writable "updmap.cfg") + + ;; Disable unavailable map files. + (let* ((port (open-pipe* OPEN_WRITE "updmap-sys" + "--syncwithtrees" + "--nohash" + "--cnffile" "updmap.cfg"))) + (display "Y\n" port) + (when (not (zero? (status:exit-val (close-pipe port)))) + (error "failed to filter updmap.cfg"))) + + ;; Set TEXMFSYSVAR to a sane and writable value; updmap fails + ;; if it cannot create its log file there. + (setenv "TEXMFSYSVAR" (getcwd)) + + ;; Generate maps. + (invoke "updmap-sys" + "--cnffile" "updmap.cfg" + "--dvipdfmxoutputdir" "map/dvipdfmx/updmap/" + "--dvipsoutputdir" "map/dvips/updmap/" + "--pdftexoutputdir" "map/pdftex/updmap/"))))))) (propagated-inputs (map (lambda (package) (list (package-name package) package)) (append default-packages packages))) diff --git a/guix/profiles.scm b/guix/profiles.scm index 05fa5fa862..30ac0d52e4 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1831,8 +1831,7 @@ (define build (let* ((web2c (string-append #$output "/share/texmf-dist/web2c/")) (maproot (string-append #$output "/share/texmf-dist/fonts/map/")) (updmap.cfg (string-append web2c "updmap.cfg"))) - (mkdir-p web2c) - (copy-file #$updmap.cfg updmap.cfg) + (install-file #$(file-append updmap.cfg "/web2c/updmap.cfg") web2c) (make-file-writable updmap.cfg) (let* ((port (open-pipe* OPEN_WRITE #$(file-append texlive-bin "/bin/updmap-sys") -- cgit v1.2.3 From 9fadbf759c7ae0c4555bf43883f3f0a0d8a4e6a6 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 17 Jun 2023 11:34:23 +0200 Subject: gnu: texlive-bin: Do not install all linked scripts. * gnu/packages/tex.scm (texlive-scripts): Include only core scripts along with their man pages and their dependencies. Also patch them for use in Guix. (texlive-bin): Simplify package. [inputs]: Remove "texlive-extra-src" and "texlive-scripts" inputs. Remove labels from other inputs. [propagated-inputs]: Add TEXLIVE-SCRIPTS. [arguments]: Use G-expressions. <#:configure-flags>: Add "--disable-linked-scripts". <#:phases>: Remove phases relative to scripts. * guix/profiles.scm (texlive-font-maps): Fetch executables from both TEXLIVE-SCRIPTS and TEXLIVE-BIN. * guix/import/texlive.scm (tlpdb-file): Grab file from TEXLIVE-SCRIPTS instead of TEXLIVE-BIN. --- gnu/packages/tex.scm | 650 ++++++++++++++++++++++++------------------------ guix/import/texlive.scm | 8 +- guix/profiles.scm | 14 +- 3 files changed, 333 insertions(+), 339 deletions(-) (limited to 'guix/profiles.scm') diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 91ec097d70..9e7e77b3e7 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -108,15 +108,145 @@ (define-syntax-rule (define-deprecated-package old-name name) (define-deprecated/public old-name name (deprecated-package (symbol->string 'old-name) name))) -(define texlive-scripts - (texlive-origin - "texlive-scripts" (number->string %texlive-revision) - (list "dvips/tetex/" - "fonts/enc/dvips/tetex/" - "fonts/map/dvips/tetex/" - "scripts/texlive/") - (base32 - "0y571gddch111r2chjfkyjsm4zk24xxiv2rcczb5apf6d0g211b9"))) +(define-public texlive-scripts + (package + (name "texlive-scripts") + (version (number->string %texlive-revision)) + ;; We cannot use `texlive-origin' because its locations start out in + ;; "texmf-dist" directory which is one level below "tlpkg" that we also + ;; need to pull here. + (source (origin + (method svn-multi-fetch) + (uri (svn-multi-reference + (url (string-append "svn://www.tug.org/texlive/tags/" + %texlive-tag "/Master/")) + (locations + (list "texmf-dist/doc/man/man1/fmtutil-sys.1" + "texmf-dist/doc/man/man1/fmtutil-sys.man1.pdf" + "texmf-dist/doc/man/man1/fmtutil-user.1" + "texmf-dist/doc/man/man1/fmtutil-user.man1.pdf" + "texmf-dist/doc/man/man1/fmtutil.1" + "texmf-dist/doc/man/man1/fmtutil.man1.pdf" + "texmf-dist/doc/man/man1/install-tl.1" + "texmf-dist/doc/man/man1/install-tl.man1.pdf" + "texmf-dist/doc/man/man1/mktexfmt.1" + "texmf-dist/doc/man/man1/mktexfmt.man1.pdf" + "texmf-dist/doc/man/man1/mktexlsr.1" + "texmf-dist/doc/man/man1/mktexlsr.man1.pdf" + "texmf-dist/doc/man/man1/mktexmf.1" + "texmf-dist/doc/man/man1/mktexmf.man1.pdf" + "texmf-dist/doc/man/man1/mktexpk.1" + "texmf-dist/doc/man/man1/mktexpk.man1.pdf" + "texmf-dist/doc/man/man1/mktextfm.1" + "texmf-dist/doc/man/man1/mktextfm.man1.pdf" + "texmf-dist/doc/man/man1/texhash.1" + "texmf-dist/doc/man/man1/texhash.man1.pdf" + "texmf-dist/doc/man/man1/tlmgr.1" + "texmf-dist/doc/man/man1/tlmgr.man1.pdf" + "texmf-dist/doc/man/man1/updmap-sys.1" + "texmf-dist/doc/man/man1/updmap-sys.man1.pdf" + "texmf-dist/doc/man/man1/updmap-user.1" + "texmf-dist/doc/man/man1/updmap-user.man1.pdf" + "texmf-dist/doc/man/man1/updmap.1" + "texmf-dist/doc/man/man1/updmap.man1.pdf" + "texmf-dist/doc/man/man5/fmtutil.cnf.5" + "texmf-dist/doc/man/man5/fmtutil.cnf.man5.pdf" + "texmf-dist/doc/man/man5/updmap.cfg.5" + "texmf-dist/doc/man/man5/updmap.cfg.man5.pdf" + "texmf-dist/dvips/tetex/" + "texmf-dist/fonts/enc/dvips/tetex/" + "texmf-dist/fonts/map/dvips/tetex/" + "texmf-dist/scripts/texlive/fmtutil-sys.sh" + "texmf-dist/scripts/texlive/fmtutil-user.sh" + "texmf-dist/scripts/texlive/fmtutil.pl" + "texmf-dist/scripts/texlive/mktexlsr.pl" + "texmf-dist/scripts/texlive/mktexmf" + "texmf-dist/scripts/texlive/mktexpk" + "texmf-dist/scripts/texlive/mktextfm" + "texmf-dist/scripts/texlive/tlmgr.pl" + "texmf-dist/scripts/texlive/updmap-sys.sh" + "texmf-dist/scripts/texlive/updmap-user.sh" + "texmf-dist/scripts/texlive/updmap.pl" + "texmf-dist/web2c/fmtutil-hdr.cnf" + "texmf-dist/web2c/updmap-hdr.cfg" + "tlpkg/gpg/" + "tlpkg/installer/config.guess" + "tlpkg/installer/curl/curl-ca-bundle.crt" + "tlpkg/TeXLive/" + "tlpkg/texlive.tlpdb")) + (revision %texlive-revision))) + (sha256 + "1igdbnp37c5ajdp17bmcdgkm5s2fyph5v9gk8svhwaamwazk7xg5"))) + (outputs '("out" "doc")) + (build-system copy-build-system) + (arguments + (list + #:imported-modules `(,@%copy-build-system-modules + (guix build texlive-build-system) + (guix build union)) + #:modules '((guix build copy-build-system) + ((guix build texlive-build-system) #:prefix tex:) + (guix build utils)) + #:install-plan + #~'(("texmf-dist/dvips/" "share/texmf-dist/dvips") + ("texmf-dist/fonts/" "share/texmf-dist/fonts") + ("texmf-dist/scripts/" "share/texmf-dist/scripts") + ("texmf-dist/web2c/" "share/texmf-dist/web2c") + ("tlpkg/" "share/tlpkg")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-scripts + (lambda _ + ;; First patch shell scripts with ".sh" extension. + (with-directory-excursion "texmf-dist" + ((assoc-ref tex:%standard-phases 'patch-shell-scripts))) + ;; Then patch scripts without such extension. + (let ((dirs (map (compose dirname which) + (list "awk" "cat" "grep" "sed")))) + (substitute* + (find-files "texmf-dist/scripts/" "^mktex(mf|pk|tfm)$") + (("^version=" m) + (format #false "PATH=\"~{~a:~}$PATH\"; export PATH~%~a" + dirs m)))) + ;; Make sure that fmtutil can find its Perl modules. + (substitute* "texmf-dist/scripts/texlive/fmtutil.pl" + (("\\$TEXMFROOT/") + (string-append #$output "/share/"))) + ;; Likewise for updmap.pl. + (substitute* "texmf-dist/scripts/texlive/updmap.pl" + (("\\$TEXMFROOT/tlpkg") + (string-append #$output "/share/tlpkg"))) + ;; Likewise for the tlmgr. + (substitute* "texmf-dist/scripts/texlive/tlmgr.pl" + ((".*\\$::installerdir = \\$Master.*" all) + (format #f " $Master = ~s;~%~a" + (string-append #$output "/share") + all))))) + (add-after 'unpack 'fix-fmtutil + ;; The line below generates an error when running "fmtutil". + (lambda _ + (substitute* "texmf-dist/scripts/texlive/fmtutil.pl" + (("require TeXLive::TLWinGoo if .*") "")))) + (add-after 'install 'install-doc + (lambda _ + (let ((doc (string-append #$output:doc "/share/texmf-dist/doc"))) + (mkdir-p doc) + (copy-recursively "texmf-dist/doc/" doc)))) + (add-after 'install-doc 'link-scripts + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion "texmf-dist" + (apply (assoc-ref tex:%standard-phases 'link-scripts) + (list #:outputs outputs + #:link-scripts + (find-files "scripts"))))))))) + (inputs (list perl)) + (home-page "https://www.tug.org/texlive/") + (synopsis "TeX Live infrastructure programs") + (description + "This package provides core TeX Live scripts such as @code{updmap}, +@code{fmtutil}, and @code{tlmgr}. It is is automatically installed alongside +@code{texlive-bin}.") + (license (license:fsf-free "https://www.tug.org/texlive/copying.html")))) (define-public texlive-hyphen-complete (package @@ -359,337 +489,197 @@ (define-public texlive-bin (ice-9 ftw))) (snippet ;; TODO: Unbundle stuff in texk/dvisvgm/dvisvgm-src/libs too. - '(with-directory-excursion "libs" - (let ((preserved-directories '("." ".." "lua53" "luajit" "pplib" "xpdf"))) - ;; Delete bundled software, except Lua which cannot easily be - ;; used as an external dependency, pplib and xpdf which aren't - ;; supported as system libraries (see m4/kpse-xpdf-flags.m4). - (for-each delete-file-recursively - (scandir "." - (lambda (file) - (and (not (member file preserved-directories)) - (eq? 'directory (stat:type (stat file)))))))))))) + #~(with-directory-excursion "libs" + (let ((preserved-directories '("." ".." "lua53" "luajit" "pplib" "xpdf"))) + ;; Delete bundled software, except Lua which cannot easily be + ;; used as an external dependency, pplib and xpdf which aren't + ;; supported as system libraries (see m4/kpse-xpdf-flags.m4). + (for-each delete-file-recursively + (scandir "." + (lambda (file) + (and (not (member file preserved-directories)) + (eq? 'directory (stat:type (stat file)))))))))))) (build-system gnu-build-system) + (native-inputs (list pkg-config)) (inputs - `(("texlive-extra-src" - ,(origin - (method url-fetch) - (uri (string-append "ftp://tug.org/historic/systems/texlive/" - (string-take version 4) - "/texlive-" version "-extra.tar.xz")) - (sha256 - (base32 - "1hiqvdg679yadygf23f37b3dz5ick258k1qcam9nhkhprkx7d9l0")))) - ("config" ,config) - ("texlive-scripts" ,texlive-scripts) - ("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("fontforge" ,fontforge) - ("freetype" ,freetype) - ("gd" ,gd) - ("gmp" ,gmp) - ("ghostscript" ,ghostscript) - ("graphite2" ,graphite2) - ("harfbuzz" ,harfbuzz) - ("icu4c" ,icu4c) - ("libpaper" ,libpaper) - ("libpng" ,libpng) - ("libxaw" ,libxaw) - ("libxt" ,libxt) - ("mpfr" ,mpfr) - ("perl" ,perl) - ("pixman" ,pixman) - ("potrace" ,potrace) - ("python" ,python) - ("ruby" ,ruby-2.7) - ("tcsh" ,tcsh) - ("teckit" ,teckit) - ("zlib" ,zlib) - ("zziplib" ,zziplib))) - (native-inputs - (list pkg-config)) + (list config + cairo + fontconfig + fontforge + freetype + gd + gmp + ghostscript + graphite2 + harfbuzz + icu4c + libpaper + libpng + libxaw + libxt + mpfr + perl + pixman + potrace + python + ruby-2.7 + tcsh + teckit + zlib + zziplib)) + (propagated-inputs (list texlive-scripts)) (arguments - `(#:modules ((guix build gnu-build-system) + (list + #:modules '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (srfi srfi-1) (srfi srfi-26)) - #:out-of-source? #t - #:parallel-tests? #f ;bibtex8.test fails otherwise - #:configure-flags - '("--disable-static" - "--disable-native-texlive-build" - "--enable-shared" - "--with-banner-add=/GNU Guix" - "--with-system-cairo" - "--with-system-freetype2" - "--with-system-gd" - "--with-system-gmp" - "--with-system-graphite2" - "--with-system-harfbuzz" - "--with-system-icu" - "--with-system-libgs" - "--with-system-libpaper" - "--with-system-libpng" - "--with-system-mpfr" - "--with-system-pixman" - "--with-system-potrace" - "--with-system-teckit" - "--with-system-zlib" - "--with-system-zziplib" - ;; LuaJIT is not ported to some architectures yet. - ,@(if (or (target-ppc64le?) - (target-riscv64?)) - '("--disable-luajittex" - "--disable-luajithbtex" - "--disable-mfluajit") - '())) - + #:out-of-source? #t + #:parallel-tests? #f ;bibtex8.test fails otherwise + #:configure-flags + #~(list "--disable-static" + ;; "Linked scripts" are taken care of in their respective + ;; packages. + "--disable-linked-scripts" + "--disable-native-texlive-build" + "--enable-shared" + "--with-banner-add=/GNU Guix" + "--with-system-cairo" + "--with-system-freetype2" + "--with-system-gd" + "--with-system-gmp" + "--with-system-graphite2" + "--with-system-harfbuzz" + "--with-system-icu" + "--with-system-libgs" + "--with-system-libpaper" + "--with-system-libpng" + "--with-system-mpfr" + "--with-system-pixman" + "--with-system-potrace" + "--with-system-teckit" + "--with-system-zlib" + "--with-system-zziplib" + ;; LuaJIT is not ported to some architectures yet. + #$@(if (or (target-ppc64le?) + (target-riscv64?)) + '("--disable-luajittex" + "--disable-luajithbtex" + "--disable-mfluajit") + '())) ;; Disable tests on some architectures to cope with a failure of ;; luajiterr.test. + ;; ;; XXX FIXME fix luajit properly on these architectures. - #:tests? ,(let ((s (or (%current-target-system) - (%current-system)))) - (not (or (string-prefix? "aarch64" s) - (string-prefix? "mips64" s) - (string-prefix? "powerpc64le" s)))) - - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-psutils-test - (lambda _ - ;; This test fails due to a rounding difference with libpaper 1.2: - ;; https://github.com/rrthomas/libpaper/issues/23 - ;; Adjust the expected outcome to account for the minute difference. - (substitute* "texk/psutils/tests/playres.ps" - (("844\\.647799") - "844.647797")))) - (add-after 'unpack 'configure-ghostscript-executable - ;; ps2eps.pl uses the "gswin32c" ghostscript executable on Windows, - ;; and the "gs" ghostscript executable on Unix. It detects Unix by - ;; checking for the existence of the /usr/bin directory. Since - ;; Guix System does not have /usr/bin, it is also detected as Windows. - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "utils/ps2eps/ps2eps-src/bin/ps2eps.pl" - (("gswin32c") "gs")) - (substitute* "texk/texlive/linked_scripts/epstopdf/epstopdf.pl" - (("\"gs\"") - (string-append "\"" (assoc-ref inputs "ghostscript") "/bin/gs\""))))) - (add-after 'unpack 'patch-dvisvgm-build-files - (lambda _ - ;; XXX: Ghostscript is detected, but HAVE_LIBGS is never set, so - ;; the appropriate linker flags are not added. - (substitute* "texk/dvisvgm/configure" - (("^have_libgs=yes" all) - (string-append all "\nHAVE_LIBGS=1"))))) - (add-after 'unpack 'disable-failing-test - (lambda _ - ;; FIXME: This test fails on 32-bit architectures since Glibc 2.28: - ;; . - (substitute* "texk/web2c/omegafonts/check.test" - (("^\\./omfonts -ofm2opl \\$srcdir/tests/check tests/xcheck \\|\\| exit 1") - "./omfonts -ofm2opl $srcdir/tests/check tests/xcheck || exit 77")))) - ,@(if (or (target-ppc32?) - (target-riscv64?)) - ;; Some mendex tests fail on some architectures. - `((add-after 'unpack 'skip-mendex-tests - (lambda _ - (substitute* '("texk/mendexk/tests/mendex.test" - "texk/upmendex/tests/upmendex.test") - (("srcdir/tests/pprecA-0.ind pprecA-0.ind1 \\|\\| exit 1") - "srcdir/tests/pprecA-0.ind pprecA-0.ind1 || exit 77"))))) - '()) - (add-after 'unpack 'unpack-texlive-extra - (lambda* (#:key inputs #:allow-other-keys) - (mkdir "texlive-extra") - (with-directory-excursion "texlive-extra" - (apply (assoc-ref %standard-phases 'unpack) - (list #:source (assoc-ref inputs "texlive-extra-src")))))) - (add-after 'unpack-texlive-extra 'copy-texlive-scripts - (lambda* (#:key inputs #:allow-other-keys) - (mkdir "texlive-scripts") - (with-directory-excursion "texlive-scripts" - (let ((scripts (string-append - (assoc-ref inputs "texlive-scripts") - "/scripts/texlive"))) - (copy-recursively scripts ".")) - ;; Configure the version string for some scripts. - ;; Normally this would be done by Subversion. - ;; See . - (for-each (lambda (file) - (substitute* file - (("\\$Id\\$") - (format #f "$Id: ~a ~a ~a nobody $" - file - ,%texlive-revision - ,%texlive-date)) - (("\\$Revision\\$") - (format #f "$Revision: ~a $" - ,%texlive-revision)) - (("\\$Date\\$") - (format #f "$Date: ~a $" - ,%texlive-date)))) - '("fmtutil.pl" - "mktexlsr" - "mktexlsr.pl" - "mktexmf" - "mktexpk" - "mktextfm" - "tlmgr.pl" - "tlmgrgui.pl" - "updmap.pl"))))) - (add-after 'copy-texlive-scripts 'patch-scripts - (lambda _ - (let* ((scripts (append (find-files "texk/kpathsea" "^mktex") - (find-files "texk/texlive/linked_scripts" - "\\.sh$") - (find-files "texlive-scripts" "\\.sh$"))) - (commands '("awk" "basename" "cat" "grep" "mkdir" "rm" - "sed" "sort" "uname")) - (command-regexp (format #f "\\b(~a)\\b" - (string-join commands "|"))) - (iso-8859-1-encoded-scripts - '("texk/texlive/linked_scripts/texlive-extra/rubibtex.sh" - "texk/texlive/linked_scripts/texlive-extra/rumakeindex.sh"))) - - (define (substitute-commands scripts) - (substitute* scripts - ((command-regexp dummy command) - (which command)))) - - (substitute-commands (lset-difference string= scripts - iso-8859-1-encoded-scripts)) - - (with-fluids ((%default-port-encoding "ISO-8859-1")) - (substitute-commands iso-8859-1-encoded-scripts))))) - ;; When ST_NLINK_TRICK is set, kpathsea attempts to avoid work when - ;; searching files by assuming that a directory with exactly two - ;; links has no subdirectories. This assumption does not hold in our - ;; case, so some directories with symlinked subdirectories would not - ;; be traversed. - (add-after 'patch-scripts 'patch-directory-traversal - (lambda _ - (substitute* "texk/kpathsea/config.h" - (("#define ST_NLINK_TRICK") "")))) - - ,@(if (target-arm32?) - `((add-after 'unpack 'skip-faulty-test - (lambda _ - ;; Skip this faulty test on armhf-linux: - ;; https://issues.guix.gnu.org/54055 - (substitute* '("texk/mendexk/tests/mendex.test" - "texk/upmendex/tests/upmendex.test") - (("^TEXMFCNF=" all) - (string-append "exit 77 # skip\n" all)))))) - '()) - - (add-after 'check 'customize-texmf.cnf - ;; The default texmf.cnf is provided by this package, texlive-bin. - ;; Every variable of interest is set relatively to the GUIX_TEXMF - ;; environment variable defined via a search path specification - ;; further below. The configuration file is patched after the test - ;; suite has run, as it relies on the default configuration to find - ;; its paths (and the GUIX_TEXMF variable isn't set yet). - (lambda _ - ;; The current directory is build/ because of the out-of-tree - ;; build. - (let* ((source (first (scandir ".." (cut string-suffix? - "source" <>)))) - (texmf.cnf (string-append "../" source - "/texk/kpathsea/texmf.cnf"))) - (substitute* texmf.cnf - (("^TEXMFROOT = .*") - "TEXMFROOT = {$GUIX_TEXMF}/..\n") - (("^TEXMF = .*") - "TEXMF = {$GUIX_TEXMF}\n") - (("^%TEXMFCNF = .*") - "TEXMFCNF = {$GUIX_TEXMF}/web2c\n") - ;; Don't truncate lines. - (("^error_line = .*$") "error_line = 254\n") - (("^half_error_line = .*$") "half_error_line = 238\n") - (("^max_print_line = .*$") "max_print_line = 1000\n"))))) - (add-after 'install 'post-install - (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) - (let* ((out (assoc-ref outputs "out")) - (patch-source-shebangs (assoc-ref %standard-phases - 'patch-source-shebangs)) - (share (string-append out "/share")) - (scripts (string-append share - "/texmf-dist/scripts/texlive")) - (source (string-append - "../" (first (scandir ".." (cut string-suffix? - "source" <>))))) - (tl-extra-root (string-append source "/texlive-extra")) - (tl-extra-dir (first - (scandir tl-extra-root - (negate - (cut member <> '("." "..")))))) - (tlpkg-src (string-append tl-extra-root "/" tl-extra-dir - "/tlpkg")) - (config.guess (search-input-file inputs - "/bin/config.guess"))) - - ;; Create symbolic links for the latex variants. We link - ;; lualatex to luahbtex; see issue #51252 for details. - (with-directory-excursion (string-append out "/bin/") - (for-each symlink - '("pdftex" "pdftex" "xetex" "luahbtex") - '("latex" "pdflatex" "xelatex" "lualatex"))) - - ;; Install tlpkg. - (copy-recursively tlpkg-src (string-append share "/tlpkg")) - - ;; Install texlive-scripts and associated files. - (copy-recursively (string-append source "/texlive-scripts") - scripts) - (for-each - (lambda (dir) - (mkdir-p dir) - (copy-recursively (string-append - (assoc-ref inputs "texlive-scripts") - "/" dir) - (string-append share "/texmf-dist/" dir))) - '("dvips" "fonts")) - - ;; Patch them. - (let ((dirs (map dirname (list (which "sed") (which "awk"))))) - (with-directory-excursion scripts - (substitute* '("mktexpk" "mktexmf" "mktexlsr") - (("^version=" m) - (format #false "PATH=\"~{~a:~}$PATH\"; export PATH~%~a" - dirs m))))) - - ;; Make sure that fmtutil can find its Perl modules. - (substitute* (string-append scripts "/fmtutil.pl") - (("\\$TEXMFROOT/") - (string-append share "/"))) - - ;; Likewise for updmap.pl. - (substitute* (string-append scripts "/updmap.pl") - (("\\$TEXMFROOT/tlpkg") - (string-append share "/tlpkg"))) - - ;; Likewise for the tlmgr. - (substitute* (string-append scripts "/tlmgr.pl") - ((".*\\$::installerdir = \\$Master.*" all) - (format #f " $Master = ~s;~%~a" share all))) - - ;; Install the config.guess script, required by tlmgr. - (with-directory-excursion share - (mkdir-p "tlpkg/installer/") - (symlink config.guess "tlpkg/installer/config.guess")) - - ;; texlua shebangs are not patched by the patch-source-shebangs - ;; phase because the texlua executable does not exist at that - ;; time. - (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")) - (with-directory-excursion out - (patch-source-shebangs)) - - ;; The line below generates an error when running "fmtutil". - (substitute* - (string-append share "/texmf-dist/scripts/texlive/fmtutil.pl") - (("require TeXLive::TLWinGoo if .*") "")))))))) + #:tests? (let ((s (or (%current-target-system) + (%current-system)))) + (not (or (string-prefix? "aarch64" s) + (string-prefix? "mips64" s) + (string-prefix? "powerpc64le" s)))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-psutils-test + (lambda _ + ;; This test fails due to a rounding difference with libpaper + ;; 1.2: . + ;; + ;; Adjust the expected outcome to account for the minute + ;; difference. + (substitute* "texk/psutils/tests/playres.ps" + (("844\\.647799") "844.647797")))) + (add-after 'unpack 'configure-ghostscript-executable + ;; ps2eps.pl uses the "gswin32c" ghostscript executable on + ;; Windows, and the "gs" ghostscript executable on Unix. It + ;; detects Unix by checking for the existence of the /usr/bin + ;; directory. Since Guix System does not have /usr/bin, it is + ;; also detected as Windows. + (lambda _ + (substitute* "utils/ps2eps/ps2eps-src/bin/ps2eps.pl" + (("gswin32c") "gs")))) + (add-after 'unpack 'patch-dvisvgm-build-files + (lambda _ + ;; XXX: Ghostscript is detected, but HAVE_LIBGS is never set, so + ;; the appropriate linker flags are not added. + (substitute* "texk/dvisvgm/configure" + (("^have_libgs=yes" all) + (string-append all "\nHAVE_LIBGS=1"))))) + (add-after 'unpack 'disable-failing-test + (lambda _ + ;; FIXME: This test fails on 32-bit architectures since Glibc + ;; 2.28: . + (substitute* "texk/web2c/omegafonts/check.test" + (("^\\./omfonts -ofm2opl \\$srcdir/tests/check tests/xcheck \\|\\| exit 1") + "./omfonts -ofm2opl $srcdir/tests/check tests/xcheck || exit 77")))) + #$@(if (or (target-ppc32?) + (target-riscv64?)) + ;; Some mendex tests fail on some architectures. + `((add-after 'unpack 'skip-mendex-tests + (lambda _ + (substitute* '("texk/mendexk/tests/mendex.test" + "texk/upmendex/tests/upmendex.test") + (("srcdir/tests/pprecA-0.ind pprecA-0.ind1 \\|\\| exit 1") + "srcdir/tests/pprecA-0.ind pprecA-0.ind1 || exit 77"))))) + '()) + ;; When ST_NLINK_TRICK is set, kpathsea attempts to avoid work when + ;; searching files by assuming that a directory with exactly two + ;; links has no subdirectories. This assumption does not hold in our + ;; case, so some directories with symlinked subdirectories would not + ;; be traversed. + (add-after 'unpack 'patch-directory-traversal + (lambda _ + (substitute* "texk/kpathsea/config.h" + (("#define ST_NLINK_TRICK") "")))) + #$@(if (target-arm32?) + `((add-after 'unpack 'skip-faulty-test + (lambda _ + ;; Skip this faulty test on armhf-linux: + ;; https://issues.guix.gnu.org/54055 + (substitute* '("texk/mendexk/tests/mendex.test" + "texk/upmendex/tests/upmendex.test") + (("^TEXMFCNF=" all) + (string-append "exit 77 # skip\n" all)))))) + '()) + (add-after 'check 'customize-texmf.cnf + ;; The default texmf.cnf is provided by this package, texlive-bin. + ;; Every variable of interest is set relatively to the GUIX_TEXMF + ;; environment variable defined via a search path specification + ;; further below. The configuration file is patched after the test + ;; suite has run, as it relies on the default configuration to find + ;; its paths (and the GUIX_TEXMF variable isn't set yet). + (lambda _ + ;; The current directory is build/ because of the out-of-tree + ;; build. + (let* ((source (first (scandir ".." (cut string-suffix? + "source" <>)))) + (texmf.cnf (string-append "../" source + "/texk/kpathsea/texmf.cnf"))) + (substitute* texmf.cnf + (("^TEXMFROOT = .*") + "TEXMFROOT = {$GUIX_TEXMF}/..\n") + (("^TEXMF = .*") + "TEXMF = {$GUIX_TEXMF}\n") + (("^%TEXMFCNF = .*") + "TEXMFCNF = {$GUIX_TEXMF}/web2c\n") + ;; Don't truncate lines. + (("^error_line = .*$") "error_line = 254\n") + (("^half_error_line = .*$") "half_error_line = 238\n") + (("^max_print_line = .*$") "max_print_line = 1000\n"))))) + (add-after 'install 'post-install + (lambda _ + ;; Create symbolic links for the latex variants. We link + ;; lualatex to luahbtex; see issue #51252 for details. + (with-directory-excursion (string-append #$output "/bin/") + (for-each symlink + '("pdftex" "pdftex" "xetex" "luahbtex") + '("latex" "pdflatex" "xelatex" "lualatex"))) + ;; texlua shebangs are not patched by the patch-source-shebangs + ;; phase because the texlua executable does not exist at that + ;; time. + (setenv "PATH" + (string-append (getenv "PATH") ":" #$output "/bin")) + (with-directory-excursion #$output + (assoc-ref %standard-phases 'patch-source-shebangs))))))) (native-search-paths (list (search-path-specification (variable "GUIX_TEXMF") diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index 554258f20d..d4fa8bb674 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -153,20 +153,20 @@ (define* (translate-depends depends #:optional texlive-only) depends))) (define (tlpdb-file) - (define texlive-bin + (define texlive-scripts ;; Resolve this variable lazily so that (gnu packages ...) does not end up ;; in the closure of this module. (module-ref (resolve-interface '(gnu packages tex)) - 'texlive-bin)) + 'texlive-scripts)) (with-store store (run-with-store store (mlet* %store-monad - ((drv (lower-object texlive-bin)) + ((drv (lower-object texlive-scripts)) (built (built-derivations (list drv)))) (match (derivation->output-paths drv) (((names . items) ...) - (return (string-append (first items) + (return (string-append (second items) ;"out" "/share/tlpkg/texlive.tlpdb")))))))) (define tlpdb diff --git a/guix/profiles.scm b/guix/profiles.scm index 30ac0d52e4..35208dd0c9 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1789,6 +1789,8 @@ (define entry->texlive-input '())))) (define texlive-inputs (append-map entry->texlive-input (manifest-entries manifest))) + (define texlive-scripts + (module-ref (resolve-interface '(gnu packages tex)) 'texlive-scripts)) (define texlive-bin (module-ref (resolve-interface '(gnu packages tex)) 'texlive-bin)) (define coreutils @@ -1823,8 +1825,10 @@ (define build ":" #$(file-append grep "/bin") ":" - #$(file-append sed "/bin"))) - (setenv "PERL5LIB" #$(file-append texlive-bin "/share/tlpkg")) + #$(file-append sed "/bin") + ":" + #$(file-append texlive-bin "/bin"))) + (setenv "PERL5LIB" #$(file-append texlive-scripts "/share/tlpkg")) (setenv "GUIX_TEXMF" "/tmp/texlive/share/texmf-dist") ;; Remove invalid maps from config file. @@ -1834,7 +1838,7 @@ (define build (install-file #$(file-append updmap.cfg "/web2c/updmap.cfg") web2c) (make-file-writable updmap.cfg) (let* ((port (open-pipe* OPEN_WRITE - #$(file-append texlive-bin "/bin/updmap-sys") + #$(file-append texlive-scripts "/bin/updmap-sys") "--syncwithtrees" "--nohash" "--force" @@ -1844,7 +1848,7 @@ (define build (error "failed to filter updmap.cfg"))) ;; Generate font maps. - (invoke #$(file-append texlive-bin "/bin/updmap-sys") + (invoke #$(file-append texlive-scripts "/bin/updmap-sys") (string-append "--cnffile=" updmap.cfg) (string-append "--dvipdfmxoutputdir=" maproot "dvipdfmx/updmap") @@ -1862,7 +1866,7 @@ (define build ;; to /tmp and run mktexlsr only once. (let ((a (string-append #$output "/share/texmf-dist")) (b "/tmp/texlive/share/texmf-dist") - (mktexlsr #$(file-append texlive-bin "/bin/mktexlsr"))) + (mktexlsr #$(file-append texlive-scripts "/bin/mktexlsr"))) (copy-recursively a b) (invoke mktexlsr b) (install-file (string-append b "/ls-R") a)))))) -- cgit v1.2.3 From 19fd1004138b60c4479d7516aa0cee261c0b6b57 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 26 Jun 2023 12:00:51 +0200 Subject: gnu: Externalize libkpathsea in texlive and texlive-bin. * gnu/packages/tex.scm (texlive-libkpathsea): New variable. (texlive-bin): Inherit from above. [arguments]<#:configure-flags>: Use "--disable-kpathsea", "--with-system-kpathsea", "--with-kpathsea-includes" and "--with-kpathsea-lib". <#:phases>: Remove phases now handled by the package above. [native-inputs]: Add GROFF-MINIMAL. [propagated-inputs]: Add TEXLIVE-LIBKPATHSEA. (texlive-bin-full): New variable. (texlive-texmf)[build-system]: Use COPY-BUILD-SYSTEM. [arguments]: Set #:INSTALL-PLAN accordingly. Replace TEXLIVE-BIN with TEXLIVE-BIN-FULL. * guix/profiles.scm (texlive-font-maps): Fetch executables from TEXLIVE-LIBKPATHSEA instead of TEXLIVE-BIN. --- gnu/packages/tex.scm | 557 +++++++++++++++++++++++++++++++-------------------- guix/profiles.scm | 10 +- 2 files changed, 350 insertions(+), 217 deletions(-) (limited to 'guix/profiles.scm') diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index c67c037700..e6ad2746aa 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -77,6 +77,7 @@ (define-module (gnu packages tex) #:use-module (gnu packages gd) #:use-module (gnu packages ghostscript) #:use-module (gnu packages graphviz) + #:use-module (gnu packages groff) #:use-module (gnu packages gtk) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) @@ -108,6 +109,96 @@ (define-syntax-rule (define-deprecated-package old-name name) (define-deprecated/public old-name name (deprecated-package (symbol->string 'old-name) name))) +(define-public texlive-libkpathsea + (package + (name "texlive-libkpathsea") + (version "20230313") + (source + (origin + (method url-fetch) + (uri (string-append "ftp://tug.org/historic/systems/texlive/" + (string-take version 4) + "/texlive-" version "-source.tar.xz")) + (sha256 + (base32 + "1fbrkv7g9j6ipmwjx27l8l9l974rmply8bhf7c2iqc6h3q7aly1q")) + (modules '((guix build utils) + (ice-9 ftw))) + (snippet + #~(begin + (with-directory-excursion "libs" + (for-each + delete-file-recursively + (scandir "." + (lambda (file) + (and (not (member file '("." ".."))) + (eq? 'directory (stat:type (stat file)))))))) + (with-directory-excursion "texk" + (let ((preserved-directories '("." ".." "kpathsea"))) + (for-each + delete-file-recursively + (scandir "." + (lambda (file) + (and (not (member file preserved-directories)) + (eq? 'directory (stat:type (stat file))))))))))))) + (build-system gnu-build-system) + (arguments + (list + #:out-of-source? #t + #:configure-flags + #~(list "--disable-static" + "--disable-native-texlive-build" + "--enable-shared" + "--with-banner-add=/GNU Guix" + "--disable-all-pkgs" + "--enable-kpathsea") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'customize-texmf.cnf + ;; The default "texmf.cnf" file is provided by this package. + ;; Every variable of interest is set relatively to the GUIX_TEXMF + ;; environment variable defined via a search path below. + ;; + ;; This phase must happen before the `configure' phase, because + ;; the value of the TEXMFCNF variable (modified along with the + ;; SELFAUTOLOC reference below) is used at compile time to + ;; generate "paths.h" file. + (lambda _ + (substitute* "texk/kpathsea/texmf.cnf" + (("^TEXMFROOT = .*") + "TEXMFROOT = {$GUIX_TEXMF}/..\n") + (("^TEXMF = .*") + "TEXMF = {$GUIX_TEXMF}\n") + (("\\$SELFAUTOLOC(/share/texmf-dist/web2c)" _ suffix) + (string-append #$output suffix)) + ;; Don't truncate lines. + (("^error_line = .*$") "error_line = 254\n") + (("^half_error_line = .*$") "half_error_line = 238\n") + (("^max_print_line = .*$") "max_print_line = 1000\n")))) + (add-after 'unpack 'patch-directory-traversal + ;; When ST_NLINK_TRICK is set, kpathsea attempts to avoid work + ;; when searching files by assuming that a directory with exactly + ;; two links has no subdirectories. This assumption does not hold + ;; in our case, so some directories with symlinked sub-directories + ;; would not be traversed. + (lambda _ + (substitute* "texk/kpathsea/config.h" + (("#define ST_NLINK_TRICK") "")))) + (add-after 'install 'post-install + (lambda _ + (with-directory-excursion "texk/kpathsea" + (invoke "make" "install"))))))) + (native-search-paths + (list (search-path-specification + (variable "GUIX_TEXMF") + (files '("share/texmf-dist"))))) + (home-page "https://www.tug.org/texlive/") + (synopsis "Path searching library") + (description + "Kpathsea is a library whose purpose is to return a filename from a list +of user-specified directories similar to how shells look up executables.") + (license license:lgpl2.1))) + (define-public texlive-scripts (package (name "texlive-scripts") @@ -473,20 +564,11 @@ (define-deprecated-package texlive-ruhyphen texlive-hyphen-complete) (define-deprecated-package texlive-ukrhyph texlive-hyphen-complete) (define-public texlive-bin - (package + (package/inherit texlive-libkpathsea (name "texlive-bin") - (version "20230313") (source (origin - (method url-fetch) - (uri (string-append "ftp://tug.org/historic/systems/texlive/" - (string-take version 4) - "/texlive-" version "-source.tar.xz")) - (sha256 - (base32 - "1fbrkv7g9j6ipmwjx27l8l9l974rmply8bhf7c2iqc6h3q7aly1q")) - (modules '((guix build utils) - (ice-9 ftw))) + (inherit (package-source texlive-libkpathsea)) (snippet ;; TODO: Unbundle stuff in texk/dvisvgm/dvisvgm-src/libs too. #~(with-directory-excursion "libs" @@ -498,36 +580,8 @@ (define-public texlive-bin (scandir "." (lambda (file) (and (not (member file preserved-directories)) - (eq? 'directory (stat:type (stat file)))))))))))) - (build-system gnu-build-system) - (native-inputs (list pkg-config)) - (inputs - (list config - cairo - fontconfig - fontforge - freetype - gd - gmp - ghostscript - graphite2 - harfbuzz - icu4c - libpaper - libpng - libxaw - libxt - mpfr - perl - pixman - potrace - python - ruby-2.7 - tcsh - teckit - zlib - zziplib)) - (propagated-inputs (list texlive-scripts)) + (eq? 'directory + (stat:type (stat file)))))))))))) (arguments (list #:modules '((guix build gnu-build-system) @@ -538,36 +592,41 @@ (define-public texlive-bin #:out-of-source? #t #:parallel-tests? #f ;bibtex8.test fails otherwise #:configure-flags - #~(list "--disable-static" - ;; "Linked scripts" are taken care of in their respective - ;; packages. - "--disable-linked-scripts" - "--disable-native-texlive-build" - "--enable-shared" - "--with-banner-add=/GNU Guix" - "--with-system-cairo" - "--with-system-freetype2" - "--with-system-gd" - "--with-system-gmp" - "--with-system-graphite2" - "--with-system-harfbuzz" - "--with-system-icu" - "--with-system-libgs" - "--with-system-libpaper" - "--with-system-libpng" - "--with-system-mpfr" - "--with-system-pixman" - "--with-system-potrace" - "--with-system-teckit" - "--with-system-zlib" - "--with-system-zziplib" - ;; LuaJIT is not ported to some architectures yet. - #$@(if (or (target-ppc64le?) - (target-riscv64?)) - '("--disable-luajittex" - "--disable-luajithbtex" - "--disable-mfluajit") - '())) + #~(let ((kpathsea #$(this-package-input "texlive-libkpathsea"))) + (list "--with-banner-add=/GNU Guix" + "--enable-shared" + "--disable-native-texlive-build" + "--disable-static" + "--disable-linked-scripts" + "--disable-kpathsea" + "--with-system-cairo" + "--with-system-freetype2" + "--with-system-gd" + "--with-system-gmp" + "--with-system-graphite2" + "--with-system-harfbuzz" + "--with-system-icu" + "--with-system-libgs" + "--with-system-libpaper" + "--with-system-libpng" + "--with-system-mpfr" + "--with-system-pixman" + "--with-system-potrace" + "--with-system-teckit" + "--with-system-zlib" + "--with-system-zziplib" + ;; Help locating external kpathsea. For some reason + ;; PKG-CONFIG is unable to find it. + "--with-system-kpathsea" + (format #f "--with-kpathsea-includes=~a/include" kpathsea) + (format #f "--with-kpathsea-lib=~a/lib" kpathsea) + ;; LuaJIT is not ported to some architectures yet. + #$@(if (or (target-ppc64le?) + (target-riscv64?)) + '("--disable-luajittex" + "--disable-luajithbtex" + "--disable-mfluajit") + '()))) ;; Disable tests on some architectures to cope with a failure of ;; luajiterr.test. ;; @@ -579,6 +638,14 @@ (define-public texlive-bin (string-prefix? "powerpc64le" s)))) #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'locate-external-kpathsea + ;; Despite our best efforts, the configure scripts below is not + ;; able to find external kpathsea. + (lambda _ + (substitute* "texk/web2c/configure" + (("/usr/include /usr/local/include") + (string-append #$(this-package-input "texlive-libkpathsea") + "/include"))))) (add-after 'unpack 'patch-psutils-test (lambda _ ;; This test fails due to a rounding difference with libpaper @@ -621,15 +688,6 @@ (define-public texlive-bin (("srcdir/tests/pprecA-0.ind pprecA-0.ind1 \\|\\| exit 1") "srcdir/tests/pprecA-0.ind pprecA-0.ind1 || exit 77"))))) '()) - ;; When ST_NLINK_TRICK is set, kpathsea attempts to avoid work when - ;; searching files by assuming that a directory with exactly two - ;; links has no subdirectories. This assumption does not hold in our - ;; case, so some directories with symlinked subdirectories would not - ;; be traversed. - (add-after 'unpack 'patch-directory-traversal - (lambda _ - (substitute* "texk/kpathsea/config.h" - (("#define ST_NLINK_TRICK") "")))) #$@(if (target-arm32?) `((add-after 'unpack 'skip-faulty-test (lambda _ @@ -640,31 +698,6 @@ (define-public texlive-bin (("^TEXMFCNF=" all) (string-append "exit 77 # skip\n" all)))))) '()) - (add-after 'check 'customize-texmf.cnf - ;; The default texmf.cnf is provided by this package, texlive-bin. - ;; Every variable of interest is set relatively to the GUIX_TEXMF - ;; environment variable defined via a search path specification - ;; further below. The configuration file is patched after the test - ;; suite has run, as it relies on the default configuration to find - ;; its paths (and the GUIX_TEXMF variable isn't set yet). - (lambda _ - ;; The current directory is build/ because of the out-of-tree - ;; build. - (let* ((source (first (scandir ".." (cut string-suffix? - "source" <>)))) - (texmf.cnf (string-append "../" source - "/texk/kpathsea/texmf.cnf"))) - (substitute* texmf.cnf - (("^TEXMFROOT = .*") - "TEXMFROOT = {$GUIX_TEXMF}/..\n") - (("^TEXMF = .*") - "TEXMF = {$GUIX_TEXMF}\n") - (("^%TEXMFCNF = .*") - "TEXMFCNF = {$GUIX_TEXMF}/web2c\n") - ;; Don't truncate lines. - (("^error_line = .*$") "error_line = 254\n") - (("^half_error_line = .*$") "half_error_line = 238\n") - (("^max_print_line = .*$") "max_print_line = 1000\n"))))) (add-after 'install 'post-install (lambda _ ;; Create symbolic links for the latex variants. We link @@ -680,10 +713,34 @@ (define-public texlive-bin (string-append (getenv "PATH") ":" #$output "/bin")) (with-directory-excursion #$output (assoc-ref %standard-phases 'patch-source-shebangs))))))) - (native-search-paths - (list (search-path-specification - (variable "GUIX_TEXMF") - (files '("share/texmf-dist"))))) + (native-inputs (list groff-minimal pkg-config)) + (inputs + (list cairo + config + fontconfig + fontforge + freetype + gd + ghostscript + gmp + graphite2 + harfbuzz + icu4c + libpaper + libpng + libxaw + libxt + mpfr + perl + pixman + potrace + python + ruby-2.7 + tcsh + teckit + zlib + zziplib)) + (propagated-inputs (list texlive-libkpathsea texlive-scripts)) (synopsis "TeX Live, a package of the TeX typesetting system") (description "TeX Live provides a comprehensive TeX document production system. @@ -910,40 +967,6 @@ (define-public texlive-bidishadowtext a re-implementation of the @code{shadowtext} package adding Bidi support.") (license license:lppl1.3+))) -(define-public texlive-libkpathsea - (package/inherit texlive-bin - (name "texlive-libkpathsea") - (source - (origin - (inherit (package-source texlive-bin)) - (snippet - `(begin - ,(origin-snippet (package-source texlive-bin)) - (with-directory-excursion "texk" - (let ((preserved-directories '("." ".." "kpathsea"))) - (for-each - delete-file-recursively - (scandir "." - (lambda (file) - (and (not (member file preserved-directories)) - (eq? 'directory (stat:type (stat file))))))))))))) - (arguments - (substitute-keyword-arguments (package-arguments texlive-bin) - ((#:configure-flags flags) - `(cons* "--disable-all-pkgs" "--enable-kpathsea" - "--enable-shared" ,flags)) - ((#:phases phases) - `(modify-phases %standard-phases - (add-after 'install 'post-install - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "texk/kpathsea" - (invoke "make" "install")))))))) - (inputs '()) - (synopsis "Path searching library") - (description "kpathsea is a library, whose purpose is to return a filename -from a list of user-specified directories similar to how shells look up -executables. It is maintained as a part of TeX Live."))) - (define-public texlive-alphalph (package (name "texlive-alphalph") @@ -10358,6 +10381,133 @@ (define-public texlive-pdftex (define-deprecated-package texlive-generic-pdftex texlive-pdftex) +(define texlive-bin-full + (package/inherit texlive-bin + (name "texlive-bin-full") + (arguments + (substitute-keyword-arguments (package-arguments texlive-bin) + ((#:configure-flags _) + #~(let ((kpathsea #$(this-package-input "texlive-libkpathsea"))) + (list "--with-banner-add=/GNU Guix" + "--enable-shared" + "--disable-native-texlive-build" + "--disable-static" + "--disable-kpathsea" + "--with-system-cairo" + "--with-system-freetype2" + "--with-system-gd" + "--with-system-gmp" + "--with-system-graphite2" + "--with-system-harfbuzz" + "--with-system-icu" + "--with-system-libgs" + "--with-system-libpaper" + "--with-system-libpng" + "--with-system-mpfr" + "--with-system-pixman" + "--with-system-potrace" + "--with-system-teckit" + "--with-system-zlib" + "--with-system-zziplib" + ;; Help locating external kpathsea. For some reason + ;; PKG-CONFIG is unable to find it. + "--with-system-kpathsea" + (format #f "--with-kpathsea-includes=~a/include" kpathsea) + (format #f "--with-kpathsea-lib=~a/lib" kpathsea) + ;; LuaJIT is not ported to some architectures yet. + #$@(if (or (target-ppc64le?) + (target-riscv64?)) + '("--disable-luajittex" + "--disable-luajithbtex" + "--disable-mfluajit") + '())))) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'install 'symlink-kpathsea-binaries + (lambda _ + (let ((bin (string-append + #$(this-package-input "texlive-libkpathsea") + "/bin")) + (files + '("kpseaccess" "kpsereadlink" "kpsestat" "kpsewhich"))) + (with-directory-excursion (string-append #$output "/bin") + (for-each (lambda (b) (symlink (string-append bin "/" b) b)) + files))))) + (add-after 'install 'merge-core-scripts + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((texlive-scripts + (dirname + (dirname + (search-input-file (or native-inputs inputs) + "tlpkg/texlive.tlpdb")))) + (tlpkg (string-append #$output "/share/tlpkg"))) + ;; "tlpkg" directory is neither provided by texlive-bin nor + ;; by texlive-texmf. + (mkdir-p tlpkg) + (copy-recursively (string-append texlive-scripts "/tlpkg") + tlpkg) + ;; texlive-bin source doesn't provide this Perl script. + ;; Yet, it is referenced in "fmtutil.pl" so we need to move + ;; it here too. + (install-file + (string-append texlive-scripts + "/texmf-dist/scripts/texlive/mktexlsr.pl") + (string-append #$output + "/share/texmf-dist/scripts/texlive"))))) + (add-after 'merge-core-scripts 'patch-core-scripts + (lambda _ + (with-directory-excursion + (string-append #$output "/share/texmf-dist/scripts/texlive") + ;; Make sure that fmtutil can find its Perl modules. + (substitute* "fmtutil.pl" + (("\\$TEXMFROOT/") + (string-append #$output "/share/"))) + ;; Likewise for updmap.pl. + (substitute* "updmap.pl" + (("\\$TEXMFROOT/tlpkg") + (string-append #$output "/share/tlpkg"))) + ;; Likewise for the tlmgr. + (substitute* "tlmgr.pl" + ((".*\\$::installerdir = \\$Master.*" all) + (format #f " $Master = ~s;~%~a" + (string-append #$output "/share") + all)))))) + (add-after 'patch-core-scripts 'patch-shell-scripts + (lambda _ + (with-directory-excursion + (string-append #$output "/share/texmf-dist/scripts") + ;; First patch shell scripts with ".sh" extension. + (let* ((scripts (find-files "." "\\.sh$")) + (commands '("awk" "basename" "cat" "grep" "mkdir" "rm" + "sed" "sort" "uname")) + (command-regexp + (format #f "\\b(~a)\\b" (string-join commands "|"))) + (iso-8859-1-encoded-scripts + '("./texlive-extra/rubibtex.sh" + "./texlive-extra/rumakeindex.sh"))) + (define (substitute-commands scripts) + (substitute* scripts + ((command-regexp dummy command) + (which command)))) + (substitute-commands + (lset-difference string= scripts iso-8859-1-encoded-scripts)) + (with-fluids ((%default-port-encoding "ISO-8859-1")) + (substitute-commands iso-8859-1-encoded-scripts))) + ;; Then patch scripts without such extension. + (let ((dirs (map (compose dirname which) + (list "awk" "cat" "grep" "sed")))) + (substitute* (find-files "texlive" "^mktex(mf|pk|tfm)$") + (("^version=" m) + (format #false "PATH=\"~{~a:~}$PATH\"; export PATH~%~a" + dirs m))))))))))) + (native-inputs + (modify-inputs (package-native-inputs texlive-bin) + (append (package-source texlive-scripts)))) + (inputs + (modify-inputs (package-inputs texlive-bin) + (append texlive-libkpathsea))) + (propagated-inputs '()))) + (define texlive-texmf (package (name "texlive-texmf") @@ -10370,71 +10520,55 @@ (define texlive-texmf (sha256 (base32 "0lqjm11pr9vasvivaci3k9xcmdyd08ldnh31zf8avjjs09xcfkac")))) - (build-system gnu-build-system) - (inputs - (list lua - perl - python - ruby - tcsh - texlive-bin)) + (build-system copy-build-system) (arguments (list - #:modules '((guix build gnu-build-system) + #:modules '((guix build copy-build-system) (guix build utils) + (srfi srfi-1) (srfi srfi-26)) - ;; This package takes 4 GiB, which we can't afford to distribute from ;; our servers. #:substitutable? #f - + #:install-plan #~'(("texmf-dist/" "share/texmf-dist")) #:phases - #~(modify-phases (map (cut assq <> %standard-phases) - '(set-paths unpack patch-source-shebangs)) - (add-after 'unpack 'unset-environment-variables - (lambda _ - (unsetenv "TEXMF") - (unsetenv "TEXMFCNF"))) - (add-after 'patch-source-shebangs 'install - (lambda _ - (let ((share (string-append #$output "/share"))) - (mkdir-p share) - (invoke "mv" "texmf-dist" share)))) + #~(modify-phases %standard-phases (add-after 'install 'texmf-config - (lambda _ + (lambda* (#:key inputs native-inputs #:allow-other-keys) (let* ((share (string-append #$output "/share")) - (texmfroot (string-append share "/texmf-dist/web2c")) - (texmfcnf (string-append texmfroot "/texmf.cnf")) - (fmtutilcnf (string-append texmfroot "/fmtutil.cnf")) - (texlive-bin #$(this-package-input "texlive-bin")) - (texbin (string-append texlive-bin "/bin")) - (tlpkg (string-append texlive-bin "/share/tlpkg"))) + (texmf-dist (string-append share "/texmf-dist")) + (web2c (string-append texmf-dist "/web2c")) + (fmtutil.cnf (string-append web2c "/fmtutil.cnf")) + (texlive-bin + #$(this-package-native-input "texlive-bin-full"))) ;; LuaJIT is not ported to powerpc64* yet. (if #$(target-ppc64le?) - (substitute* fmtutilcnf + (substitute* fmtutil.cnf (("^(luajittex|luajithbtex|mfluajit)" m) (string-append "#! " m)))) - ;; Register SHARE as TEXMFROOT in texmf.cnf. - (substitute* texmfcnf - (("TEXMFROOT = \\$SELFAUTOPARENT") - (string-append "TEXMFROOT = " share)) - (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local") - "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local") - (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL")) ;; Register paths in texmfcnf.lua, needed for context. - (substitute* (string-append texmfroot "/texmfcnf.lua") + (substitute* (string-append web2c "/texmfcnf.lua") (("selfautodir:") #$output) (("selfautoparent:") (string-append share "/"))) ;; Set path to TeXLive Perl modules (setenv "PERL5LIB" - (string-append (getenv "PERL5LIB") ":" tlpkg)) - ;; Configure the texmf-dist tree; inspired from - ;; http://slackbuilds.org/repository/13.37/office/texlive/ - (setenv "PATH" (string-append (getenv "PATH") ":" texbin)) - (setenv "TEXMFCNF" texmfroot) - (invoke "updmap-sys" "--nohash" "--syncwithtrees") - (invoke "mktexlsr") - (invoke "fmtutil-sys" "--all"))))))) + (string-append (getenv "PERL5LIB") ":" + (string-append texlive-bin + "/share/tlpkg"))) + ;; Configure the texmf-dist tree. + (setenv "GUIX_TEXMF" texmf-dist) + (setenv "PATH" + (string-append (getenv "PATH") ":" texlive-bin "/bin:")) + (let ((updmap.cfg (string-append web2c "/updmap.cfg"))) + (invoke (string-append texlive-bin "/bin/updmap-sys") + "--nohash" "--syncwithtrees" + (string-append "--cnffile=" updmap.cfg))) + (invoke (string-append texlive-bin "/bin/fmtutil-sys") + "--cnffile" fmtutil.cnf + "--all" + "--fmtdir" web2c))))))) + (native-inputs (list texlive-bin-full)) + (inputs (list lua perl python-wrapper ruby tcsh)) (properties `((max-silent-time . 9600))) ; don't time out while grafting (synopsis "TeX Live, a package of the TeX typesetting system") (description @@ -10453,52 +10587,51 @@ (define-public texlive (version (package-version texlive-bin)) (source #f) (build-system trivial-build-system) - (inputs - (list bash-minimal ;for wrap-program - texlive-bin - texlive-texmf)) - (native-search-paths - (list (search-path-specification - (variable "TEXMFLOCAL") - (files '("share/texmf-local"))))) (arguments (list #:modules '((guix build utils)) #:builder - ;; Build the union of texlive-bin and texlive-texmf, but take the + ;; Build the union of texlive-bin-full and texlive-texmf, but take the ;; conflicting subdirectory share/texmf-dist from texlive-texmf. #~(begin (use-modules (guix build utils)) - (let ((bin #$(this-package-input "texlive-bin")) - (texmf #$(this-package-input "texlive-texmf")) - (bash #$(this-package-input "bash-minimal"))) + (let ((bin #$(this-package-input "texlive-bin-full")) + (texmf #$(this-package-input "texlive-texmf"))) (mkdir #$output) (with-directory-excursion #$output + ;; "include/" and "lib/" directories. (for-each (lambda (name) (symlink (string-append bin "/" name) name)) '("include" "lib")) + ;; "bin/" directory. (mkdir "bin") (with-directory-excursion "bin" - (setenv "PATH" (string-append bash "/bin")) (for-each - (lambda (name) - (symlink name (basename name)) - (wrap-program - (basename name) - `("TEXMFCNF" = - (,(string-append texmf "/share/texmf-dist/web2c"))))) + (lambda (name) (symlink name (basename name))) (find-files (string-append bin "/bin/") ""))) + ;; "share/info", "share/man", share/texmf-dist/" and + ;; "share/tlpkg/" directories. (mkdir "share") (with-directory-excursion "share" (for-each (lambda (name) (symlink (string-append bin "/share/" name) name)) '("info" "man" "tlpkg")) - (for-each - (lambda (name) - (symlink (string-append texmf "/share/" name) name)) - '("texmf-dist" "texmf-var")))))))) + (symlink (string-append texmf "/share/texmf-dist") + "texmf-dist")) + ;; Now everything is in place, generate ls-R file. + (setenv "PATH" + (string-append + (getenv "PATH") ":" + #$(this-package-input "texlive-bin-full") "/bin")) + (invoke (string-append bin "/bin/mktexlsr"))))))) + (inputs (list texlive-bin-full texlive-texmf)) + (propagated-inputs (list texlive-libkpathsea)) + (native-search-paths + (list (search-path-specification + (variable "TEXMFLOCAL") + (files '("share/texmf-local"))))) (synopsis "TeX Live, a package of the TeX typesetting system") (description "TeX Live provides a comprehensive TeX document production system. diff --git a/guix/profiles.scm b/guix/profiles.scm index 35208dd0c9..75ce2b4d08 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1791,8 +1791,8 @@ (define texlive-inputs (append-map entry->texlive-input (manifest-entries manifest))) (define texlive-scripts (module-ref (resolve-interface '(gnu packages tex)) 'texlive-scripts)) - (define texlive-bin - (module-ref (resolve-interface '(gnu packages tex)) 'texlive-bin)) + (define texlive-libkpathsea + (module-ref (resolve-interface '(gnu packages tex)) 'texlive-libkpathsea)) (define coreutils (module-ref (resolve-interface '(gnu packages base)) 'coreutils)) (define grep @@ -1818,8 +1818,8 @@ (define build #:create-all-directories? #t #:log-port (%make-void-port "w")) - ;; XXX: This is annoying, but it's necessary because texlive-bin - ;; does not provide wrapped executables. + ;; XXX: This is annoying, but it's necessary because + ;; texlive-libkpathsea does not provide wrapped executables. (setenv "PATH" (string-append #$(file-append coreutils "/bin") ":" @@ -1827,7 +1827,7 @@ (define build ":" #$(file-append sed "/bin") ":" - #$(file-append texlive-bin "/bin"))) + #$(file-append texlive-libkpathsea "/bin"))) (setenv "PERL5LIB" #$(file-append texlive-scripts "/share/tlpkg")) (setenv "GUIX_TEXMF" "/tmp/texlive/share/texmf-dist") -- cgit v1.2.3 From 3f8b75b35ca553c46cde34736f57b52aad02af72 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 26 Jun 2023 12:22:32 +0200 Subject: gnu: Remove texlive-default-updmap.cfg. * gnu/packages/tex.scm (texlive-scripts): Provide "updmap.cfg", along with other similar files. (texlive-default-updmap.cfg): Remove variable. (texlive-updmap.cfg)[source]: Use TEXLIVE-SCRIPTS source. [arguments]: Use G-expressions. Adapt #:INSTALL-PLAN according to source change. * guix/profiles.scm (texlive-font-maps): Use "updmap.cfg" provided by TEXLIVE-SCRIPTS instead of now defunct TEXLIVE-DEFAULT-UPDMAP.CFG. --- gnu/packages/tex.scm | 73 +++++++++++++++++++++++++--------------------------- guix/profiles.scm | 9 ++++--- 2 files changed, 40 insertions(+), 42 deletions(-) (limited to 'guix/profiles.scm') diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index e6ad2746aa..1efa5f6f4b 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -260,6 +260,7 @@ (define-public texlive-scripts "texmf-dist/scripts/texlive/updmap.pl" "texmf-dist/web2c/fmtutil-hdr.cnf" "texmf-dist/web2c/updmap-hdr.cfg" + "texmf-dist/web2c/updmap.cfg" "tlpkg/gpg/" "tlpkg/installer/config.guess" "tlpkg/installer/curl/curl-ca-bundle.crt" @@ -267,7 +268,7 @@ (define-public texlive-scripts "tlpkg/texlive.tlpdb")) (revision %texlive-revision))) (sha256 - "191p4rznf19wl9sbjm61v143wap3izhsql6s1bpq1nnbf1p4bakq"))) + "0sqbg5kjpzkpm1fq2c9hpf4f21bvjs3xas944dlbqp44lsqhcmsk"))) (outputs '("out" "doc")) (build-system copy-build-system) (arguments @@ -4948,13 +4949,6 @@ (define-public texlive-psnfss (define-deprecated-package texlive-latex-psnfss texlive-psnfss) -(define-public texlive-default-updmap.cfg - (texlive-origin - "updmap.cfg" (number->string %texlive-revision) - (list "web2c/updmap.cfg") - (base32 - "10b9il84x6vwfns7cvf8jv0bfcjr7icph3mhci9cq088v216k3kb"))) - (define-public texlive-updmap.cfg (lambda* (#:optional (packages '())) "Return a 'texlive-updmap.cfg' package which contains the fonts map @@ -4978,42 +4972,45 @@ (define-public texlive-updmap.cfg texlive-tools))) (package (version (number->string %texlive-revision)) - (source texlive-default-updmap.cfg) + (source (package-source texlive-scripts)) (name "texlive-updmap.cfg") (build-system copy-build-system) (arguments - '(#:modules ((guix build copy-build-system) + (list + #:modules '((guix build copy-build-system) (guix build utils) (ice-9 popen) (ice-9 textual-ports)) - #:install-plan '(("web2c/updmap.cfg" "share/texmf-config/web2c/") - ("web2c/map" "share/texmf-dist/fonts/map")) - #:phases - (modify-phases %standard-phases - (add-before 'install 'regenerate-updmap.cfg - (lambda _ - (with-directory-excursion "web2c" - (make-file-writable "updmap.cfg") - - ;; Disable unavailable map files. - (let* ((port (open-pipe* OPEN_WRITE "updmap-sys" - "--syncwithtrees" - "--nohash" - "--cnffile" "updmap.cfg"))) - (display "Y\n" port) - (when (not (zero? (status:exit-val (close-pipe port)))) - (error "failed to filter updmap.cfg"))) - - ;; Set TEXMFSYSVAR to a sane and writable value; updmap fails - ;; if it cannot create its log file there. - (setenv "TEXMFSYSVAR" (getcwd)) - - ;; Generate maps. - (invoke "updmap-sys" - "--cnffile" "updmap.cfg" - "--dvipdfmxoutputdir" "map/dvipdfmx/updmap/" - "--dvipsoutputdir" "map/dvips/updmap/" - "--pdftexoutputdir" "map/pdftex/updmap/"))))))) + #:install-plan + #~'(("texmf-dist/web2c/updmap.cfg" "share/texmf-config/web2c/") + ("texmf-dist/web2c/map" "share/texmf-dist/fonts/map")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'regenerate-updmap.cfg + (lambda _ + (with-directory-excursion "texmf-dist/web2c" + (make-file-writable "updmap.cfg") + + ;; Disable unavailable map files. + (let* ((port (open-pipe* OPEN_WRITE "updmap-sys" + "--syncwithtrees" + "--nohash" + "--cnffile" "updmap.cfg"))) + (display "Y\n" port) + (when (not (zero? (status:exit-val (close-pipe port)))) + (error "failed to filter updmap.cfg"))) + + ;; Set TEXMFSYSVAR to a sane and writable value; updmap fails + ;; if it cannot create its log file there. + (setenv "TEXMFSYSVAR" (getcwd)) + + ;; Generate maps. + (invoke "updmap-sys" + "--cnffile" "updmap.cfg" + "--dvipdfmxoutputdir" "map/dvipdfmx/updmap/" + "--dvipsoutputdir" "map/dvips/updmap/" + "--pdftexoutputdir" "map/pdftex/updmap/"))))))) + (native-inputs (list texlive-scripts)) (propagated-inputs (map (lambda (package) (list (package-name package) package)) (append default-packages packages))) diff --git a/guix/profiles.scm b/guix/profiles.scm index 75ce2b4d08..d0006dc2bf 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1799,9 +1799,6 @@ (define grep (module-ref (resolve-interface '(gnu packages base)) 'grep)) (define sed (module-ref (resolve-interface '(gnu packages base)) 'sed)) - (define updmap.cfg - (module-ref (resolve-interface '(gnu packages tex)) - 'texlive-default-updmap.cfg)) (define build (with-imported-modules '((guix build utils) (guix build union)) @@ -1835,7 +1832,9 @@ (define build (let* ((web2c (string-append #$output "/share/texmf-dist/web2c/")) (maproot (string-append #$output "/share/texmf-dist/fonts/map/")) (updmap.cfg (string-append web2c "updmap.cfg"))) - (install-file #$(file-append updmap.cfg "/web2c/updmap.cfg") web2c) + (install-file #$(file-append texlive-scripts + "/share/texmf-dist/web2c/updmap.cfg") + web2c) (make-file-writable updmap.cfg) (let* ((port (open-pipe* OPEN_WRITE #$(file-append texlive-scripts "/bin/updmap-sys") @@ -1867,6 +1866,8 @@ (define build (let ((a (string-append #$output "/share/texmf-dist")) (b "/tmp/texlive/share/texmf-dist") (mktexlsr #$(file-append texlive-scripts "/bin/mktexlsr"))) + ;; Ignore original "updmap.cfg" from texlive-scripts input. + (delete-file "/tmp/texlive/share/texmf-dist/web2c/updmap.cfg") (copy-recursively a b) (invoke mktexlsr b) (install-file (string-append b "/ls-R") a)))))) -- cgit v1.2.3