15 stdenv.mkDerivation rec {
19 outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config
22 url = "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz";
23 sha256 = "3L64TJx0u/2xM9U1/hx77cnyIhqNrzkUuYTETFIOm6w=";
36 ] ++ lib.optional stdenv.isDarwin CoreFoundation;
38 propagatedBuildInputs = [
43 # Requires networking.
44 sed -i '/check_PROGRAMS += test-crbug1004254/d' test/Makefile.am
49 "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
50 "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
51 # just <1MB; this is what you get when loading config fails for some reason
52 "--with-default-fonts=${dejavu_fonts.minimal}"
53 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
54 "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
57 enableParallelBuilding = true;
62 # Don't try to write to /var/cache/fontconfig at install time.
63 "fc_cachedir=$(TMPDIR)/dummy"
64 "RUN_FC_CACHE_TEST=false"
65 "sysconfdir=${placeholder "out"}/etc"
70 xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
71 --path $out/share/xml/fontconfig \
72 ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
74 mv fonts.conf.tmp $out/etc/fonts/fonts.conf
75 # We don't keep section 3 of the manpages, as they are quite large and
76 # probably not so useful.
77 rm -r $bin/share/man/man3
81 description = "A library for font customization and configuration";
82 homepage = "http://fontconfig.org/";
83 license = licenses.bsd2; # custom but very bsd-like
84 platforms = platforms.all;
85 maintainers = with maintainers; teams.freedesktop.members ++ [ ];