makeFontsCache: init

This commit is contained in:
Nikolay Amiantov 2016-01-29 14:40:27 +03:00
parent cb6beb1eb3
commit 893af77556
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{ runCommand, lib, writeText, fontconfig, fontbhttf, fontDirectories }:
runCommand "fc-cache"
rec {
buildInputs = [ fontconfig ];
passAsFile = [ "fontDirs" ];
fontDirs = ''
<!-- Font directories -->
${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") fontDirectories)}
'';
}
''
export FONTCONFIG_FILE=$(pwd)/fonts.conf
cat > fonts.conf << EOF
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<include>${fontconfig}/etc/fonts/fonts.conf</include>
<cachedir>$out</cachedir>
EOF
cat "$fontDirsPath" >> fonts.conf
echo "</fontconfig>" >> fonts.conf
mkdir -p $out
fc-cache -sv
''

View File

@ -6503,6 +6503,11 @@ let
inherit fontconfig fontDirectories;
};
makeFontsCache = let fontconfig_ = fontconfig; in {fontconfig ? fontconfig_, fontDirectories}:
callPackage ../development/libraries/fontconfig/make-fonts-cache.nix {
inherit fontconfig fontDirectories;
};
freealut = callPackage ../development/libraries/freealut { };
freeglut = callPackage ../development/libraries/freeglut { };