Merge pull request #93562 from flokli/fontconfig_210_remove

fontconfig_210: remove package
This commit is contained in:
Florian Klink 2020-08-12 13:45:41 +02:00 committed by GitHub
commit 5aca42698e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 110 deletions

View file

@ -849,6 +849,12 @@ services.transmission.settings.rpc-bind-address = "0.0.0.0";
There are no functional changes, however this may require updating some configurations to use correct types for all attributes. There are no functional changes, however this may require updating some configurations to use correct types for all attributes.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The <literal>fontconfig</literal> module stopped generating fontconfig 2.10.x config and cache.
Fontconfig 2.10.x was removed from Nixpkgs - it hasn't been used in any nixpkgs package anymore.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
</section> </section>

View file

@ -1,11 +1,6 @@
/* /*
NixOS support 2 fontconfig versions, "support" and "latest". Configuration files are linked to /etc/fonts/${pkgs.fontconfig.configVersion}/conf.d/
- "latest" refers to default fontconfig package (pkgs.fontconfig).
configuration files are linked to /etc/fonts/VERSION/conf.d/
- "support" refers to supportPkg (pkgs."fontconfig_${supportVersion}").
configuration files are linked to /etc/fonts/conf.d/
This module generates a package containing configuration files and link it in /etc/fonts. This module generates a package containing configuration files and link it in /etc/fonts.
@ -22,40 +17,21 @@ let
cfg = config.fonts.fontconfig; cfg = config.fonts.fontconfig;
fcBool = x: "<bool>" + (boolToString x) + "</bool>"; fcBool = x: "<bool>" + (boolToString x) + "</bool>";
pkg = pkgs.fontconfig;
# back-supported fontconfig version and package
# version is used for font cache generation
supportVersion = "210";
supportPkg = pkgs."fontconfig_${supportVersion}";
# latest fontconfig version and package
# version is used for configuration folder name, /etc/fonts/VERSION/
# note: format differs from supportVersion and can not be used with makeCacheConf
latestVersion = pkgs.fontconfig.configVersion;
latestPkg = pkgs.fontconfig;
# supported version fonts.conf
supportFontsConf = pkgs.makeFontsConf { fontconfig = supportPkg; fontDirectories = config.fonts.fonts; };
# configuration file to read fontconfig cache # configuration file to read fontconfig cache
# version dependent
# priority 0 # priority 0
cacheConfSupport = makeCacheConf { version = supportVersion; }; cacheConf = makeCacheConf {};
cacheConfLatest = makeCacheConf {};
# generate the font cache setting file for a fontconfig version # generate the font cache setting file
# use latest when no version is passed
# When cross-compiling, we cant generate the cache, so we skip the # When cross-compiling, we cant generate the cache, so we skip the
# <cachedir> part. fontconfig still works but is a little slower in # <cachedir> part. fontconfig still works but is a little slower in
# looking things up. # looking things up.
makeCacheConf = { version ? null }: makeCacheConf = { }:
let let
fcPackage = if version == null
then "fontconfig"
else "fontconfig_${version}";
makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; }; makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; };
cache = makeCache pkgs.${fcPackage}; cache = makeCache pkgs.fontconfig;
cache32 = makeCache pkgs.pkgsi686Linux.${fcPackage}; cache32 = makeCache pkgs.pkgsi686Linux.fontconfig;
in in
pkgs.writeText "fc-00-nixos-cache.conf" '' pkgs.writeText "fc-00-nixos-cache.conf" ''
<?xml version='1.0'?> <?xml version='1.0'?>
@ -200,59 +176,49 @@ let
confPkg = pkgs.runCommand "fontconfig-conf" { confPkg = pkgs.runCommand "fontconfig-conf" {
preferLocalBuild = true; preferLocalBuild = true;
} '' } ''
support_folder=$out/etc/fonts/conf.d dst=$out/etc/fonts/${pkg.configVersion}/conf.d
latest_folder=$out/etc/fonts/${latestVersion}/conf.d mkdir -p $dst
mkdir -p $support_folder
mkdir -p $latest_folder
# fonts.conf # fonts.conf
ln -s ${supportFontsConf} $support_folder/../fonts.conf ln -s ${pkg.out}/etc/fonts/fonts.conf \
ln -s ${latestPkg.out}/etc/fonts/fonts.conf \ $dst/../fonts.conf
$latest_folder/../fonts.conf
# fontconfig default config files # fontconfig default config files
ln -s ${supportPkg.out}/etc/fonts/conf.d/*.conf \ ln -s ${pkg.out}/etc/fonts/conf.d/*.conf \
$support_folder/ $dst/
# Latest fontconfig is configured to look for the upstream defaults inside the package.
# update 51-local.conf path to look at local.conf
rm $dst/51-local.conf
substitute ${pkg.out}/etc/fonts/conf.d/51-local.conf \
$dst/51-local.conf \
--replace local.conf /etc/fonts/${pkg.configVersion}/local.conf
# 00-nixos-cache.conf # 00-nixos-cache.conf
ln -s ${cacheConfSupport} \ ln -s ${cacheConf} $dst/00-nixos-cache.conf
$support_folder/00-nixos-cache.conf
ln -s ${cacheConfLatest} $latest_folder/00-nixos-cache.conf
# 10-nixos-rendering.conf # 10-nixos-rendering.conf
ln -s ${renderConf} $support_folder/10-nixos-rendering.conf ln -s ${renderConf} $dst/10-nixos-rendering.conf
ln -s ${renderConf} $latest_folder/10-nixos-rendering.conf
# 50-user.conf # 50-user.conf
${optionalString (!cfg.includeUserConf) '' ${optionalString (!cfg.includeUserConf) ''
rm $support_folder/50-user.conf rm $dst/50-user.conf
''}
# Since latest fontconfig looks for default files inside the package,
# we had to move this one elsewhere to be able to exclude it here.
${optionalString cfg.includeUserConf ''
ln -s ${latestPkg.out}/etc/fonts/conf.d.bak/50-user.conf $latest_folder/50-user.conf
''} ''}
# local.conf (indirect priority 51) # local.conf (indirect priority 51)
${optionalString (cfg.localConf != "") '' ${optionalString (cfg.localConf != "") ''
ln -s ${localConf} $support_folder/../local.conf ln -s ${localConf} $dst/../local.conf
ln -s ${localConf} $latest_folder/../local.conf
''} ''}
# 52-nixos-default-fonts.conf # 52-nixos-default-fonts.conf
ln -s ${defaultFontsConf} $support_folder/52-nixos-default-fonts.conf ln -s ${defaultFontsConf} $dst/52-nixos-default-fonts.conf
ln -s ${defaultFontsConf} $latest_folder/52-nixos-default-fonts.conf
# 53-no-bitmaps.conf # 53-no-bitmaps.conf
ln -s ${rejectBitmaps} $support_folder/53-no-bitmaps.conf ln -s ${rejectBitmaps} $dst/53-no-bitmaps.conf
ln -s ${rejectBitmaps} $latest_folder/53-no-bitmaps.conf
${optionalString (!cfg.allowType1) '' ${optionalString (!cfg.allowType1) ''
# 53-nixos-reject-type1.conf # 53-nixos-reject-type1.conf
ln -s ${rejectType1} $support_folder/53-nixos-reject-type1.conf ln -s ${rejectType1} $dst/53-nixos-reject-type1.conf
ln -s ${rejectType1} $latest_folder/53-nixos-reject-type1.conf
''} ''}
''; '';

View file

@ -1,47 +0,0 @@
{ stdenv, fetchurl, pkgconfig, freetype, expat
}:
stdenv.mkDerivation rec {
name = "fontconfig-2.10.2";
src = fetchurl {
url = "http://fontconfig.org/release/${name}.tar.bz2";
sha256 = "0llraqw86jmw4vzv7inskp3xxm2gc64my08iwq5mzncgfdbfza4f";
};
outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config
propagatedBuildInputs = [ freetype ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ expat ];
configureFlags = [
"--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--sysconfdir=/etc"
"--with-cache-dir=/var/cache/fontconfig"
"--disable-docs"
"--with-default-fonts="
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
];
enableParallelBuilding = true;
doCheck = true;
# Don't try to write to /var/cache/fontconfig at install time.
installFlags = [ "sysconfdir=$(out)/etc" "fc_cachedir=$(TMPDIR)/dummy" "RUN_FC_CACHE_TEST=false" ];
passthru = {
# Empty for backward compatibility, there was no versioning before 2.11
configVersion = "";
};
meta = with stdenv.lib; {
description = "A library for font customization and configuration";
homepage = "http://fontconfig.org/";
license = licenses.bsd2; # custom but very bsd-like
platforms = platforms.all;
maintainers = [ maintainers.vcunat ];
};
}

View file

@ -138,6 +138,11 @@ mapAliases ({
fontconfig-ultimate has been removed. The repository has been archived upstream and activity has ceased for several years. fontconfig-ultimate has been removed. The repository has been archived upstream and activity has ceased for several years.
https://github.com/bohoomil/fontconfig-ultimate/issues/171. https://github.com/bohoomil/fontconfig-ultimate/issues/171.
''; '';
# 2020-07-21
fontconfig_210 = throw ''
fontconfig 2.10.x hasn't had a release in years, is vulnerable to CVE-2016-5384
and has only been used for old fontconfig caches.
'';
font-droid = throw "font-droid has been deprecated by noto-fonts"; # 2019-04-12 font-droid = throw "font-droid has been deprecated by noto-fonts"; # 2019-04-12
foomatic_filters = foomatic-filters; # 2016-08 foomatic_filters = foomatic-filters; # 2016-08
fuse_exfat = exfat; # 2015-09-11 fuse_exfat = exfat; # 2015-09-11

View file

@ -12066,8 +12066,6 @@ in
cfitsio = callPackage ../development/libraries/cfitsio { }; cfitsio = callPackage ../development/libraries/cfitsio { };
fontconfig_210 = callPackage ../development/libraries/fontconfig/2.10.nix { };
fontconfig = callPackage ../development/libraries/fontconfig { }; fontconfig = callPackage ../development/libraries/fontconfig { };
fontconfig-penultimate = callPackage ../data/fonts/fontconfig-penultimate {}; fontconfig-penultimate = callPackage ../data/fonts/fontconfig-penultimate {};