Saturday, April 15, 2017

Add Python3 flavour to py-greenlet

Hi,

This adds a Python3 FLAVOR to py-greenlet. We will need this for neovim
python plugins.

When using Python3, the library appears to target the pymalloc ABI. I'm
not sure if that is significant (CC Python gurus), but it requires some
PFRAG juggling.

OK?


Index: Makefile
===================================================================
RCS file: /home/edd/cvsync/ports/devel/py-greenlet/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- Makefile 1 Sep 2016 10:53:26 -0000 1.11
+++ Makefile 15 Apr 2017 14:06:03 -0000
@@ -25,10 +25,19 @@ MODULES = lang/python
MODPY_SETUPTOOLS = Yes
MODPY_DISTUTILS_INSTALL= install --prefix=${LOCALBASE} \
--root=${DESTDIR}
+FLAVORS = python3
+FLAVOR ?=
+
+# Python3 version uses pymalloc
+.if ${FLAVOR:Mpython3}
+PKG_ARGS += -Dpymalloc=1
+.else
+PKG_ARGS += -Dpymalloc=0
+.endif

post-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/py-greenlet
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/${MODPY_PY_PREFIX}greenlet
${INSTALL_DATA} ${WRKSRC}/README.rst \
- ${PREFIX}/share/doc/py-greenlet
+ ${PREFIX}/share/doc/${MODPY_PY_PREFIX}greenlet

.include <bsd.port.mk>
Index: pkg/PFRAG.no-pymalloc
===================================================================
RCS file: pkg/PFRAG.no-pymalloc
diff -N pkg/PFRAG.no-pymalloc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PFRAG.no-pymalloc 15 Apr 2017 13:56:41 -0000
@@ -0,0 +1,3 @@
+@comment $OpenBSD: PLIST,v 1.1.1.1 2012/07/17 19:24:47 landry Exp $
+include/python${MODPY_VERSION}/greenlet/
+include/python${MODPY_VERSION}/greenlet/greenlet.h
Index: pkg/PFRAG.pymalloc
===================================================================
RCS file: pkg/PFRAG.pymalloc
diff -N pkg/PFRAG.pymalloc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PFRAG.pymalloc 15 Apr 2017 13:56:18 -0000
@@ -0,0 +1,3 @@
+@comment $OpenBSD: PLIST,v 1.1.1.1 2012/07/17 19:24:47 landry Exp $
+include/python${MODPY_VERSION}m/greenlet/
+include/python${MODPY_VERSION}m/greenlet/greenlet.h
Index: pkg/PLIST
===================================================================
RCS file: /home/edd/cvsync/ports/devel/py-greenlet/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 17 Jul 2012 19:24:47 -0000 1.1.1.1
+++ pkg/PLIST 15 Apr 2017 14:02:51 -0000
@@ -1,6 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/07/17 19:24:47 landry Exp $
-include/python${MODPY_VERSION}/greenlet/
-include/python${MODPY_VERSION}/greenlet/greenlet.h
+%%pymalloc%%
+!%%pymalloc%%
lib/python${MODPY_VERSION}/site-packages/greenlet-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
lib/python${MODPY_VERSION}/site-packages/greenlet.so
share/doc/${MODPY_PY_PREFIX}greenlet/

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

No comments:

Post a Comment