diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2013-02-10 14:41:29 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2013-02-10 14:44:14 +0100 |
commit | 610796d9f2d844ea2c2fb33ba95a14738c41eb25 (patch) | |
tree | 22d9c9b3ed911522cf3813f14d0e2d46f88d27c4 /pkgs/development/libraries/freetype | |
parent | c53724f31742c36720962b5a12f177589ab7b07b (diff) | |
download | nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.tar nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.tar.gz nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.tar.bz2 nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.tar.lz nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.tar.xz nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.tar.zst nixlib-610796d9f2d844ea2c2fb33ba95a14738c41eb25.zip |
freetype+fontconfig: add infinality and enable it
Also add fontconfig checks , change license to "unfree" if using patented code. Inspired by Corey O'Connor in #89 https://github.com/coreyoconnor/nixpkgs/commit/27fec0aa26d44716134a86efaf48209be7c46138
Diffstat (limited to 'pkgs/development/libraries/freetype')
-rw-r--r-- | pkgs/development/libraries/freetype/default.nix | 42 | ||||
-rw-r--r-- | pkgs/development/libraries/freetype/enable-validation.patch | 22 |
2 files changed, 58 insertions, 6 deletions
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index 536042e9523d..0b20dbc7174b 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -1,22 +1,48 @@ { stdenv, fetchurl, gnumake -, # FreeType supports sub-pixel rendering. This is patented by + # 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. - useEncumberedCode ? false +, useEncumberedCode ? false +, useInfinality ? true }: +assert !(useEncumberedCode && useInfinality); # probably wouldn't make sense + +let + version = "2.4.11"; + infinality = rec { + inherit useInfinality; + vers = "20130104"; + subvers = "04"; + sha256 = "0dqglig34lfcw0w6sm6vmich0pcvq303vyh8jzqapvxgvrpr2156"; + + base_URL = "http://www.infinality.net/fedora/linux/zips"; + url = "${base_URL}/freetype-infinality-${version}-${vers}_${subvers}-x86_64.tar.bz2"; + }; + +in stdenv.mkDerivation rec { - name = "freetype-2.4.11"; + name = "freetype-${version}"; src = fetchurl { url = "mirror://sourceforge/freetype/${name}.tar.bz2"; sha256 = "0gxyzxqpyf8g85y6g1zc1wqrh71prbbk8xfw4m8rwzb4ck5hp7gg"; }; + infinality_patch = if useInfinality + then fetchurl { inherit (infinality) url sha256; } + else null; + configureFlags = "--disable-static"; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString useEncumberedCode - "-DFT_CONFIG_OPTION_SUBPIXEL_RENDERING=1"; + NIX_CFLAGS_COMPILE = with stdenv.lib; + " -fno-strict-aliasing" # from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840 + + optionalString useEncumberedCode " -DFT_CONFIG_OPTION_SUBPIXEL_RENDERING=1" + + optionalString useInfinality " -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=1" + ; + + patches = [ ./enable-validation.patch ] # from Gentoo + ++ stdenv.lib.optional useInfinality [ infinality_patch ]; # The asm for armel is written with the 'asm' keyword. CFLAGS = stdenv.lib.optionalString stdenv.isArm "-std=gnu99"; @@ -25,6 +51,7 @@ stdenv.mkDerivation rec { buildInputs = stdenv.lib.optional (stdenv.system == "i686-freebsd") gnumake; enableParallelBuilding = true; + doCheck = true; postInstall = '' @@ -38,9 +65,12 @@ stdenv.mkDerivation rec { configureFlags = "--disable-static CC_BUILD=gcc"; }; + passthru = { inherit infinality; }; # for fontconfig + meta = { description = "A font rendering engine"; homepage = http://www.freetype.org/; - license = "GPLv2+"; # or the FreeType License (BSD + advertising clause) + license = if useEncumberedCode then "unfree" + else "GPLv2+"; # or the FreeType License (BSD + advertising clause) }; } diff --git a/pkgs/development/libraries/freetype/enable-validation.patch b/pkgs/development/libraries/freetype/enable-validation.patch new file mode 100644 index 000000000000..44f3bf6e1c94 --- /dev/null +++ b/pkgs/development/libraries/freetype/enable-validation.patch @@ -0,0 +1,22 @@ +Enables gxvalid and otvalid modules for use with ftvalid. + +--- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400 ++++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400 +@@ -110,7 +110,7 @@ + AUX_MODULES += cache + + # TrueType GX/AAT table validation. Needs ftgxval.c below. +-# AUX_MODULES += gxvalid ++AUX_MODULES += gxvalid + + # Support for streams compressed with gzip (files with suffix .gz). + # +@@ -124,7 +124,7 @@ + + # OpenType table validation. Needs ftotval.c below. + # +-# AUX_MODULES += otvalid ++AUX_MODULES += otvalid + + # Auxiliary PostScript driver component to share common code. + # |