* Generation of /etc/fonts/fonts.conf: moved to Nixpkgs.
svn path=/nixos/trunk/; revision=12252
This commit is contained in:
parent
6ed65c2d95
commit
9b55a5c178
|
@ -174,17 +174,9 @@ import ../helpers/make-etc.nix {
|
|||
# Configuration file for fontconfig used to locate
|
||||
# (X11) client-rendered fonts.
|
||||
++ optional config.fonts.enableFontConfig {
|
||||
source = pkgs.runCommand "fonts.conf"
|
||||
{
|
||||
fontDirectories = import ../system/fonts.nix {inherit pkgs config;};
|
||||
buildInputs = [pkgs.libxslt];
|
||||
inherit (pkgs) fontconfig;
|
||||
}
|
||||
"xsltproc --stringparam fontDirectories \"$fontDirectories\" \\
|
||||
--stringparam fontconfig \"$fontconfig\" \\
|
||||
${./fonts/make-fonts-conf.xsl} $fontconfig/etc/fonts/fonts.conf \\
|
||||
> $out
|
||||
";
|
||||
source = pkgs.makeFontsConf {
|
||||
fontDirectories = import ../system/fonts.nix {inherit pkgs config;};
|
||||
};
|
||||
target = "fonts/fonts.conf";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
This script copies the original fonts.conf from the fontconfig
|
||||
distribution, but replaces all <dir> entries with the directories
|
||||
specified in the $fontDirectories parameter.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:str="http://exslt.org/strings"
|
||||
extension-element-prefixes="str"
|
||||
>
|
||||
|
||||
<xsl:output method='xml' encoding="UTF-8" doctype-system="fonts.dtd" />
|
||||
|
||||
<xsl:param name="fontDirectories" />
|
||||
<xsl:param name="fontconfig" />
|
||||
|
||||
<xsl:template match="/fontconfig">
|
||||
|
||||
<fontconfig>
|
||||
<xsl:copy-of select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
|
||||
|
||||
<include xml:space="preserve"><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
|
||||
<include ignore_missing="yes" xml:space="preserve">/etc/fonts/conf.d</include>
|
||||
|
||||
<cachedir xml:space="preserve">/var/cache/fontconfig</cachedir>
|
||||
<cachedir xml:space="preserve">~/.fontconfig</cachedir>
|
||||
|
||||
<xsl:for-each select="str:tokenize($fontDirectories)">
|
||||
<dir><xsl:value-of select="." /></dir>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:for-each>
|
||||
|
||||
</fontconfig>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
Reference in New Issue