2022-06-09 19:05:39 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2019-11-20 01:45:30 +00:00
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
2021-06-17 12:47:39 +00:00
|
|
|
, python3
|
2019-11-20 01:45:30 +00:00
|
|
|
, freetype
|
|
|
|
, expat
|
|
|
|
, libxslt
|
|
|
|
, gperf
|
|
|
|
, dejavu_fonts
|
|
|
|
, autoreconfHook
|
2021-03-21 22:28:11 +00:00
|
|
|
, CoreFoundation
|
2017-06-28 20:09:01 +00:00
|
|
|
}:
|
2014-11-04 12:49:22 +00:00
|
|
|
|
2009-10-29 13:22:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "fontconfig";
|
2022-06-09 19:05:39 +00:00
|
|
|
version = "2.14.0";
|
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config
|
2012-09-26 19:07:11 +00:00
|
|
|
|
2004-03-30 17:28:41 +00:00
|
|
|
src = fetchurl {
|
2021-07-08 17:36:14 +00:00
|
|
|
url = "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz";
|
2022-06-09 19:05:39 +00:00
|
|
|
sha256 = "3L64TJx0u/2xM9U1/hx77cnyIhqNrzkUuYTETFIOm6w=";
|
2004-03-30 17:28:41 +00:00
|
|
|
};
|
2012-09-26 19:07:11 +00:00
|
|
|
|
2019-11-20 01:45:30 +00:00
|
|
|
nativeBuildInputs = [
|
2021-06-17 12:47:39 +00:00
|
|
|
autoreconfHook
|
2019-11-20 01:45:30 +00:00
|
|
|
gperf
|
|
|
|
libxslt
|
|
|
|
pkg-config
|
2021-06-17 12:47:39 +00:00
|
|
|
python3
|
2019-11-20 01:45:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
expat
|
2021-03-21 22:28:11 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin CoreFoundation;
|
2019-11-20 01:45:30 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
freetype
|
|
|
|
];
|
2013-02-10 13:19:34 +00:00
|
|
|
|
2021-06-17 12:47:39 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Requires networking.
|
|
|
|
sed -i '/check_PROGRAMS += test-crbug1004254/d' test/Makefile.am
|
|
|
|
'';
|
|
|
|
|
2014-06-09 17:47:31 +00:00
|
|
|
configureFlags = [
|
2020-08-13 18:04:10 +00:00
|
|
|
"--sysconfdir=/etc"
|
2018-08-20 18:43:41 +00:00
|
|
|
"--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
|
2014-11-04 12:49:22 +00:00
|
|
|
"--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
|
2016-08-29 20:28:50 +00:00
|
|
|
# just <1MB; this is what you get when loading config fails for some reason
|
|
|
|
"--with-default-fonts=${dejavu_fonts.minimal}"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2018-08-20 18:43:41 +00:00
|
|
|
"--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
|
2014-06-09 17:47:31 +00:00
|
|
|
];
|
2009-10-29 13:22:43 +00:00
|
|
|
|
2012-05-15 22:04:47 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2014-12-17 21:07:36 +00:00
|
|
|
doCheck = true;
|
2008-03-07 15:43:43 +00:00
|
|
|
|
2020-08-13 18:04:10 +00:00
|
|
|
installFlags = [
|
|
|
|
# Don't try to write to /var/cache/fontconfig at install time.
|
|
|
|
"fc_cachedir=$(TMPDIR)/dummy"
|
|
|
|
"RUN_FC_CACHE_TEST=false"
|
|
|
|
"sysconfdir=${placeholder "out"}/etc"
|
|
|
|
];
|
2014-06-09 17:47:31 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2014-11-26 21:03:45 +00:00
|
|
|
cd "$out/etc/fonts"
|
2018-11-21 03:19:48 +00:00
|
|
|
xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
|
2014-09-27 18:08:45 +00:00
|
|
|
--path $out/share/xml/fontconfig \
|
|
|
|
${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
|
|
|
|
> fonts.conf.tmp
|
|
|
|
mv fonts.conf.tmp $out/etc/fonts/fonts.conf
|
2020-09-09 19:57:24 +00:00
|
|
|
# We don't keep section 3 of the manpages, as they are quite large and
|
|
|
|
# probably not so useful.
|
|
|
|
rm -r $bin/share/man/man3
|
2013-02-10 13:41:29 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2008-03-07 15:43:43 +00:00
|
|
|
description = "A library for font customization and configuration";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://fontconfig.org/";
|
2014-02-05 07:16:33 +00:00
|
|
|
license = licenses.bsd2; # custom but very bsd-like
|
|
|
|
platforms = platforms.all;
|
2021-05-07 14:28:41 +00:00
|
|
|
maintainers = with maintainers; teams.freedesktop.members ++ [ ];
|
2012-09-26 19:07:11 +00:00
|
|
|
};
|
2004-03-30 17:28:41 +00:00
|
|
|
}
|