nixos/fonts: ship fontconfig caches even for cross-compiled hosts (#391305)
This commit is contained in:
commit
b64ec1944e
@ -58,7 +58,7 @@ let
|
|||||||
<fontconfig>
|
<fontconfig>
|
||||||
<!-- Font directories -->
|
<!-- Font directories -->
|
||||||
${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.packages)}
|
${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.packages)}
|
||||||
${lib.optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
|
${lib.optionalString (pkgs.stdenv.hostPlatform.emulatorAvailable pkgs.buildPackages) ''
|
||||||
<!-- Pre-generated font caches -->
|
<!-- Pre-generated font caches -->
|
||||||
<cachedir>${cache}</cachedir>
|
<cachedir>${cache}</cachedir>
|
||||||
${lib.optionalString (pkgs.stdenv.hostPlatform.isx86_64 && cfg.cache32Bit) ''
|
${lib.optionalString (pkgs.stdenv.hostPlatform.isx86_64 && cfg.cache32Bit) ''
|
||||||
|
|||||||
@ -1,13 +1,20 @@
|
|||||||
{
|
{
|
||||||
runCommand,
|
buildPackages,
|
||||||
lib,
|
|
||||||
fontconfig,
|
fontconfig,
|
||||||
|
lib,
|
||||||
|
runCommand,
|
||||||
|
stdenv,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
fontconfig' = fontconfig;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
fontconfig ? fontconfig',
|
||||||
fontDirectories,
|
fontDirectories,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
runCommand "fc-cache"
|
runCommand "fc-cache"
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [ fontconfig.bin ];
|
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
allowSubstitutes = false;
|
allowSubstitutes = false;
|
||||||
passAsFile = [ "fontDirs" ];
|
passAsFile = [ "fontDirs" ];
|
||||||
@ -29,8 +36,11 @@ runCommand "fc-cache"
|
|||||||
cat "$fontDirsPath" >> fonts.conf
|
cat "$fontDirsPath" >> fonts.conf
|
||||||
echo "</fontconfig>" >> fonts.conf
|
echo "</fontconfig>" >> fonts.conf
|
||||||
|
|
||||||
|
# N.B.: fc-cache keys its cache entries by architecture.
|
||||||
|
# We must invoke the host `fc-cache` (not the build fontconfig) if we want
|
||||||
|
# the cache to be usable by the host.
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
fc-cache -sv
|
${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe' fontconfig "fc-cache"} -sv
|
||||||
|
|
||||||
# This is not a cache dir in the normal sense -- it won't be automatically
|
# This is not a cache dir in the normal sense -- it won't be automatically
|
||||||
# recreated.
|
# recreated.
|
||||||
|
|||||||
@ -8742,10 +8742,7 @@ with pkgs;
|
|||||||
|
|
||||||
makeFontsConf = callPackage ../development/libraries/fontconfig/make-fonts-conf.nix { };
|
makeFontsConf = callPackage ../development/libraries/fontconfig/make-fonts-conf.nix { };
|
||||||
|
|
||||||
makeFontsCache = let fontconfig_ = fontconfig; in {fontconfig ? fontconfig_, fontDirectories}:
|
makeFontsCache = callPackage ../development/libraries/fontconfig/make-fonts-cache.nix { };
|
||||||
callPackage ../development/libraries/fontconfig/make-fonts-cache.nix {
|
|
||||||
inherit fontconfig fontDirectories;
|
|
||||||
};
|
|
||||||
|
|
||||||
freenect = callPackage ../development/libraries/freenect {
|
freenect = callPackage ../development/libraries/freenect {
|
||||||
inherit (darwin.apple_sdk.frameworks) Cocoa GLUT;
|
inherit (darwin.apple_sdk.frameworks) Cocoa GLUT;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user