diff options
author | gson <gson@pkgsrc.org> | 2018-07-11 16:19:32 +0000 |
---|---|---|
committer | gson <gson@pkgsrc.org> | 2018-07-11 16:19:32 +0000 |
commit | 93741eb9e018ccf8bcec17eb45be8ac3562b6e8b (patch) | |
tree | 30ca9e1cd2608a9c63832fc037381e00fff3d5e6 | |
parent | cf69bc96b475baf46ad177ddee4b5f6d0dfa9554 (diff) | |
download | pkgsrc-93741eb9e018ccf8bcec17eb45be8ac3562b6e8b.tar.gz |
py-matplotlib: fix PR 53425
Don't call fflush() on a read-only file pointer; it is an error on BSD
systems and causes the import of matplotlib.pyplot to fail.
-rw-r--r-- | graphics/py-matplotlib-gtk2/Makefile | 4 | ||||
-rw-r--r-- | graphics/py-matplotlib-tk/Makefile | 3 | ||||
-rw-r--r-- | graphics/py-matplotlib/Makefile | 3 | ||||
-rw-r--r-- | graphics/py-matplotlib/distinfo | 3 | ||||
-rw-r--r-- | graphics/py-matplotlib/patches/patch-src_file__compat.h | 29 |
5 files changed, 37 insertions, 5 deletions
diff --git a/graphics/py-matplotlib-gtk2/Makefile b/graphics/py-matplotlib-gtk2/Makefile index 48ce4598792..1efed09bc10 100644 --- a/graphics/py-matplotlib-gtk2/Makefile +++ b/graphics/py-matplotlib-gtk2/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.66 2018/04/16 14:34:40 wiz Exp $ +# $NetBSD: Makefile,v 1.67 2018/07/11 16:19:32 gson Exp $ -PKGREVISION= 1 +PKGREVISION= 2 .include "../../graphics/py-matplotlib/Makefile.common" PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/-/-gtk-/} diff --git a/graphics/py-matplotlib-tk/Makefile b/graphics/py-matplotlib-tk/Makefile index 09fe0cd4891..ccf458d6b60 100644 --- a/graphics/py-matplotlib-tk/Makefile +++ b/graphics/py-matplotlib-tk/Makefile @@ -1,5 +1,6 @@ -# $NetBSD: Makefile,v 1.33 2018/04/14 12:52:56 adam Exp $ +# $NetBSD: Makefile,v 1.34 2018/07/11 16:19:32 gson Exp $ +PKGREVISION= 1 .include "../../graphics/py-matplotlib/Makefile.common" PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/-/-tk-/} diff --git a/graphics/py-matplotlib/Makefile b/graphics/py-matplotlib/Makefile index 235f09d5bd1..deb8a481b3d 100644 --- a/graphics/py-matplotlib/Makefile +++ b/graphics/py-matplotlib/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.52 2018/04/14 12:52:56 adam Exp $ +# $NetBSD: Makefile,v 1.53 2018/07/11 16:19:32 gson Exp $ .include "Makefile.common" PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +PKGREVISION= 1 COMMENT= Matlab-style plotting package for Python DEPENDS+= ${PYPKGPREFIX}-cairo-[0-9]*:../../graphics/py-cairo diff --git a/graphics/py-matplotlib/distinfo b/graphics/py-matplotlib/distinfo index e8f60a2d97c..112b271bf8d 100644 --- a/graphics/py-matplotlib/distinfo +++ b/graphics/py-matplotlib/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.30 2018/04/14 12:52:56 adam Exp $ +$NetBSD: distinfo,v 1.31 2018/07/11 16:19:32 gson Exp $ SHA1 (matplotlib-2.2.2.tar.gz) = dac0d6b9d7eee31e6240d454cb2ff896215429e4 RMD160 (matplotlib-2.2.2.tar.gz) = ffc08d6f14856079653aece2068b99396ab5f9f4 @@ -6,3 +6,4 @@ SHA512 (matplotlib-2.2.2.tar.gz) = 1d21ef821190f22354098f8f0db6449f237acbf3c1419 Size (matplotlib-2.2.2.tar.gz) = 37317332 bytes SHA1 (patch-setup.py) = 0088019e1296d245021fb592915226618d91495d SHA1 (patch-src___macosx.m) = 5b46ec15d2f66ae1ee489b6714c2731dd476d50c +SHA1 (patch-src_file__compat.h) = 5785353fb66c1f5036752e2975dc36a65112a0a6 diff --git a/graphics/py-matplotlib/patches/patch-src_file__compat.h b/graphics/py-matplotlib/patches/patch-src_file__compat.h new file mode 100644 index 00000000000..3aad3482a65 --- /dev/null +++ b/graphics/py-matplotlib/patches/patch-src_file__compat.h @@ -0,0 +1,29 @@ +$NetBSD: patch-src_file__compat.h,v 1.1 2018/07/11 16:19:32 gson Exp $ + +Do not call the flush method on a file object opened for reading, +bcause it returns an error on BSD systems, with the end result +that importing matplotlib fails as reported in PR pkg/53425. + +--- src/file_compat.h.orig 2018-03-06 04:47:09.000000000 +0000 ++++ src/file_compat.h +@@ -60,12 +60,15 @@ static NPY_INLINE FILE *mpl_PyFile_Dup(P + mpl_off_t pos; + FILE *handle; + +- /* Flush first to ensure things end up in the file in the correct order */ +- ret = PyObject_CallMethod(file, (char *)"flush", (char *)""); +- if (ret == NULL) { +- return NULL; ++ if (mode[0] != 'r') { ++ /* Flush first to ensure things end up in the file in the correct order */ ++ ret = PyObject_CallMethod(file, (char *)"flush", (char *)""); ++ if (ret == NULL) { ++ return NULL; ++ } ++ Py_DECREF(ret); + } +- Py_DECREF(ret); ++ + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; |