dev-python/reportlab: Add patch for >=pillow-6
authorDavid Seifert <soap@gentoo.org>
Sun, 21 Apr 2019 12:18:59 +0000 (14:18 +0200)
committerDavid Seifert <soap@gentoo.org>
Sun, 21 Apr 2019 12:18:59 +0000 (14:18 +0200)
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: David Seifert <soap@gentoo.org>
dev-python/reportlab/files/reportlab-3.5.13-pillow-VERSION.patch [new file with mode: 0644]
dev-python/reportlab/reportlab-3.5.13-r1.ebuild [moved from dev-python/reportlab/reportlab-3.5.13.ebuild with 96% similarity]

diff --git a/dev-python/reportlab/files/reportlab-3.5.13-pillow-VERSION.patch b/dev-python/reportlab/files/reportlab-3.5.13-pillow-VERSION.patch
new file mode 100644 (file)
index 0000000..3b2093d
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/src/reportlab/lib/utils.py
++++ b/src/reportlab/lib/utils.py
+@@ -883,7 +883,13 @@
+                     im = self._image
+                     mode = self.mode = im.mode
+                     if mode in ('LA','RGBA'):
+-                        if Image.VERSION.startswith('1.1.7'): im.load()
++                        # Pillow 6.0.0 and above have removed the 'VERSION' attribute
++                        # https://bitbucket.org/rptlab/reportlab/issues/176/incompatibility-with-pillow-600
++                        try:
++                            im_ver = Image.__version__
++                        except AttributeError:
++                            im_ver = Image.VERSION
++                        if im_ver.startswith('1.1.7'): im.load()
+                         self._dataA = ImageReader(im.split()[3 if mode=='RGBA' else 1])
+                         nm = mode[:-1]
+                         im = im.convert(nm)
similarity index 96%
rename from dev-python/reportlab/reportlab-3.5.13.ebuild
rename to dev-python/reportlab/reportlab-3.5.13-r1.ebuild
index 26d754790dd78f50b4380c6bf5883cfb977966a3..77800e21ecca884543110cd57e980f56984c718b 100644 (file)
@@ -29,6 +29,7 @@ DEPEND="${RDEPEND}
 
 PATCHES=(
        "${FILESDIR}/${PN}-3.5.13-disable-network-tests.patch"
+       "${FILESDIR}/${PN}-3.5.13-pillow-VERSION.patch"
 )
 
 src_unpack() {