pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/graphics py-matplotlib: fix PR 53425
details: https://anonhg.NetBSD.org/pkgsrc/rev/5a4f72667a99
branches: trunk
changeset: 310323:5a4f72667a99
user: gson <gson%pkgsrc.org@localhost>
date: Wed Jul 11 16:19:32 2018 +0000
description:
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.
diffstat:
graphics/py-matplotlib-gtk2/Makefile | 4 +-
graphics/py-matplotlib-tk/Makefile | 3 +-
graphics/py-matplotlib/Makefile | 3 +-
graphics/py-matplotlib/distinfo | 3 +-
graphics/py-matplotlib/patches/patch-src_file__compat.h | 29 +++++++++++++++++
5 files changed, 37 insertions(+), 5 deletions(-)
diffs (84 lines):
diff -r c032c0446227 -r 5a4f72667a99 graphics/py-matplotlib-gtk2/Makefile
--- a/graphics/py-matplotlib-gtk2/Makefile Wed Jul 11 12:05:06 2018 +0000
+++ b/graphics/py-matplotlib-gtk2/Makefile Wed Jul 11 16:19:32 2018 +0000
@@ -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 -r c032c0446227 -r 5a4f72667a99 graphics/py-matplotlib-tk/Makefile
--- a/graphics/py-matplotlib-tk/Makefile Wed Jul 11 12:05:06 2018 +0000
+++ b/graphics/py-matplotlib-tk/Makefile Wed Jul 11 16:19:32 2018 +0000
@@ -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 -r c032c0446227 -r 5a4f72667a99 graphics/py-matplotlib/Makefile
--- a/graphics/py-matplotlib/Makefile Wed Jul 11 12:05:06 2018 +0000
+++ b/graphics/py-matplotlib/Makefile Wed Jul 11 16:19:32 2018 +0000
@@ -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 -r c032c0446227 -r 5a4f72667a99 graphics/py-matplotlib/distinfo
--- a/graphics/py-matplotlib/distinfo Wed Jul 11 12:05:06 2018 +0000
+++ b/graphics/py-matplotlib/distinfo Wed Jul 11 16:19:32 2018 +0000
@@ -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 @@
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 -r c032c0446227 -r 5a4f72667a99 graphics/py-matplotlib/patches/patch-src_file__compat.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/py-matplotlib/patches/patch-src_file__compat.h Wed Jul 11 16:19:32 2018 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index