diff options
| author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2025-02-10 10:35:26 +0100 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2025-05-06 11:25:06 +0200 |
| commit | 01be89717732966266d25bf8c167cd8def76ba19 (patch) | |
| tree | fb347719b389f5c409862804f615cbfbf534831d | |
| parent | 31a6b4a4f93195230c4019d5087f64aad80d0729 (diff) | |
gnu: texlive-updmap.cfg: Provide a full TeX Live tree.
* gnu/packages/tex.scm: (texlive-updmap.cfg): Provide a full TeX Live tree
instead of the font maps only. Activate it by generating a ls-R file. Also
limit propagated inputs to the bare minimum, i.e, texlive-libkpathsea.
[synopsis, documentation]: Update it so as to reflect the new nature of the
generated package.
(texlive-polyglossia, texlive-arabxetex)[native-inputs]:
Make sure texlive-updmap.cfg only contains TeX Live inputs as it doesn’t
propagate its arguments anymore.
Change-Id: I91e5e851a88c67f40215a07ae95138099edfe1a6
| -rw-r--r-- | gnu/packages/tex.scm | 139 |
1 files changed, 92 insertions, 47 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 48ca21a4fea..1a37c6c188c 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> | 15 | ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> |
| 16 | ;;; Copyright © 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com> | 16 | ;;; Copyright © 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com> |
| 17 | ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> | 17 | ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
| 18 | ;;; Copyright © 2021-2024 Nicolas Goaziou <mail@nicolasgoaziou.fr> | 18 | ;;; Copyright © 2021-2025 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
| 19 | ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net> | 19 | ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net> |
| 20 | ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> | 20 | ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> |
| 21 | ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru> | 21 | ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru> |
| @@ -1297,57 +1297,102 @@ documentation in the TeX format." | |||
| 1297 | (build-system copy-build-system) | 1297 | (build-system copy-build-system) |
| 1298 | (arguments | 1298 | (arguments |
| 1299 | (list | 1299 | (list |
| 1300 | #:imported-modules `(,@%copy-build-system-modules | ||
| 1301 | (guix build union)) | ||
| 1300 | #:modules '((guix build copy-build-system) | 1302 | #:modules '((guix build copy-build-system) |
| 1303 | (guix build union) | ||
| 1301 | (guix build utils) | 1304 | (guix build utils) |
| 1305 | (ice-9 match) | ||
| 1302 | (ice-9 popen) | 1306 | (ice-9 popen) |
| 1303 | (ice-9 textual-ports)) | 1307 | (ice-9 textual-ports) |
| 1308 | (srfi srfi-1)) | ||
| 1304 | #:install-plan | 1309 | #:install-plan |
| 1305 | #~'(("texmf-dist/web2c/updmap.cfg" "share/texmf-config/web2c/") | 1310 | #~'(("texmf-dist/web2c/updmap.cfg" "share/texmf-dist/web2c/")) |
| 1306 | ("texmf-dist/web2c/mktex.cnf" "share/texmf-config/web2c/") | ||
| 1307 | ("texmf-dist/web2c/map" "share/texmf-dist/fonts/map")) | ||
| 1308 | #:phases | 1311 | #:phases |
| 1309 | #~(modify-phases %standard-phases | 1312 | #~(modify-phases %standard-phases |
| 1310 | (add-after 'unpack 'generate-mktex.cnf | 1313 | (add-before 'unpack 'initialize-tree |
| 1311 | ;; When building a package, mktex programs try to create files | 1314 | (lambda* (#:key inputs #:allow-other-keys) |
| 1312 | ;; in TEXMFVAR, which is unavailable. Force creating those | 1315 | ;; Build complete TeX Live tree in #$output, barring the |
| 1313 | ;; files in the working directory instead. | 1316 | ;; files going to be regenerated. |
| 1314 | (lambda _ | 1317 | (let ((texlive-outputs |
| 1315 | (with-directory-excursion "texmf-dist/web2c" | 1318 | (filter-map |
| 1316 | (with-output-to-file "mktex.cnf" | 1319 | (match-lambda |
| 1317 | (lambda _ (display ": ${MT_DESTROOT=''}")))))) | 1320 | (`(,label . ,dir) |
| 1321 | (and (string-prefix? "texlive-" label) | ||
| 1322 | dir))) | ||
| 1323 | inputs))) | ||
| 1324 | (union-build #$output texlive-outputs | ||
| 1325 | #:create-all-directories? #t | ||
| 1326 | #:log-port (%make-void-port "w"))) | ||
| 1327 | ;; Remove files that are going to be regenerated. | ||
| 1328 | (with-directory-excursion | ||
| 1329 | (string-append #$output "/share/texmf-dist") | ||
| 1330 | (for-each (lambda (file) | ||
| 1331 | (when (file-exists? file) (delete-file file))) | ||
| 1332 | (list "fonts/map/dvipdfmx/updmap/kanjix.map" | ||
| 1333 | "fonts/map/dvips/updmap/builtin35.map" | ||
| 1334 | "fonts/map/dvips/updmap/download35.map" | ||
| 1335 | "fonts/map/dvips/updmap/ps2pk.map" | ||
| 1336 | "fonts/map/dvips/updmap/psfonts.map" | ||
| 1337 | "fonts/map/dvips/updmap/psfonts_pk.map" | ||
| 1338 | "fonts/map/dvips/updmap/psfonts_t1.map" | ||
| 1339 | "fonts/map/pdftex/updmap/pdftex.map" | ||
| 1340 | "fonts/map/pdftex/updmap/pdftex_dl14.map" | ||
| 1341 | "fonts/map/pdftex/updmap/pdftex_ndl14.map" | ||
| 1342 | "web2c/updmap.cfg"))))) | ||
| 1318 | (add-before 'install 'regenerate-updmap.cfg | 1343 | (add-before 'install 'regenerate-updmap.cfg |
| 1319 | (lambda _ | 1344 | (lambda _ |
| 1320 | (with-directory-excursion "texmf-dist/web2c" | 1345 | ;; Set TEXMFSYSVAR to a sane and writable value; updmap |
| 1321 | (make-file-writable "updmap.cfg") | 1346 | ;; fails if it cannot create its log file. |
| 1347 | (setenv "TEXMFSYSVAR" (getcwd)) | ||
| 1348 | ;; Limit scope of TEXMF to the current tree, and skip ls-R | ||
| 1349 | ;; database usage since it has not been generated yet. | ||
| 1350 | (setenv "TEXMF" "{$TEXMFSYSVAR,$TEXMFDIST}") | ||
| 1322 | 1351 | ||
| 1352 | (with-directory-excursion "texmf-dist/web2c" | ||
| 1323 | ;; Disable unavailable map files. | 1353 | ;; Disable unavailable map files. |
| 1324 | (let* ((port (open-pipe* OPEN_WRITE "updmap-sys" | 1354 | (let ((port (open-pipe* OPEN_WRITE "updmap-sys" |
| 1325 | "--syncwithtrees" | 1355 | "--syncwithtrees" |
| 1326 | "--nohash" | 1356 | "--nohash" |
| 1327 | "--cnffile" "updmap.cfg"))) | 1357 | "--cnffile" "updmap.cfg"))) |
| 1328 | (display "Y\n" port) | 1358 | (display "Y\n" port) |
| 1329 | (when (not (zero? (status:exit-val (close-pipe port)))) | 1359 | (when (not (zero? (status:exit-val (close-pipe port)))) |
| 1330 | (error "failed to filter updmap.cfg"))) | 1360 | (error "failed to filter updmap.cfg"))) |
| 1331 | |||
| 1332 | ;; Set TEXMFSYSVAR to a sane and writable value; updmap | ||
| 1333 | ;; fails if it cannot create its log file. | ||
| 1334 | (setenv "TEXMFSYSVAR" (getcwd)) | ||
| 1335 | |||
| 1336 | ;; Generate maps. | 1361 | ;; Generate maps. |
| 1337 | (invoke "updmap-sys" | 1362 | (let ((root (string-append #$output |
| 1338 | "--cnffile" "updmap.cfg" | 1363 | "/share/texmf-dist/fonts/map/"))) |
| 1339 | "--dvipdfmxoutputdir" "map/dvipdfmx/updmap/" | 1364 | (invoke "updmap-sys" |
| 1340 | "--dvipsoutputdir" "map/dvips/updmap/" | 1365 | "--cnffile" "updmap.cfg" |
| 1341 | "--pdftexoutputdir" "map/pdftex/updmap/"))))))) | 1366 | "--dvipdfmxoutputdir" |
| 1367 | (string-append root "dvipdfmx/updmap/") | ||
| 1368 | "--dvipsoutputdir" | ||
| 1369 | (string-append root "dvips/updmap/") | ||
| 1370 | "--pdftexoutputdir" | ||
| 1371 | (string-append root "pdftex/updmap/")))))) | ||
| 1372 | (add-after 'regenerate-updmap.cfg 'regenerate-ls-R | ||
| 1373 | (lambda _ | ||
| 1374 | ;; Generate ls-R database for local tree. Unfortunately, | ||
| 1375 | ;; "mktexlsr" doesn't preserve alphabetic order, probably | ||
| 1376 | ;; because it is used on symlinks. Use a lower level | ||
| 1377 | ;; equivalent of that command. | ||
| 1378 | (with-directory-excursion | ||
| 1379 | (string-append #$output "/share/texmf-dist") | ||
| 1380 | (with-output-to-file "ls-R" | ||
| 1381 | (lambda () | ||
| 1382 | (invoke "ls" "-1LAR" "./"))))))))) | ||
| 1342 | (native-inputs (list texlive-scripts)) | 1383 | (native-inputs (list texlive-scripts)) |
| 1343 | (propagated-inputs (map (lambda (package) | 1384 | (inputs (map (lambda (package) |
| 1344 | (list (package-name package) package)) | 1385 | (list (package-name package) package)) |
| 1345 | (append default-packages packages))) | 1386 | (append default-packages packages))) |
| 1387 | ;; Propagate libkpathsea in order to populate GUIX_TEXMF when | ||
| 1388 | ;; building the package using this one as an input. | ||
| 1389 | (propagated-inputs (list texlive-libkpathsea)) | ||
| 1346 | (home-page (package-home-page texlive-bin)) | 1390 | (home-page (package-home-page texlive-bin)) |
| 1347 | (synopsis "TeX Live fonts map configuration") | 1391 | (synopsis "TeX Live autonomous tree") |
| 1348 | (description "This package contains the fonts map configuration file | 1392 | (description |
| 1349 | generated for the base TeX Live packages as well as, optionally, user-provided | 1393 | "This package contains an autonomous TeX Live consisting of base |
| 1350 | ones.") | 1394 | packages as well as, optionally, user-provided ones. It is meant to be added |
| 1395 | as a package native input, in order to build TeX documentation.") | ||
| 1351 | (license (delete-duplicates | 1396 | (license (delete-duplicates |
| 1352 | (fold (lambda (package result) | 1397 | (fold (lambda (package result) |
| 1353 | (match (package-license package) | 1398 | (match (package-license package) |
| @@ -67408,13 +67453,13 @@ with traditional TeX as well as with Unicode aware variants.") | |||
| 67408 | (string-append (getcwd) ":" | 67453 | (string-append (getcwd) ":" |
| 67409 | (getenv "GUIX_TEXMF")))))))) | 67454 | (getenv "GUIX_TEXMF")))))))) |
| 67410 | (native-inputs | 67455 | (native-inputs |
| 67411 | (list (texlive-updmap.cfg | 67456 | (list font-dejavu |
| 67412 | (list font-dejavu | 67457 | font-gnu-freefont |
| 67413 | font-gnu-freefont | 67458 | font-linuxlibertine |
| 67414 | font-linuxlibertine | 67459 | font-sil-ezra |
| 67415 | font-sil-ezra | 67460 | fontconfig |
| 67416 | fontconfig | 67461 | (texlive-updmap.cfg |
| 67417 | texlive-amiri | 67462 | (list texlive-amiri |
| 67418 | texlive-babel | 67463 | texlive-babel |
| 67419 | texlive-bidi | 67464 | texlive-bidi |
| 67420 | texlive-booktabs | 67465 | texlive-booktabs |
| @@ -78422,10 +78467,10 @@ the @code{psnfss} distribution.") | |||
| 78422 | (("(set(main|mono|sans)font(\\[.*?])?\\{)[^}]+}" _ prefix) | 78467 | (("(set(main|mono|sans)font(\\[.*?])?\\{)[^}]+}" _ prefix) |
| 78423 | (string-append prefix "FreeSans}")))))))) | 78468 | (string-append prefix "FreeSans}")))))))) |
| 78424 | (native-inputs | 78469 | (native-inputs |
| 78425 | (list (texlive-updmap.cfg | 78470 | (list font-gnu-freefont |
| 78426 | (list fontconfig | 78471 | fontconfig |
| 78427 | font-gnu-freefont | 78472 | (texlive-updmap.cfg |
| 78428 | texlive-amsmath | 78473 | (list texlive-amsmath |
| 78429 | texlive-amsfonts | 78474 | texlive-amsfonts |
| 78430 | texlive-bidi | 78475 | texlive-bidi |
| 78431 | texlive-etoolbox | 78476 | texlive-etoolbox |
