makeFontsCache: init
This commit is contained in:
parent
cb6beb1eb3
commit
893af77556
27
pkgs/development/libraries/fontconfig/make-fonts-cache.nix
Normal file
27
pkgs/development/libraries/fontconfig/make-fonts-cache.nix
Normal 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
|
||||
''
|
@ -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 { };
|
||||
|
Loading…
Reference in New Issue
Block a user