diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/freetype | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/freetype')
4 files changed, 118 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/freetype/default.nix b/nixpkgs/pkgs/development/libraries/freetype/default.nix new file mode 100644 index 000000000000..5a11d03c5917 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/freetype/default.nix @@ -0,0 +1,68 @@ +{ stdenv, fetchurl +, buildPackages +, pkgconfig, which, makeWrapper +, zlib, bzip2, libpng, gnumake, glib + +, # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering). + # LCD filtering is also known as ClearType and covered by several Microsoft patents. + # This option allows it to be disabled. See http://www.freetype.org/patents.html. + useEncumberedCode ? true +}: + +let + inherit (stdenv.lib) optional optionalString; + +in stdenv.mkDerivation rec { + name = "freetype-${version}"; + version = "2.9"; + + meta = with stdenv.lib; { + description = "A font rendering engine"; + longDescription = '' + FreeType is a portable and efficient library for rendering fonts. It + supports TrueType, Type 1, CFF fonts, and WOFF, PCF, FNT, BDF and PFR + fonts. It has a bytecode interpreter and has an automatic hinter called + autofit which can be used instead of hinting instructions included in + fonts. + ''; + homepage = https://www.freetype.org/; + license = licenses.gpl2Plus; # or the FreeType License (BSD + advertising clause) + platforms = platforms.all; + maintainers = with maintainers; [ ttuegel ]; + }; + + src = fetchurl { + url = "mirror://savannah/freetype/${name}.tar.bz2"; + sha256 = "12jcdz1in20yaa55izxalg3hm1pf7nydfrzps5bzb4zgihybmzz6"; + }; + + propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype + # dependence on harfbuzz is looser than the reverse dependence + nativeBuildInputs = [ pkgconfig which makeWrapper ] + # FreeType requires GNU Make, which is not part of stdenv on FreeBSD. + ++ optional (!stdenv.isLinux) gnumake; + + patches = + [ ./enable-table-validation.patch + ] ++ + optional useEncumberedCode ./enable-subpixel-rendering.patch; + + outputs = [ "out" "dev" ]; + + configureFlags = [ "--disable-static" "--bindir=$(dev)/bin" ]; + + # native compiler to generate building tool + CC_BUILD = "${buildPackages.stdenv.cc}/bin/cc"; + + # The asm for armel is written with the 'asm' keyword. + CFLAGS = optionalString stdenv.isAarch32 "-std=gnu99"; + + enableParallelBuilding = true; + + doCheck = true; + + postInstall = glib.flattenInclude + '' + wrapProgram "$dev/bin/freetype-config" \ + --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig" + ''; +} diff --git a/nixpkgs/pkgs/development/libraries/freetype/disable-pcf-long-family-names.patch b/nixpkgs/pkgs/development/libraries/freetype/disable-pcf-long-family-names.patch new file mode 100644 index 000000000000..e3dfe4aabd60 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/freetype/disable-pcf-long-family-names.patch @@ -0,0 +1,15 @@ +diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h +index 5676074..37a0d00 100644 +--- a/include/freetype/config/ftoption.h ++++ b/include/freetype/config/ftoption.h +@@ -856,7 +856,7 @@ FT_BEGIN_HEADER + /* If this option is activated, it can be controlled with the */ + /* `no-long-family-names' property of the pcf driver module. */ + /* */ +-#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES ++/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ + + + /*************************************************************************/ +-- +cgit v1.0-41-gc330 \ No newline at end of file diff --git a/nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch b/nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch new file mode 100644 index 000000000000..4f908343e8c1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch @@ -0,0 +1,13 @@ +Index: freetype-2.7.1/include/freetype/config/ftoption.h +=================================================================== +--- freetype-2.7.1.orig/include/freetype/config/ftoption.h ++++ freetype-2.7.1/include/freetype/config/ftoption.h +@@ -122,7 +122,7 @@ FT_BEGIN_HEADER + /* This is done to allow FreeType clients to run unmodified, forcing */ + /* them to display normal gray-level anti-aliased glyphs. */ + /* */ +-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ ++#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + + /*************************************************************************/ diff --git a/nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch b/nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch new file mode 100644 index 000000000000..37419f14f40f --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch @@ -0,0 +1,22 @@ +Index: freetype-2.7.1/modules.cfg +=================================================================== +--- freetype-2.7.1.orig/modules.cfg ++++ freetype-2.7.1/modules.cfg +@@ -120,7 +120,7 @@ AUX_MODULES += cache + # TrueType GX/AAT table validation. Needs ftgxval.c below. + # + # No FT_CONFIG_OPTION_PIC support. +-# AUX_MODULES += gxvalid ++AUX_MODULES += gxvalid + + # Support for streams compressed with gzip (files with suffix .gz). + # +@@ -143,7 +143,7 @@ AUX_MODULES += bzip2 + # OpenType table validation. Needs ftotval.c below. + # + # No FT_CONFIG_OPTION_PIC support. +-# AUX_MODULES += otvalid ++AUX_MODULES += otvalid + + # Auxiliary PostScript driver component to share common code. + # |