summary refs log tree commit diff
path: root/pkgs/development/libraries/freetype/default.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-08-20 02:01:34 +0300
committerNikolay Amiantov <ab@fmap.me>2016-08-20 03:21:05 +0300
commitf961fc7dd13a724f332482234e126e4526bc2091 (patch)
tree279079bae8c9267d227bd2604f78c819a123f48d /pkgs/development/libraries/freetype/default.nix
parent1c7114da69a257b01f6ca7827ae58e788844c114 (diff)
downloadnixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.tar
nixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.tar.gz
nixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.tar.bz2
nixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.tar.lz
nixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.tar.xz
nixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.tar.zst
nixpkgs-f961fc7dd13a724f332482234e126e4526bc2091.zip
freetype: re-add infinality patches
archfan has updated those patches for the new version.
Diffstat (limited to 'pkgs/development/libraries/freetype/default.nix')
-rw-r--r--pkgs/development/libraries/freetype/default.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index 316d8b5db23..8ef51172f94 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -1,14 +1,25 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, which, zlib, bzip2, libpng, gnumake
+{ stdenv, fetchurl, fetchFromGitHub, pkgconfig, which, zlib, bzip2, libpng, gnumake
 , glib /* passthru only */
 
   # 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 ? true
+, useInfinality ? true
 }:
 
+assert useInfinality -> useEncumberedCode;
+
 let
   version = "2.6.5";
+
+  infinality = fetchFromGitHub {
+    owner = "archfan";
+    repo = "infinality_bundle";
+    rev = "5c0949a477bf43d2ac4e57b4fc39bcc3331002ee";
+    sha256 = "17389aqm6rlxl4b5mv1fx4b22x2v2n60hfhixfxqxpd8ialsdi6l";
+  };
+
 in
 with { inherit (stdenv.lib) optional optionals optionalString; };
 stdenv.mkDerivation rec {
@@ -26,7 +37,7 @@ stdenv.mkDerivation rec {
       url = "http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/plain/freetype-2.2.1-enable-valid.patch?id=9a81147af83b1166a5f301e379f85927cc610990";
       sha256 = "0zkgqhws2s0j8ywksclf391iijhidb1a406zszd7xbdjn28kmj2l";
     })
-  ] ++ optionals (useEncumberedCode) [
+  ] ++ optionals (!useInfinality && useEncumberedCode) [
     # Patch to enable subpixel rendering.
     # See https://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html.
     (fetchurl {
@@ -36,6 +47,10 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  prePatch = optionalString useInfinality ''
+    patches="$patches $(ls ${infinality}/*_freetype2-iu/*-infinality-*.patch)"
+  '';
+
   outputs = [ "dev" "out" ];
 
   propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
@@ -44,7 +59,7 @@ stdenv.mkDerivation rec {
     # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
     ++ optional (!stdenv.isLinux) gnumake;
 
-  configureFlags = "--disable-static --bindir=$(dev)/bin";
+  configureFlags = [ "--disable-static" "--bindir=$(dev)/bin" ];
 
   # The asm for armel is written with the 'asm' keyword.
   CFLAGS = optionalString stdenv.isArm "-std=gnu99";