16 stdenv.mkDerivation (finalAttrs: {
20 outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config
23 url = with finalAttrs; "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz";
24 hash = "sha256-Y6BljQ4G4PqIYQZFK1jvBPIfWCAuoCqUw53g0zNdfA4=";
37 ] ++ lib.optional stdenv.hostPlatform.isDarwin CoreFoundation;
39 propagatedBuildInputs = [
44 # Requires networking.
45 sed -i '/check_PROGRAMS += test-crbug1004254/d' test/Makefile.am
50 "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
51 "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
52 # just <1MB; this is what you get when loading config fails for some reason
53 "--with-default-fonts=${dejavu_fonts.minimal}"
54 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
55 "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
58 enableParallelBuilding = true;
63 # Don't try to write to /var/cache/fontconfig at install time.
64 "fc_cachedir=$(TMPDIR)/dummy"
65 "RUN_FC_CACHE_TEST=false"
66 "sysconfdir=${placeholder "out"}/etc"
71 xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
72 --stringparam includes /etc/fonts/conf.d \
73 --path $out/share/xml/fontconfig \
74 ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
76 mv fonts.conf.tmp $out/etc/fonts/fonts.conf
77 # We don't keep section 3 of the manpages, as they are quite large and
78 # probably not so useful.
79 rm -r $bin/share/man/man3
83 pkg-config = testers.hasPkgConfigModules {
84 package = finalAttrs.finalPackage;
89 description = "Library for font customization and configuration";
90 homepage = "http://fontconfig.org/";
91 license = licenses.bsd2; # custom but very bsd-like
92 platforms = platforms.all;
93 maintainers = with maintainers; teams.freedesktop.members ++ [ ];
94 pkgConfigModules = [ "fontconfig" ];