Hi,

The following diff adds a python3 FLAVOR to py-polib.

I added devel/gettext-tools to BUILD_DEPENDS whereas it is only required
on TEST_DEPENDS. but bsd.port.mk poison it if not present on
BUILD_DEPENDS.

Thanks.
-- 
Sebastien Marie


Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-polib/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile    8 Jan 2016 13:17:15 -0000       1.10
+++ Makefile    2 Nov 2017 12:50:36 -0000
@@ -5,7 +5,7 @@ COMMENT=        Python library to manipulate ge
 MODPY_EGG_VERSION =    1.0.6
 DISTNAME =     polib-${MODPY_EGG_VERSION}
 PKGNAME =      py-${DISTNAME}
-REVISION =     1
+REVISION =     2
 
 CATEGORIES=    textproc devel
 
@@ -18,7 +18,18 @@ MODPY_PI=    Yes
 
 MODPY_SETUPTOOLS = Yes
 
-TEST_DEPENDS = devel/py-coverage
+FLAVOR ?=
+FLAVORS =      python3
+
+# only used on test, but poisoned if not in BUILD_DEPENDS
+BUILD_DEPENDS =        devel/gettext-tools
+
+TEST_DEPENDS = devel/py-coverage${MODPY_FLAVOR}
+
+SUBST_VARS +=  MODPY_MAJOR_VERSION
+
+post-patch:
+       ${SUBST_CMD} ${WRKSRC}/runtests.sh
 
 do-test: fake
        @cd ${WRKSRC} && ${MAKE_ENV} ./runtests.sh
Index: patches/patch-runtests_sh
===================================================================
RCS file: patches/patch-runtests_sh
diff -N patches/patch-runtests_sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-runtests_sh   2 Nov 2017 12:50:36 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+use the right version of coverage
+Index: runtests.sh
+--- runtests.sh.orig
++++ runtests.sh
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+-if which coverage > /dev/null; then
+-    coverage run tests/tests.py
+-    coverage report
++if which coverage${MODPY_MAJOR_VERSION} > /dev/null; then
++    coverage${MODPY_MAJOR_VERSION} run tests/tests.py
++    coverage${MODPY_MAJOR_VERSION} report
+ else
+     /usr/bin/env python tests/tests.py
+ fi
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/py-polib/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   11 Jun 2015 11:44:01 -0000      1.2
+++ pkg/PLIST   2 Nov 2017 12:50:36 -0000
@@ -1,8 +1,8 @@
 @comment $OpenBSD: PLIST,v 1.2 2015/06/11 11:44:01 jasper Exp $
+lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}polib.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/polib-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
 
lib/python${MODPY_VERSION}/site-packages/polib-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
 
lib/python${MODPY_VERSION}/site-packages/polib-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt
 
lib/python${MODPY_VERSION}/site-packages/polib-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt
 
lib/python${MODPY_VERSION}/site-packages/polib-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
 lib/python${MODPY_VERSION}/site-packages/polib.py
-lib/python${MODPY_VERSION}/site-packages/polib.pyc

Reply via email to