From cab430591a0e559e92ca9a1e28656cf31daeafb9 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 9 Jan 2017 23:33:01 -0800 Subject: [PATCH] Fix another integer type issue which caused more issues on ppc64 --- ...es-for-font-metrics-in-PyGlyph-class.patch | 48 +++++++++++++++++++ ...b6708d71df80999764eb4b65cc1d388a521f.patch | 0 python-matplotlib.spec | 13 ++++- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 0001-Fix-integer-types-for-font-metrics-in-PyGlyph-class.patch rename 7768.patch => b0e4b6708d71df80999764eb4b65cc1d388a521f.patch (100%) diff --git a/0001-Fix-integer-types-for-font-metrics-in-PyGlyph-class.patch b/0001-Fix-integer-types-for-font-metrics-in-PyGlyph-class.patch new file mode 100644 index 0000000..dd77cca --- /dev/null +++ b/0001-Fix-integer-types-for-font-metrics-in-PyGlyph-class.patch @@ -0,0 +1,48 @@ +From bf970bd8bc13b4e6e281a47163527909270edcbf Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Mon, 9 Jan 2017 22:56:40 -0800 +Subject: [PATCH] Fix integer types for font metrics in PyGlyph class + +The PyGlyph class defined in the freetype wrapper code pulls +in some font metric values from freetype when initialized. All +these values have type FT_Pos in freetype, which is a signed +long, but in the PyMemberDef structure used to store those +values in the Python class, their types were set to T_INT - +signed int. We should set them to T_LONG instead. This fixes +several hundred test suite errors on big-endian arches. +--- + src/ft2font_wrapper.cpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index c77dd8363..62fbf0a0c 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -282,15 +282,15 @@ static PyObject *PyGlyph_get_bbox(PyGlyph *self, void *closure) + static PyTypeObject *PyGlyph_init_type(PyObject *m, PyTypeObject *type) + { + static PyMemberDef members[] = { +- {(char *)"width", T_INT, offsetof(PyGlyph, width), READONLY, (char *)""}, +- {(char *)"height", T_INT, offsetof(PyGlyph, height), READONLY, (char *)""}, +- {(char *)"horiBearingX", T_INT, offsetof(PyGlyph, horiBearingX), READONLY, (char *)""}, +- {(char *)"horiBearingY", T_INT, offsetof(PyGlyph, horiBearingY), READONLY, (char *)""}, +- {(char *)"horiAdvance", T_INT, offsetof(PyGlyph, horiAdvance), READONLY, (char *)""}, +- {(char *)"linearHoriAdvance", T_INT, offsetof(PyGlyph, linearHoriAdvance), READONLY, (char *)""}, +- {(char *)"vertBearingX", T_INT, offsetof(PyGlyph, vertBearingX), READONLY, (char *)""}, +- {(char *)"vertBearingY", T_INT, offsetof(PyGlyph, vertBearingY), READONLY, (char *)""}, +- {(char *)"vertAdvance", T_INT, offsetof(PyGlyph, vertAdvance), READONLY, (char *)""}, ++ {(char *)"width", T_LONG, offsetof(PyGlyph, width), READONLY, (char *)""}, ++ {(char *)"height", T_LONG, offsetof(PyGlyph, height), READONLY, (char *)""}, ++ {(char *)"horiBearingX", T_LONG, offsetof(PyGlyph, horiBearingX), READONLY, (char *)""}, ++ {(char *)"horiBearingY", T_LONG, offsetof(PyGlyph, horiBearingY), READONLY, (char *)""}, ++ {(char *)"horiAdvance", T_LONG, offsetof(PyGlyph, horiAdvance), READONLY, (char *)""}, ++ {(char *)"linearHoriAdvance", T_LONG, offsetof(PyGlyph, linearHoriAdvance), READONLY, (char *)""}, ++ {(char *)"vertBearingX", T_LONG, offsetof(PyGlyph, vertBearingX), READONLY, (char *)""}, ++ {(char *)"vertBearingY", T_LONG, offsetof(PyGlyph, vertBearingY), READONLY, (char *)""}, ++ {(char *)"vertAdvance", T_LONG, offsetof(PyGlyph, vertAdvance), READONLY, (char *)""}, + {NULL} + }; + +-- +2.11.0 + diff --git a/7768.patch b/b0e4b6708d71df80999764eb4b65cc1d388a521f.patch similarity index 100% rename from 7768.patch rename to b0e4b6708d71df80999764eb4b65cc1d388a521f.patch diff --git a/python-matplotlib.spec b/python-matplotlib.spec index dcfd632..4ed2f6a 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -52,7 +52,7 @@ Name: python-matplotlib Version: 2.0.0 -Release: 0.5%{?rctag:.%{rctag}}%{?dist} +Release: 0.6%{?rctag:.%{rctag}}%{?dist} Summary: Python 2D plotting library Group: Development/Libraries # qt4_editor backend is MIT @@ -72,7 +72,12 @@ Patch9: python-matplotlib-qhull.patch Patch10: python-matplotlib-increase-tests-tolerance.patch Patch11: python-matplotlib-increase-tests-tolerance-aarch64.patch Patch13: python-matplotlib-increase-tests-tolerance-i686.patch -Patch14: https://github.com/matplotlib/matplotlib/pull/7768.patch +# These two patches fix some integer type issues which broke matplotlib +# badly on ppc64 (big-endian) +# https://github.com/matplotlib/matplotlib/pull/7768 +Patch14: https://github.com/matplotlib/matplotlib/commit/b0e4b6708d71df80999764eb4b65cc1d388a521f.patch +# https://github.com/matplotlib/matplotlib/pull/7781 +Patch15: 0001-Fix-integer-types-for-font-metrics-in-PyGlyph-class.patch BuildRequires: freetype-devel BuildRequires: libpng-devel @@ -420,6 +425,7 @@ sed -i 's/\(USE_FONTCONFIG = \)False/\1True/' lib/matplotlib/font_manager.py %patch13 -p1 -b .tests-i686 %endif %patch14 -p1 -b .inttype +%patch15 -p1 -b .moreints chmod -x lib/matplotlib/mpl-data/images/*.svg chmod -x lib/matplotlib/{dates,sankey}.py @@ -618,6 +624,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} \ %endif %changelog +* Mon Jan 09 2017 Adam Williamson - 2.0.0-0.6.b4 +- Fix another integer type issue which caused more issues on ppc64 + * Sun Jan 08 2017 Adam Williamson - 2.0.0-0.5.b4 - Fix int type conversion error that broke text rendering on ppc64 (#1411070)