lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v206 89 lines 2.9 kB view raw
1{ stdenv, fetchurl, fetchpatch, pkgconfig, freetype, expat, libxslt, fontbhttf 2, substituteAll }: 3 4/** Font configuration scheme 5 - ./config-compat.patch makes fontconfig try the following root configs, in order: 6 $FONTCONFIG_FILE, /etc/fonts/${configVersion}/fonts.conf, /etc/fonts/fonts.conf 7 This is done not to override config of pre-2.11 versions (which just blow up) 8 and still use *global* font configuration at both NixOS or non-NixOS. 9 - NixOS creates /etc/fonts/${configVersion}/fonts.conf link to $out/etc/fonts/fonts.conf, 10 and other modifications should go to /etc/fonts/${configVersion}/conf.d 11 - See ./make-fonts-conf.xsl for config details. 12 13*/ 14 15let 16 configVersion = "2.11"; # bump whenever fontconfig breaks compatibility with older configurations 17in 18stdenv.mkDerivation rec { 19 name = "fontconfig-2.11.1"; 20 21 src = fetchurl { 22 url = "http://fontconfig.org/release/${name}.tar.bz2"; 23 sha256 = "16baa4g5lswkyjlyf1h5lwc0zjap7c4d8grw79349a5w6dsl8qnw"; 24 }; 25 26 patches = [ 27 (fetchpatch ({ 28 url = "http://cgit.freedesktop.org/fontconfig/patch/?id=f44157c809d280e2a0ce87fb078fc4b278d24a67"; 29 sha256 = "19s5irclg4irj2yxd7xw9yikbazs9263px8qbv4r21asw06nfalv"; 30 name = "fc-cache-bug-77252.patch"; 31 } 32 )) 33 (substituteAll { 34 src = ./config-compat.patch; 35 inherit configVersion; 36 }) 37 ]; 38 39 propagatedBuildInputs = [ freetype ]; 40 buildInputs = [ pkgconfig expat ]; 41 42 configureFlags = [ 43 "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/ 44 "--disable-docs" 45 # just ~1MB; this is what you get when loading config fails for some reason 46 "--with-default-fonts=${fontbhttf}" 47 ]; 48 49 # We should find a better way to access the arch reliably. 50 crossArch = stdenv.cross.arch or null; 51 52 preConfigure = '' 53 if test -n "$crossConfig"; then 54 configureFlags="$configureFlags --with-arch=$crossArch"; 55 fi 56 ''; 57 58 enableParallelBuilding = true; 59 60 doCheck = true; 61 62 # Don't try to write to /var/cache/fontconfig at install time. 63 installFlags = "fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false"; 64 65 postInstall = '' 66 cd "$out/etc/fonts" 67 rm conf.d/{50-user,51-local}.conf 68 "${libxslt}/bin/xsltproc" --stringparam fontDirectories "${fontbhttf}" \ 69 --stringparam fontconfig "$out" \ 70 --stringparam fontconfigConfigVersion "${configVersion}" \ 71 --path $out/share/xml/fontconfig \ 72 ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \ 73 > fonts.conf.tmp 74 mv fonts.conf.tmp $out/etc/fonts/fonts.conf 75 ''; 76 77 passthru = { 78 inherit configVersion; 79 }; 80 81 meta = with stdenv.lib; { 82 description = "A library for font customization and configuration"; 83 homepage = http://fontconfig.org/; 84 license = licenses.bsd2; # custom but very bsd-like 85 platforms = platforms.all; 86 maintainers = [ maintainers.vcunat ]; 87 }; 88} 89