aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-02-26 15:37:54 -0500
committerLeo Famulari <leo@famulari.name>2017-02-26 15:46:03 -0500
commit56a44e2d5b16ff9b54468f0f48d8fa679b8163ed (patch)
tree6f9cc229e9d3f9c9565533b44f1a75e7d19a8ab2
parentfe36608f99384f0bb6d3376038b8ddd82841b020 (diff)
downloadpatches-56a44e2d5b16ff9b54468f0f48d8fa679b8163ed.tar
patches-56a44e2d5b16ff9b54468f0f48d8fa679b8163ed.tar.gz
gnu: gd: Fix test failure with FreeType 2.7.
* gnu/packages/patches/gd-freetype-test-failure.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gd.scm (gd)[source]: Use it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/gd.scm3
-rw-r--r--gnu/packages/patches/gd-freetype-test-failure.patch59
3 files changed, 62 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 6f7bed9d11..dc210c7662 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -581,6 +581,7 @@ dist_patch_DATA = \
%D%/packages/patches/gd-fix-gd2-read-test.patch \
%D%/packages/patches/gd-fix-tests-on-i686.patch \
%D%/packages/patches/gd-fix-truecolor-format-correction.patch \
+ %D%/packages/patches/gd-freetype-test-failure.patch \
%D%/packages/patches/gegl-CVE-2012-4433.patch \
%D%/packages/patches/geoclue-config.patch \
%D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch \
diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
index 1c2be119b1..8cac242b5d 100644
--- a/gnu/packages/gd.scm
+++ b/gnu/packages/gd.scm
@@ -51,7 +51,8 @@
(base32
"1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
(patches (search-patches "gd-fix-gd2-read-test.patch"
- "gd-fix-tests-on-i686.patch"))))
+ "gd-fix-tests-on-i686.patch"
+ "gd-freetype-test-failure.patch"))))
(build-system gnu-build-system)
(arguments
`(#:phases
diff --git a/gnu/packages/patches/gd-freetype-test-failure.patch b/gnu/packages/patches/gd-freetype-test-failure.patch
new file mode 100644
index 0000000000..49c16ca089
--- /dev/null
+++ b/gnu/packages/patches/gd-freetype-test-failure.patch
@@ -0,0 +1,59 @@
+Fix a test failure with freetype 2.7:
+
+https://github.com/libgd/libgd/commit/a5570d3ed30ff76c2a8bdd54f4ab1825acca0143
+
+Patch copied from upstream source repository:
+
+https://github.com/libgd/libgd/commit/a5570d3ed30ff76c2a8bdd54f4ab1825acca0143
+
+From a5570d3ed30ff76c2a8bdd54f4ab1825acca0143 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Sun, 29 Jan 2017 17:07:50 +0100
+Subject: [PATCH] Fix #302: Test suite fails with freetype 2.7
+
+Actually, the test failures are not necessarily related to freetype
+2.7, but rather are caused by subpixel hinting which is enabled by
+default in freetype 2.7. Subpixel hinting is, however, already
+available in freetype 2.5 and in versions having the "Infinality"
+patch.
+
+To get the expected results in all environments, we have to disable
+subpixel hinting, what is easily done by setting a respective
+environment variable.
+
+See also:
+* https://www.freetype.org/freetype2/docs/subpixel-hinting.html
+* https://www.freetype.org/freetype2/docs/reference/ft2-tt_driver.html
+---
+ tests/freetype/bug00132.c | 3 +++
+ tests/gdimagestringft/gdimagestringft_bbox.c | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/tests/freetype/bug00132.c b/tests/freetype/bug00132.c
+index 713dd2d..42ed5b1 100644
+--- a/tests/freetype/bug00132.c
++++ b/tests/freetype/bug00132.c
+@@ -11,6 +11,9 @@ int main()
+ char *path;
+ char *ret = NULL;
+
++ /* disable subpixel hinting */
++ putenv("FREETYPE_PROPERTIES=truetype:interpreter-version=35");
++
+ im = gdImageCreateTrueColor(50, 30);
+
+ if (!im) {
+diff --git a/tests/gdimagestringft/gdimagestringft_bbox.c b/tests/gdimagestringft/gdimagestringft_bbox.c
+index 0161ec8..1596a9e 100644
+--- a/tests/gdimagestringft/gdimagestringft_bbox.c
++++ b/tests/gdimagestringft/gdimagestringft_bbox.c
+@@ -38,6 +38,9 @@ int main()
+ int error = 0;
+ FILE *fp;
+
++ /* disable subpixel hinting */
++ putenv("FREETYPE_PROPERTIES=truetype:interpreter-version=35");
++
+ path = gdTestFilePath("freetype/DejaVuSans.ttf");
+ im = gdImageCreate(800, 800);
+ gdImageColorAllocate(im, 0xFF, 0xFF, 0xFF); /* allocate white for background color */