2011-06-08 12:04:47 +00:00
|
|
|
{ stdenv, fetchurl, gnumake
|
2010-07-18 21:53:58 +00:00
|
|
|
, # FreeType supports sub-pixel rendering. This is patented by
|
|
|
|
# Microsoft, so it is disabled by default. This option allows it to
|
|
|
|
# be enabled. See http://www.freetype.org/patents.html.
|
2009-10-29 12:48:47 +00:00
|
|
|
useEncumberedCode ? false
|
|
|
|
}:
|
2007-02-26 16:32:27 +00:00
|
|
|
|
2012-05-15 22:05:13 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2013-01-29 12:45:01 +00:00
|
|
|
name = "freetype-2.4.11";
|
2012-09-26 19:04:41 +00:00
|
|
|
|
2003-11-06 15:24:19 +00:00
|
|
|
src = fetchurl {
|
2009-04-20 16:02:50 +00:00
|
|
|
url = "mirror://sourceforge/freetype/${name}.tar.bz2";
|
2013-01-29 12:45:01 +00:00
|
|
|
sha256 = "0gxyzxqpyf8g85y6g1zc1wqrh71prbbk8xfw4m8rwzb4ck5hp7gg";
|
2008-03-07 15:43:43 +00:00
|
|
|
};
|
|
|
|
|
2009-04-22 07:05:50 +00:00
|
|
|
configureFlags = "--disable-static";
|
|
|
|
|
2009-10-29 12:48:47 +00:00
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString useEncumberedCode
|
2010-07-18 21:53:58 +00:00
|
|
|
"-DFT_CONFIG_OPTION_SUBPIXEL_RENDERING=1";
|
|
|
|
|
|
|
|
# The asm for armel is written with the 'asm' keyword.
|
2012-04-15 23:41:25 +00:00
|
|
|
CFLAGS = stdenv.lib.optionalString stdenv.isArm "-std=gnu99";
|
2009-10-29 12:48:47 +00:00
|
|
|
|
2012-05-15 22:05:13 +00:00
|
|
|
# FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
|
|
|
|
buildInputs = stdenv.lib.optional (stdenv.system == "i686-freebsd") gnumake;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2012-09-27 16:38:48 +00:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
ln -s freetype2/freetype $out/include/freetype
|
|
|
|
'';
|
|
|
|
|
2012-10-20 08:52:09 +00: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";
|
|
|
|
};
|
|
|
|
|
2008-03-07 15:43:43 +00:00
|
|
|
meta = {
|
2008-10-08 16:56:23 +00:00
|
|
|
description = "A font rendering engine";
|
2008-03-07 15:43:43 +00:00
|
|
|
homepage = http://www.freetype.org/;
|
2009-10-29 12:48:47 +00:00
|
|
|
license = "GPLv2+"; # or the FreeType License (BSD + advertising clause)
|
2003-11-06 15:24:19 +00:00
|
|
|
};
|
2011-06-08 12:04:47 +00:00
|
|
|
}
|