2014-06-09 19:47:31 +02:00
|
|
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, which, zlib, bzip2, libpng, gnumake
|
2013-02-10 14:41:29 +01:00
|
|
|
# FreeType supports sub-pixel rendering. This is patented by
|
2010-07-18 23:53:58 +02:00
|
|
|
# Microsoft, so it is disabled by default. This option allows it to
|
|
|
|
# be enabled. See http://www.freetype.org/patents.html.
|
2014-06-09 19:47:31 +02:00
|
|
|
, useEncumberedCode ? true
|
2009-10-29 13:48:47 +01:00
|
|
|
}:
|
2007-02-26 17:32:27 +01:00
|
|
|
|
2013-02-10 14:41:29 +01:00
|
|
|
let
|
2014-06-09 19:47:31 +02:00
|
|
|
version = "2.5.3";
|
2013-05-07 13:03:25 +02:00
|
|
|
|
2014-06-09 19:47:31 +02:00
|
|
|
fetch_bohoomil = name: sha256: fetchpatch {
|
|
|
|
url = https://raw.githubusercontent.com/bohoomil/fontconfig-ultimate/8a155db28f264520596cc3e76eb44824bdb30f8e/01_freetype2-iu/ + name;
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2013-02-10 14:41:29 +01:00
|
|
|
in
|
2014-06-09 19:47:31 +02:00
|
|
|
with { inherit (stdenv.lib) optional optionalString; };
|
2012-05-16 00:05:13 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2013-02-10 14:41:29 +01:00
|
|
|
name = "freetype-${version}";
|
2012-09-26 21:04:41 +02:00
|
|
|
|
2003-11-06 16:24:19 +01:00
|
|
|
src = fetchurl {
|
2009-04-20 18:02:50 +02:00
|
|
|
url = "mirror://sourceforge/freetype/${name}.tar.bz2";
|
2014-06-09 19:47:31 +02:00
|
|
|
sha256 = "0pppcn73b5pwd7zdi9yfx16f5i93y18q7q4jmlkwmwrfsllqp160";
|
2008-03-07 16:43:43 +01:00
|
|
|
};
|
|
|
|
|
2013-02-10 14:41:29 +01:00
|
|
|
patches = [ ./enable-validation.patch ] # from Gentoo
|
2014-06-09 19:47:31 +02:00
|
|
|
++ [
|
|
|
|
(fetch_bohoomil "freetype-2.5.3-pkgconfig.patch" "1dpfdh8kmka3gzv14glz7l79i545zizah6wma937574v5z2iy3nn")
|
|
|
|
(fetch_bohoomil "fix_segfault_with_harfbuzz.diff" "1nx36inqrw717b86cla2miprdb3hii4vndw95k0jbbhfmax9k6fy")
|
|
|
|
]
|
|
|
|
++ optional useEncumberedCode
|
|
|
|
(fetch_bohoomil "infinality-2.5.3.patch" "0mxiybcb4wwbicrjiinh1b95rv543bh05sdqk1v0ipr3fxfrb47q")
|
|
|
|
;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
|
|
|
|
# dependence on harfbuzz is looser than the reverse dependence
|
|
|
|
buildInputs = [ pkgconfig which ]
|
|
|
|
# FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
|
|
|
|
++ optional (!stdenv.isLinux) gnumake;
|
|
|
|
|
|
|
|
# from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840
|
|
|
|
NIX_CFLAGS_COMPILE = "-fno-strict-aliasing";
|
2010-07-18 23:53:58 +02:00
|
|
|
# The asm for armel is written with the 'asm' keyword.
|
2014-06-09 19:47:31 +02:00
|
|
|
CFLAGS = optionalString stdenv.isArm "-std=gnu99";
|
2012-05-16 00:05:13 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2013-05-07 13:03:25 +02:00
|
|
|
|
2013-02-10 14:41:29 +01:00
|
|
|
doCheck = true;
|
2012-05-16 00:05:13 +02:00
|
|
|
|
2014-06-09 19:47:31 +02:00
|
|
|
postInstall = ''ln -s freetype2 "$out"/include/freetype''; # compat hack
|
2012-09-27 18:38:48 +02:00
|
|
|
|
2012-10-20 10:52:09 +02:00
|
|
|
crossAttrs = {
|
|
|
|
# Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead
|
|
|
|
# of gcc. I think it's due to the unwrapped gcc being in the PATH. I don't
|
|
|
|
# know why it's on the PATH.
|
|
|
|
configureFlags = "--disable-static CC_BUILD=gcc";
|
|
|
|
};
|
|
|
|
|
2014-06-09 19:47:31 +02:00
|
|
|
meta = with stdenv.lib; {
|
2008-10-08 18:56:23 +02:00
|
|
|
description = "A font rendering engine";
|
2008-03-07 16:43:43 +01:00
|
|
|
homepage = http://www.freetype.org/;
|
2014-06-09 19:47:31 +02:00
|
|
|
license = licenses.gpl2Plus; # or the FreeType License (BSD + advertising clause)
|
|
|
|
#ToDo: encumbered = useEncumberedCode;
|
|
|
|
platforms = platforms.all;
|
2003-11-06 16:24:19 +01:00
|
|
|
};
|
2011-06-08 14:04:47 +02:00
|
|
|
}
|