fontconfig: Use /etc/fonts by default again

This removes the need to set $FONTCONFIG_FILE, which is especially
important when using Nixpkgs binaries on non-NixOS systems.

See also 9301524c50.  This is a
regression caused by a change in fontconfig's configure switches.
This commit is contained in:
Eelco Dolstra 2013-05-07 13:03:25 +02:00
parent 16c59ef836
commit d4561be1cb
2 changed files with 7 additions and 4 deletions

View File

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
#propagatedBuildInputs = [ expat ]; # !!! shouldn't be necessary, but otherwise pango breaks #propagatedBuildInputs = [ expat ]; # !!! shouldn't be necessary, but otherwise pango breaks
configureFlags = "--with-confdir=/etc/fonts --with-cache-dir=/var/cache/fontconfig --disable-docs --with-default-fonts="; configureFlags = "--sysconfdir=/etc --with-cache-dir=/var/cache/fontconfig --disable-docs --with-default-fonts=";
# We should find a better way to access the arch reliably. # We should find a better way to access the arch reliably.
crossArch = stdenv.cross.arch or null; crossArch = stdenv.cross.arch or null;
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
# Don't try to write to /etc/fonts or /var/cache/fontconfig at install time. # Don't try to write to /etc/fonts or /var/cache/fontconfig at install time.
installFlags = "CONFDIR=$(out)/etc/fonts RUN_FC_CACHE_TEST=false fc_cachedir=$(TMPDIR)/dummy"; installFlags = "sysconfdir=$(out)/etc RUN_FC_CACHE_TEST=false fc_cachedir=$(TMPDIR)/dummy";
postInstall = if !freetype.infinality.useInfinality then "" else '' postInstall = if !freetype.infinality.useInfinality then "" else ''
cd "$out/etc/fonts" && tar xvf ${infinality_patch} cd "$out/etc/fonts" && tar xvf ${infinality_patch}

View File

@ -9,7 +9,9 @@
assert !(useEncumberedCode && useInfinality); # probably wouldn't make sense assert !(useEncumberedCode && useInfinality); # probably wouldn't make sense
let let
version = "2.4.11"; version = "2.4.11";
infinality = rec { infinality = rec {
inherit useInfinality; inherit useInfinality;
vers = "20130104"; vers = "20130104";
@ -21,6 +23,7 @@ let
}; };
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "freetype-${version}"; name = "freetype-${version}";
@ -38,8 +41,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = with stdenv.lib; NIX_CFLAGS_COMPILE = with stdenv.lib;
" -fno-strict-aliasing" # from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840 " -fno-strict-aliasing" # from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840
+ optionalString useEncumberedCode " -DFT_CONFIG_OPTION_SUBPIXEL_RENDERING=1" + optionalString useEncumberedCode " -DFT_CONFIG_OPTION_SUBPIXEL_RENDERING=1"
+ optionalString useInfinality " -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=1" + optionalString useInfinality " -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=1";
;
patches = [ ./enable-validation.patch ] # from Gentoo patches = [ ./enable-validation.patch ] # from Gentoo
++ stdenv.lib.optional useInfinality [ infinality_patch ]; ++ stdenv.lib.optional useInfinality [ infinality_patch ];
@ -51,6 +53,7 @@ stdenv.mkDerivation rec {
buildInputs = stdenv.lib.optional (!stdenv.isLinux) gnumake; buildInputs = stdenv.lib.optional (!stdenv.isLinux) gnumake;
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = true; doCheck = true;
postInstall = postInstall =