freetype: re-add infinality patches

archfan has updated those patches for the new version.
This commit is contained in:
Nikolay Amiantov 2016-08-20 02:01:34 +03:00
parent 1c7114da69
commit f961fc7dd1
3 changed files with 20 additions and 5 deletions

View File

@ -104,7 +104,7 @@ in
ultimate = { ultimate = {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;
default = false; default = true;
description = '' description = ''
Enable fontconfig-ultimate settings (formerly known as Enable fontconfig-ultimate settings (formerly known as
Infinality). Besides the customizable settings in this NixOS Infinality). Besides the customizable settings in this NixOS

View File

@ -2,7 +2,7 @@
, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib , alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib
, setJavaClassPath , setJavaClassPath
, minimal ? false , minimal ? false
, enableInfinality ? false # font rendering patch , enableInfinality ? true # font rendering patch
}: }:
let let

View File

@ -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 */ , glib /* passthru only */
# 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 # Microsoft, so it is disabled by default. This option allows it to
# be enabled. See http://www.freetype.org/patents.html. # be enabled. See http://www.freetype.org/patents.html.
, useEncumberedCode ? true , useEncumberedCode ? true
, useInfinality ? true
}: }:
assert useInfinality -> useEncumberedCode;
let let
version = "2.6.5"; version = "2.6.5";
infinality = fetchFromGitHub {
owner = "archfan";
repo = "infinality_bundle";
rev = "5c0949a477bf43d2ac4e57b4fc39bcc3331002ee";
sha256 = "17389aqm6rlxl4b5mv1fx4b22x2v2n60hfhixfxqxpd8ialsdi6l";
};
in in
with { inherit (stdenv.lib) optional optionals optionalString; }; with { inherit (stdenv.lib) optional optionals optionalString; };
stdenv.mkDerivation rec { 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"; url = "http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/plain/freetype-2.2.1-enable-valid.patch?id=9a81147af83b1166a5f301e379f85927cc610990";
sha256 = "0zkgqhws2s0j8ywksclf391iijhidb1a406zszd7xbdjn28kmj2l"; sha256 = "0zkgqhws2s0j8ywksclf391iijhidb1a406zszd7xbdjn28kmj2l";
}) })
] ++ optionals (useEncumberedCode) [ ] ++ optionals (!useInfinality && useEncumberedCode) [
# Patch to enable subpixel rendering. # Patch to enable subpixel rendering.
# See https://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html. # See https://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html.
(fetchurl { (fetchurl {
@ -36,6 +47,10 @@ stdenv.mkDerivation rec {
}) })
]; ];
prePatch = optionalString useInfinality ''
patches="$patches $(ls ${infinality}/*_freetype2-iu/*-infinality-*.patch)"
'';
outputs = [ "dev" "out" ]; outputs = [ "dev" "out" ];
propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype 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. # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
++ optional (!stdenv.isLinux) gnumake; ++ 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. # The asm for armel is written with the 'asm' keyword.
CFLAGS = optionalString stdenv.isArm "-std=gnu99"; CFLAGS = optionalString stdenv.isArm "-std=gnu99";