texlive.combine: wrap with FONTCONFIG_FILE

This is neccessary for XeTeX to find the fonts distributed with
TeXLive.

The fontconfig file generated by makeFontsConf is almost identical to the one
from the fontconfig package and /etc/fonts/fonts.conf on NixOS -- it only adds
the specified font directories. In particular this means that all the actual
configuration files in /etc/fonts/conf.d are still included and there also is a
/usr/share/fonts font directory entry for use with non-NixOS linuxes, so
it's unlikely that this breaks someone's setup.
This commit is contained in:
apfelkuchen06 2023-04-25 22:14:03 +02:00
parent c432c85c53
commit 5f96aa9436
2 changed files with 7 additions and 5 deletions

View file

@ -196,7 +196,11 @@ in (buildEnv {
makeWrapper "$target" "$link" \
--prefix PATH : "${gnused}/bin:${gnugrep}/bin:${coreutils}/bin:$out/bin:${perl}/bin" \
--prefix PERL5LIB : "$PERL5LIB" \
--set-default TEXMFCNF "$TEXMFCNF"
--set-default TEXMFCNF "$TEXMFCNF" \
--set-default FONTCONFIG_FILE "${
# neccessary for XeTeX to find the fonts distributed with texlive
makeFontsConf { fontDirectories = [ "${texmfroot}/texmf-dist/fonts" ]; }
}"
# avoid using non-nix shebang in $target by calling interpreter
if [[ "$(head -c 2 "$target")" = "#!" ]]; then
@ -311,5 +315,3 @@ in (buildEnv {
''
;
}).overrideAttrs (_: { allowSubstitutes = true; })
# TODO: make TeX fonts visible by fontconfig: it should be enough to install an appropriate file
# similarly, deal with xe(la)tex font visibility?

View file

@ -5,7 +5,7 @@
{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv
, callPackage, ghostscript_headless, harfbuzz
, makeWrapper, python3, ruby, perl, gnused, gnugrep, coreutils
, libfaketime
, libfaketime, makeFontsConf
, useFixedHashes ? true
, recurseIntoAttrs
}:
@ -24,7 +24,7 @@ let
# function for creating a working environment from a set of TL packages
combine = import ./combine.nix {
inherit bin combinePkgs buildEnv lib makeWrapper writeText
stdenv python3 ruby perl gnused gnugrep coreutils libfaketime;
stdenv python3 ruby perl gnused gnugrep coreutils libfaketime makeFontsConf;
ghostscript = ghostscript_headless;
};