diff options
author | Kubilay Kocak <koobs@FreeBSD.org> | 2016-02-24 13:21:27 +0000 |
---|---|---|
committer | Kubilay Kocak <koobs@FreeBSD.org> | 2016-02-24 13:21:27 +0000 |
commit | cc41e5829248f391e83894f7be93b45e124f2177 (patch) | |
tree | b81b7ba8a13113d6aa9a07f7e4974c37cb4e1061 /graphics/py-pillow | |
parent | 5adb7f344a4313bd9e34d06373c7de12689c036c (diff) | |
download | ports-cc41e5829248f391e83894f7be93b45e124f2177.tar.gz ports-cc41e5829248f391e83894f7be93b45e124f2177.zip |
graphics/py-pillow: Update to 3.1.1, Modernize
- Update PORTVERSION and distinfo checksum (3.1.1)
- Convert remaining conditionals to to OPTIONS helpers
- Replace custom do-install and replace build/install target hacks
- Remove patches (upstream, were previously backported)
- Strip shared extensions
- Extend test suite
Changes:
https://github.com/python-pillow/Pillow/blob/3.1.1/CHANGES.rst
Notes
Notes:
svn path=/head/; revision=409464
Diffstat (limited to 'graphics/py-pillow')
-rw-r--r-- | graphics/py-pillow/Makefile | 96 | ||||
-rw-r--r-- | graphics/py-pillow/distinfo | 4 | ||||
-rw-r--r-- | graphics/py-pillow/files/patch-CVE-2016-0740 | 24 | ||||
-rw-r--r-- | graphics/py-pillow/files/patch-CVE-2016-0775 | 24 | ||||
-rw-r--r-- | graphics/py-pillow/files/patch-libImaging-PcdDecode.c | 33 | ||||
-rw-r--r-- | graphics/py-pillow/files/patch-libImaging-Resample.c | 35 |
6 files changed, 34 insertions, 182 deletions
diff --git a/graphics/py-pillow/Makefile b/graphics/py-pillow/Makefile index 53ff71cd73d2..4a35ca952824 100644 --- a/graphics/py-pillow/Makefile +++ b/graphics/py-pillow/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= pillow -PORTVERSION= 2.9.0 -PORTREVISION= 1 +PORTVERSION= 3.1.1 CATEGORIES= graphics python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -22,84 +21,53 @@ LCMS_DESC= Little Color Management System TKINTER_DESC= Tkinter (Tcl/Tk) BitmapImage & PhotoImage support FREETYPE_LIB_DEPENDS= libfreetype.so:${PORTSDIR}/print/freetype2 +FREETYPE_VARS= PYDISTUTILS_BUILDARGS+=--enable-freetype +FREETYPE_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-freetype + JPEG_USES= jpeg +JPEG_VARS= PYDISTUTILS_BUILDARGS+=--enable-jpeg +JPEG_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-jpeg + LCMS_LIB_DEPENDS= liblcms2.so:${PORTSDIR}/graphics/lcms2 +LCMS_VARS= PYDISTUTILS_BUILDARGS+=--enable-lcms +LCMS_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-lcms + +PNG_VARS= PYDISTUTILS_BUILDARGS+=--enable-zlib +PNG_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-zlib + TIFF_LIB_DEPENDS= libtiff.so:${PORTSDIR}/graphics/tiff +TIFF_VARS= PYDISTUTILS_BUILDARGS+=--enable-tiff +TIFF_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-tiff + TKINTER_USES= tk:build TKINTER_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter TKINTER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter +TKINTER_VARS= PYDISTUTILS_BUILDARGS+=--enable-tcl --enable-tk --include-dirs=${TCL_INCLUDEDIR}:${TK_INCLUDEDIR} +TKINTER_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-tcl --disable-tk + WEBP_LIB_DEPENDS= libwebp.so:${PORTSDIR}/graphics/webp +WEBP_VARS= PYDISTUTILS_BUILDARGS+=--enable-webp +WEBP_VARS_OFF= PYDISTUTILS_BUILDARGS+=--disable-webp -USES= cpe python -USE_GITHUB= yes -USES= python -USE_PYTHON= autoplist concurrent distutils -PYDISTUTILS_SETUP= ${PYSETUP} -PYDISTUTILS_BUILD_TARGET= build build_py build_ext +USES= cpe python +USE_GITHUB= yes +USES= python +USE_PYTHON= autoplist concurrent distutils -# we have to build and install everything in a single run, -# otherwise pillow's build_ext extension tries to be clever -# and messes up standard distutils behaviour... -NO_BUILD= yes +PYDISTUTILS_BUILD_TARGET= build build_ext GH_ACCOUNT= python-${PORTNAME} GH_PROJECT= ${PORTNAME:C/p/P/} CONFLICTS_INSTALL= py*-imaging-* -.include <bsd.port.options.mk> - -.if ${PORT_OPTIONS:MFREETYPE} -PYDISTUTILS_BUILDARGS+= --enable-freetype -.else -PYDISTUTILS_BUILDARGS+= --disable-freetype -.endif - -.if ${PORT_OPTIONS:MJPEG} -PYDISTUTILS_BUILDARGS+= --enable-jpeg -.else -PYDISTUTILS_BUILDARGS+= --disable-jpeg -.endif - -.if ${PORT_OPTIONS:MLCMS} -PYDISTUTILS_BUILDARGS+= --enable-lcms -.else -PYDISTUTILS_BUILDARGS+= --disable-lcms -.endif - -.if ${PORT_OPTIONS:MPNG} -PYDISTUTILS_BUILDARGS+= --enable-zlib -.else -PYDISTUTILS_BUILDARGS+= --disable-zlib -.endif - -.if ${PORT_OPTIONS:MTIFF} -PYDISTUTILS_BUILDARGS+= --enable-tiff -.else -PYDISTUTILS_BUILDARGS+= --disable-tiff -.endif - -.if ${PORT_OPTIONS:MTKINTER} -PYDISTUTILS_BUILDARGS+= --enable-tcl --enable-tk \ - --include-dirs=${TCL_INCLUDEDIR}:${TK_INCLUDEDIR} -.else -PYDISTUTILS_BUILDARGS+= --disable-tcl --disable-tk -.endif - -.if ${PORT_OPTIONS:MWEBP} -PYDISTUTILS_BUILDARGS+= --enable-webp -.else -PYDISTUTILS_BUILDARGS+= --disable-webp -.endif - -do-install: - @(cd ${INSTALL_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \ - ${PYDISTUTILS_SETUP} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDARGS} \ - ${PYDISTUTILS_INSTALL_TARGET} ${PYDISTUTILS_INSTALLARGS}) - -do-test: extract +post-install: + ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/PIL/*.so + +do-test: @cd ${WRKSRC} && \ ${PYTHON_CMD} ${PYSETUP} build_ext -i && \ - ${PYTHON_CMD} selftest.py + ${PYTHON_CMD} selftest.py && \ + ${PYTHON_CMD} -m nose -vx Tests/test_*.py .include <bsd.port.mk> diff --git a/graphics/py-pillow/distinfo b/graphics/py-pillow/distinfo index 65e7f463fa98..4c9baf7d46e5 100644 --- a/graphics/py-pillow/distinfo +++ b/graphics/py-pillow/distinfo @@ -1,2 +1,2 @@ -SHA256 (python-pillow-Pillow-2.9.0_GH0.tar.gz) = e048d3fb43832b09077242dc46f3ed83f09fada0a2386196b7b0eea664422158 -SIZE (python-pillow-Pillow-2.9.0_GH0.tar.gz) = 9320944 +SHA256 (python-pillow-Pillow-3.1.1_GH0.tar.gz) = a2ab64b39378031effdd86a6cd303de7b5b606445ab0338359e9ff9dc3f2e634 +SIZE (python-pillow-Pillow-3.1.1_GH0.tar.gz) = 10051635 diff --git a/graphics/py-pillow/files/patch-CVE-2016-0740 b/graphics/py-pillow/files/patch-CVE-2016-0740 deleted file mode 100644 index e5a25716dc6b..000000000000 --- a/graphics/py-pillow/files/patch-CVE-2016-0740 +++ /dev/null @@ -1,24 +0,0 @@ -From 6dcbf5bd96b717c58d7b642949da8d323099928e Mon Sep 17 00:00:00 2001 -From: Eric Soroos <eric-github@soroos.net> -Date: Thu, 14 Jan 2016 04:59:19 -0800 -Subject: [PATCH] Fix for buffer overflow in TiffDecode.c CVE-2016-0740 - ---- - Tests/check_libtiff_segfault.py | 23 +++++++++++++++++++++++ - Tests/images/libtiff_segfault.tif | Bin 0 -> 262 bytes - libImaging/TiffDecode.c | 2 +- - 3 files changed, 24 insertions(+), 1 deletion(-) - create mode 100644 Tests/check_libtiff_segfault.py - create mode 100644 Tests/images/libtiff_segfault.tif - ---- libImaging/TiffDecode.c -+++ libImaging/TiffDecode.c -@@ -169,7 +169,7 @@ int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, int - char *filename = "tempfile.tif"; - char *mode = "r"; - TIFF *tiff; -- int size; -+ tsize_t size; - - - /* buffer is the encoded file, bytes is the length of the encoded file */ diff --git a/graphics/py-pillow/files/patch-CVE-2016-0775 b/graphics/py-pillow/files/patch-CVE-2016-0775 deleted file mode 100644 index cbd446180284..000000000000 --- a/graphics/py-pillow/files/patch-CVE-2016-0775 +++ /dev/null @@ -1,24 +0,0 @@ -From bcaaf97f4ff25b3b5b9e8efeda364e17e80858ec Mon Sep 17 00:00:00 2001 -From: wiredfool <eric-github@soroos.net> -Date: Wed, 20 Jan 2016 22:37:28 +0000 -Subject: [PATCH] FLI overflow error fix and testcase CVE-2016-0775 - ---- - Tests/check_fli_overflow.py | 16 ++++++++++++++++ - Tests/images/fli_overflow.fli | Bin 0 -> 4645 bytes - libImaging/FliDecode.c | 2 +- - 3 files changed, 17 insertions(+), 1 deletion(-) - create mode 100644 Tests/check_fli_overflow.py - create mode 100644 Tests/images/fli_overflow.fli - ---- libImaging/FliDecode.c -+++ libImaging/FliDecode.c -@@ -185,7 +185,7 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) - /* COPY chunk */ - for (y = 0; y < state->ysize; y++) { - UINT8* buf = (UINT8*) im->image[y]; -- memcpy(buf+x, data, state->xsize); -+ memcpy(buf, data, state->xsize); - data += state->xsize; - } - break; diff --git a/graphics/py-pillow/files/patch-libImaging-PcdDecode.c b/graphics/py-pillow/files/patch-libImaging-PcdDecode.c deleted file mode 100644 index 4c996ee4d8f4..000000000000 --- a/graphics/py-pillow/files/patch-libImaging-PcdDecode.c +++ /dev/null @@ -1,33 +0,0 @@ -From ae453aa18b66af54e7ff716f4ccb33adca60afd4 Mon Sep 17 00:00:00 2001 -From: wiredfool <eric-github@soroos.net> -Date: Tue, 2 Feb 2016 05:46:26 -0800 -Subject: [PATCH] PCD decoder overruns the shuffle buffer, Fixes #568 - ---- - Tests/images/hopper.pcd | Bin 0 -> 788480 bytes - Tests/test_file_pcd.py | 18 ++++++++++++++++++ - libImaging/PcdDecode.c | 4 ++-- - 3 files changed, 20 insertions(+), 2 deletions(-) - create mode 100644 Tests/images/hopper.pcd - create mode 100644 Tests/test_file_pcd.py - ---- libImaging/PcdDecode.c -+++ libImaging/PcdDecode.c -@@ -47,7 +47,7 @@ ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) - out[0] = ptr[x]; - out[1] = ptr[(x+4*state->xsize)/2]; - out[2] = ptr[(x+5*state->xsize)/2]; -- out += 4; -+ out += 3; - } - - state->shuffle((UINT8*) im->image[state->y], -@@ -62,7 +62,7 @@ ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) - out[0] = ptr[x+state->xsize]; - out[1] = ptr[(x+4*state->xsize)/2]; - out[2] = ptr[(x+5*state->xsize)/2]; -- out += 4; -+ out += 3; - } - - state->shuffle((UINT8*) im->image[state->y], diff --git a/graphics/py-pillow/files/patch-libImaging-Resample.c b/graphics/py-pillow/files/patch-libImaging-Resample.c deleted file mode 100644 index de7756ddf32b..000000000000 --- a/graphics/py-pillow/files/patch-libImaging-Resample.c +++ /dev/null @@ -1,35 +0,0 @@ -From 41fae6d9e2da741d2c5464775c7f1a609ea03798 Mon Sep 17 00:00:00 2001 -From: Ned Williamson <nedwilliamson@gmail.com> -Date: Thu, 4 Feb 2016 01:54:12 -0500 -Subject: [PATCH] fix integer overflow in Resample.c - ---- - libImaging/Resample.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- libImaging/Resample.c -+++ libImaging/Resample.c -@@ -138,11 +138,23 @@ ImagingResampleHorizontal(Imaging imIn, int xsize, int filter) - /* maximum number of coofs */ - kmax = (int) ceil(support) * 2 + 1; - -+ // check for overflow -+ if (kmax > 0 && xsize > SIZE_MAX / kmax) -+ return (Imaging) ImagingError_MemoryError(); -+ -+ // sizeof(float) should be greater than 0 -+ if (xsize * kmax > SIZE_MAX / sizeof(float)) -+ return (Imaging) ImagingError_MemoryError(); -+ - /* coefficient buffer */ - kk = malloc(xsize * kmax * sizeof(float)); - if ( ! kk) - return (Imaging) ImagingError_MemoryError(); - -+ // sizeof(int) should be greater than 0 as well -+ if (xsize > SIZE_MAX / (2 * sizeof(int))) -+ return (Imaging) ImagingError_MemoryError(); -+ - xbounds = malloc(xsize * 2 * sizeof(int)); - if ( ! xbounds) { - free(kk); |