16 stdenv.mkDerivation rec {
20 outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config
23 url = "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz";
24 hash = "sha256-26aVtXvOFQI9LO7e+CBiwrkl5R9dTMSu9zbPE/YKRos=";
28 # Provide 11-lcdfilter-none.conf for NixOS module
29 # https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/268
31 name = "add-optional-11-lcdfilter-none-configuration.patch";
32 url = "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/c2666a6d9a6ed18b1bfcef8176e25f62993e24db.patch";
33 hash = "sha256-UBzkxy3uxFO+g0aQtPnBZv7OncgQdinwzNwWS8ngjcE=";
47 ] ++ lib.optional stdenv.isDarwin CoreFoundation;
49 propagatedBuildInputs = [
54 # Requires networking.
55 sed -i '/check_PROGRAMS += test-crbug1004254/d' test/Makefile.am
60 "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
61 "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
62 # just <1MB; this is what you get when loading config fails for some reason
63 "--with-default-fonts=${dejavu_fonts.minimal}"
64 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
65 "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
68 enableParallelBuilding = true;
73 # Don't try to write to /var/cache/fontconfig at install time.
74 "fc_cachedir=$(TMPDIR)/dummy"
75 "RUN_FC_CACHE_TEST=false"
76 "sysconfdir=${placeholder "out"}/etc"
81 xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
82 --path $out/share/xml/fontconfig \
83 ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
85 mv fonts.conf.tmp $out/etc/fonts/fonts.conf
86 # We don't keep section 3 of the manpages, as they are quite large and
87 # probably not so useful.
88 rm -r $bin/share/man/man3
92 description = "A library for font customization and configuration";
93 homepage = "http://fontconfig.org/";
94 license = licenses.bsd2; # custom but very bsd-like
95 platforms = platforms.all;
96 maintainers = with maintainers; teams.freedesktop.members ++ [ ];