Revert "fontconfig: Only read versioned config dirs"
This reverts commit edf2541f02.
Turns out lot of software (including Chromium) use bundled fontconfig
so we either need to wrap every one of those, or re-introduce the global
unversioned config. The latter is easier but weakens hermetic configs.
But perhaps those are not really worth the effort. Given that programs
linked against fc 2.12.6 on fc 2.13.92 system seem to at least display text,
even while printing tons of errors (as long as you generate fc cache manually),
and same thing the other way around, hopefully it will not be an issue in the future.
We give up on the hermetic configs in exchange for getting rid of lot of complexity.
This commit is contained in:
@@ -1,22 +1,17 @@
|
|||||||
From 2ff9b53ce755be183ef9274f7dd3f9ac537173f6 Mon Sep 17 00:00:00 2001
|
commit 05c6adf8104b4321d3a3716a7b9feb6bf223ed0c (HEAD, nixpkgs)
|
||||||
From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= <vcunat@gmail.com>
|
Author: Vladimír Čunát <vcunat@gmail.com>
|
||||||
Date: Tue, 4 Nov 2014 12:24:25 +0100
|
Date: Tue Nov 4 12:24:25 2014 +0100
|
||||||
Subject: [PATCH] add check for /etc/fonts/@configVersion@/fonts.conf
|
|
||||||
|
|
||||||
It's checked between FONTCONFIG_FILE and the in-package etc/fonts/fonts.conf.
|
add check for /etc/fonts/@configVersion@/fonts.conf
|
||||||
The latter is used so that on non-NixOS distributions, fontconfig works at least
|
|
||||||
with upstream defaults, even when the global config is incompatible.
|
|
||||||
|
|
||||||
Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
|
It's checked between FONTCONFIG_FILE and the usual /etc/fonts/fonts.conf.
|
||||||
---
|
Also, hardcode /etc/fonts/fonts.conf to prevent accidental override.
|
||||||
src/fccfg.c | 7 ++++++-
|
|
||||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/fccfg.c b/src/fccfg.c
|
diff --git a/src/fccfg.c b/src/fccfg.c
|
||||||
index 342c996..98a1324 100644
|
index 6377fd7..e9eb10a 100644
|
||||||
--- a/src/fccfg.c
|
--- a/src/fccfg.c
|
||||||
+++ b/src/fccfg.c
|
+++ b/src/fccfg.c
|
||||||
@@ -2391,8 +2391,13 @@ FcConfigGetFilename (FcConfig *config,
|
@@ -2070,8 +2070,13 @@ FcConfigFilename (const FcChar8 *url)
|
||||||
if (!url || !*url)
|
if (!url || !*url)
|
||||||
{
|
{
|
||||||
url = (FcChar8 *) getenv ("FONTCONFIG_FILE");
|
url = (FcChar8 *) getenv ("FONTCONFIG_FILE");
|
||||||
@@ -27,10 +22,7 @@ index 342c996..98a1324 100644
|
|||||||
+ }
|
+ }
|
||||||
if (!url)
|
if (!url)
|
||||||
- url = (FcChar8 *) FONTCONFIG_FILE;
|
- url = (FcChar8 *) FONTCONFIG_FILE;
|
||||||
+ url = (FcChar8 *) FONTCONFIG_PATH "/" FONTCONFIG_FILE;
|
+ url = (FcChar8 *) "/etc/fonts/fonts.conf";
|
||||||
}
|
}
|
||||||
file = 0;
|
file = 0;
|
||||||
|
|
||||||
--
|
|
||||||
2.26.2
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,9 @@
|
|||||||
|
|
||||||
/** Font configuration scheme
|
/** Font configuration scheme
|
||||||
- ./config-compat.patch makes fontconfig try the following root configs, in order:
|
- ./config-compat.patch makes fontconfig try the following root configs, in order:
|
||||||
$FONTCONFIG_FILE, /etc/fonts/${configVersion}/fonts.conf, ${fontconfig.out}/etc/fonts/fonts.conf
|
$FONTCONFIG_FILE, /etc/fonts/${configVersion}/fonts.conf, /etc/fonts/fonts.conf
|
||||||
This is done not to override config of pre-2.11 versions (which just blow up)
|
This is done not to override config of pre-2.11 versions (which just blow up)
|
||||||
and still use *global* font configuration at NixOS,
|
and still use *global* font configuration at both NixOS or non-NixOS.
|
||||||
falling back to upstream defaults on non-NixOS.
|
|
||||||
- NixOS creates /etc/fonts/${configVersion}/fonts.conf link to $out/etc/fonts/fonts.conf,
|
- NixOS creates /etc/fonts/${configVersion}/fonts.conf link to $out/etc/fonts/fonts.conf,
|
||||||
and other modifications should go to /etc/fonts/${configVersion}/conf.d
|
and other modifications should go to /etc/fonts/${configVersion}/conf.d
|
||||||
- See ./make-fonts-conf.xsl for config details.
|
- See ./make-fonts-conf.xsl for config details.
|
||||||
@@ -112,20 +111,11 @@ stdenv.mkDerivation rec {
|
|||||||
postInstall = ''
|
postInstall = ''
|
||||||
cd "$out/etc/fonts"
|
cd "$out/etc/fonts"
|
||||||
xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
|
xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
|
||||||
--stringparam fontconfig "$out" \
|
|
||||||
--stringparam fontconfigConfigVersion "${configVersion}" \
|
--stringparam fontconfigConfigVersion "${configVersion}" \
|
||||||
--path $out/share/xml/fontconfig \
|
--path $out/share/xml/fontconfig \
|
||||||
${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
|
${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
|
||||||
> fonts.conf.tmp
|
> fonts.conf.tmp
|
||||||
mv fonts.conf.tmp $out/etc/fonts/fonts.conf
|
mv fonts.conf.tmp $out/etc/fonts/fonts.conf
|
||||||
|
|
||||||
# Make it easier to remove user config in NixOS module.
|
|
||||||
mkdir -p $out/etc/fonts/conf.d.bak
|
|
||||||
mv $out/etc/fonts/conf.d/50-user.conf $out/etc/fonts/conf.d.bak
|
|
||||||
|
|
||||||
# update latest 51-local.conf path to look at the latest local.conf
|
|
||||||
substituteInPlace $out/etc/fonts/conf.d/51-local.conf \
|
|
||||||
--replace local.conf /etc/fonts/${configVersion}/local.conf
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
|||||||
@@ -31,9 +31,6 @@
|
|||||||
<!-- versioned system-wide config -->
|
<!-- versioned system-wide config -->
|
||||||
<include ignore_missing="yes">/etc/fonts/<xsl:value-of select="$fontconfigConfigVersion" />/conf.d</include>
|
<include ignore_missing="yes">/etc/fonts/<xsl:value-of select="$fontconfigConfigVersion" />/conf.d</include>
|
||||||
|
|
||||||
<!-- upstream config -->
|
|
||||||
<include><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
|
|
||||||
|
|
||||||
<dir prefix="xdg">fonts</dir>
|
<dir prefix="xdg">fonts</dir>
|
||||||
<xsl:for-each select="str:tokenize($fontDirectories)">
|
<xsl:for-each select="str:tokenize($fontDirectories)">
|
||||||
<dir><xsl:value-of select="." /></dir>
|
<dir><xsl:value-of select="." /></dir>
|
||||||
|
|||||||
Reference in New Issue
Block a user