1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-12 08:01:50 +00:00

fontconfig: only generate cache on native compilation

We can’t cross-compile the cache, so just skip it for now.
This commit is contained in:
Matthew Bauer 2020-03-04 11:23:36 -05:00
parent 6c5983a291
commit 8a5059e1cc

View file

@ -45,6 +45,9 @@ let
# generate the font cache setting file for a fontconfig version # generate the font cache setting file for a fontconfig version
# use latest when no version is passed # use latest when no version is passed
# When cross-compiling, we cant generate the cache, so we skip the
# <cachedir> part. fontconfig still works but is a little slower in
# looking things up.
makeCacheConf = { version ? null }: makeCacheConf = { version ? null }:
let let
fcPackage = if version == null fcPackage = if version == null
@ -60,11 +63,13 @@ let
<fontconfig> <fontconfig>
<!-- Font directories --> <!-- Font directories -->
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)} ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
<!-- Pre-generated font caches --> <!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir> <cachedir>${cache}</cachedir>
${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) '' ${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
<cachedir>${cache32}</cachedir> <cachedir>${cache32}</cachedir>
''} ''}
''}
</fontconfig> </fontconfig>
''; '';