Commit c876321e authored by antoine's avatar antoine
Browse files

Switch PYTHON_REL from a 3 digits number to a 4 digits number to handle

python 2.7.10

Differential Revision:	https://reviews.freebsd.org/D2639
Reviewed by:	sunpoet, mva
parent 2eed36e2
......@@ -10,6 +10,14 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
20150526:
AUTHOR: antoine@FreeBSD.org
PYTHON_REL has been switched from a 3 digits number to a 4 digits number to
handle python 2.7.10. Ports checking for python 2.7.9 should compare
PYTHON_REL against 2709 and ports checking for python 2.7.10 should compare
PYTHON_REL against 2710.
20150521:
AUTHOR: mat@FreeBSD.org
......
......@@ -142,7 +142,7 @@
# PYTHON_PORTSDIR - The port directory of the chosen Python interpreter
#
# PYTHON_REL - The release number of the chosen Python interpreter
# without dots, e.g. 276, 341, ...
# without dots, e.g. 2706, 3401, ...
#
# PYTHON_SUFFIX - The major-minor release number of the chosen Python
# interpreter without dots, e.g. 27, 34, ...
......@@ -383,7 +383,7 @@ PYTHON_REL= # empty
PYTHON_ABIVER= # empty
PYTHON_PORTSDIR= ${_PYTHON_RELPORTDIR}${PYTHON_SUFFIX}
PYTHON_PORTVERSION!= ${MAKE} -V PORTVERSION -C ${PYTHON_PORTSDIR}
PYTHON_REL= ${PYTHON_PORTVERSION:S/.//g}
PYTHON_REL= ${PYTHON_PORTVERSION:C/\.([0-9]+)$/.0\1/:C/\.0?([0-9][0-9])$/.\1/:S/.//g}
# Might be overridden by calling ports
PYTHON_CMD?= ${_PYTHON_BASECMD}${_PYTHON_VERSION}
......@@ -500,7 +500,7 @@ add-plist-pymod:
${_PYTHONPKGLIST} | ${SORT} >> ${TMPPLIST}
.else
.if ${PYTHON_REL} >= 320 && defined(_PYTHON_FEATURE_PY3KPLIST)
.if ${PYTHON_REL} >= 3200 && defined(_PYTHON_FEATURE_PY3KPLIST)
# When Python version is 3.2+ we rewrite all the filenames
# of TMPPLIST that end with .py[co], so that they conform
# to PEP 3147 (see http://www.python.org/dev/peps/pep-3147/)
......@@ -515,7 +515,7 @@ add-plist-post:
pc="__pycache__" mt="$$(${PYMAGICTAG})" \
${TMPPLIST} > ${TMPPLIST}.pyc_tmp
@${MV} ${TMPPLIST}.pyc_tmp ${TMPPLIST}
.endif # ${PYTHON_REL} >= 320 && defined(_PYTHON_FEATURE_PY3KPLIST)
.endif # ${PYTHON_REL} >= 3200 && defined(_PYTHON_FEATURE_PY3KPLIST)
.endif # defined(_PYTHON_FEATURE_AUTOPLIST) && defined(_PYTHON_FEATURE_DISTUTILS)
# Fix for programs that build python from a GNU auto* environment
......
......@@ -27,7 +27,7 @@ python_CMD= ${PYTHON_CMD}
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 320
.if ${PYTHON_REL} < 3200
PYCACHE_DIR= # empty
PYCACHE_FILE= ${PORTNAME}
.else
......
......@@ -30,7 +30,7 @@ MAKE_ENV= BSDDB_VERSION=${BDB_LIB_NAME}
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
IGNORE= bsddb package was removed from core standard library since 3.0, use databases/py-bsddb3 instead
.endif
......
......@@ -30,7 +30,7 @@ WRKSRC= ${WRKDIR}/Python-${PORTVERSION}/Modules
.include <bsd.port.pre.mk>
post-extract:
.if ${PYTHON_REL} < 300
.if ${PYTHON_REL} < 3000
@${CP} ${FILESDIR}/setup.py ${WRKSRC}
.else
@${CP} ${FILESDIR}/setup3.py ${WRKSRC}/setup.py
......
......@@ -64,18 +64,18 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.2:${PORTSDIR}/databases/py-MyS
.endif
.endif
.if ${PYTHON_REL} < 330
.if ${PYTHON_REL} < 3300
TEST_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mock>=1.0.1:${PORTSDIR}/devel/py-mock
.endif
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
pre-build:
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/lib
.endif
post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/doc
.endif
......@@ -88,13 +88,13 @@ post-install:
.endfor
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/examples
.endif
(cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
regression-test: build
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/test
.endif
@cd ${WRKSRC} && ${PYTHON_CMD} sqla_nose.py
......
......@@ -81,12 +81,12 @@ post-patch:
${REINPLACE_CMD} -e 's/import logging/&.handlers/1' -i.bak ${WRKSRC}/test/engine/test_execute.py
pre-build:
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/lib
.endif
post-install:
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${STAGEDIR}${WRKSRC}/doc
.endif
@${MKDIR} ${STAGEDIR}${DOCSDIR}
......@@ -99,12 +99,12 @@ post-install:
.endfor
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/examples
.endif
cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}
.if ${PYTHON_REL} < 300
.if ${PYTHON_REL} < 3000
PLIST_SUB+= SPEEDUPS=""
.else
# C extensions are not supported in py3k
......@@ -112,7 +112,7 @@ PLIST_SUB+= SPEEDUPS="@comment "
.endif
regression-test: build
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/test
.endif
@cd ${WRKSRC} && ${PYTHON_CMD} sqla_nose.py
......
......@@ -40,7 +40,7 @@ EXAMPLESDIR= ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME}
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MCEXTENSIONS} && ${PYTHON_REL} < 300
.if ${PORT_OPTIONS:MCEXTENSIONS} && ${PYTHON_REL} < 3000
PLIST_SUB+= SPEEDUPS=""
.else
PLIST_SUB+= SPEEDUPS="@comment "
......@@ -55,7 +55,7 @@ AL_PORTDOCS_SUBDIR= core dialects orm
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/pymssql.py:${PORTSDIR}/databases/py-mssql
.endif
.if ${PORT_OPTIONS:MMYSQL} && ${PYTHON_REL} < 300
.if ${PORT_OPTIONS:MMYSQL} && ${PYTHON_REL} < 3000
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.2:${PORTSDIR}/databases/py-MySQLdb
.endif
......@@ -76,7 +76,7 @@ RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/Sybase.py:${PORTSDIR}/databases/py-sybase
.endif
post-patch:
.if ${PORT_OPTIONS:MCEXTENSIONS} && ${PYTHON_REL} < 300
.if ${PORT_OPTIONS:MCEXTENSIONS} && ${PYTHON_REL} < 3000
@${REINPLACE_CMD} -e 's|BUILD_CEXTENSIONS = False|BUILD_CEXTENSIONS = True|' \
${WRKSRC}/setup.py
.endif
......
......@@ -31,7 +31,7 @@ PYDISTUTILS_INSTALLARGS+= --install-lib ${PYTHON_LIBDIR}/lib-dynload
.include <bsd.port.pre.mk>
post-extract:
.if ${PYTHON_REL} < 300
.if ${PYTHON_REL} < 3000
@${CP} ${FILESDIR}/setup.py ${WRKSRC}
.else
@${CP} ${FILESDIR}/setup3.py ${WRKSRC}/setup.py
......
......@@ -22,7 +22,7 @@ USE_PYTHON= autoplist distutils
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 270
.if ${PYTHON_REL} < 2700
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}argparse>0:${PORTSDIR}/devel/py-argparse
.endif
......
......@@ -31,7 +31,7 @@ LDFLAGS+= -L${LOCALBASE}/lib
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
USE_GNOME+= py3gobject3
.else
USE_GNOME+= pygobject3
......
......@@ -77,7 +77,7 @@ MAKE_ENV+= NOICEDOCS=yes
.include <bsd.port.pre.mk>
.if defined(PYTHON_REL) && ${PYTHON_REL} >= 320
.if defined(PYTHON_REL) && ${PYTHON_REL} >= 3200
PLIST_SUB+= PYTHON32=""
PLIST_SUB+= PYTHONPRE32="@comment "
.else
......
......@@ -45,14 +45,14 @@ PORT_OPTIONS:= ${PORT_OPTIONS:NEXAMPLES}
.endif
# no problem with Python > 3.2
.if ${PYTHON_REL} >= 320
.if ${PYTHON_REL} >= 3200
pre-build:
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/jinja2
.endif
.if ${PKGNAMESUFFIX} == "-doc"
do-build:
. if ${PYTHON_REL} >= 300
. if ${PYTHON_REL} >= 3000
@${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/docs
. endif
(cd ${WRKSRC}/docs && ${MAKE} html)
......@@ -66,7 +66,7 @@ do-install:
.if ${PORT_OPTIONS:MEXAMPLES}
PORTEXAMPLES= *
post-build:
. if ${PYTHON_REL} >= 300
. if ${PYTHON_REL} >= 3000
${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/examples
. endif
${PYTHON_CMD} -m compileall ${WRKSRC}/examples ; \
......
......@@ -23,7 +23,7 @@ USE_PYTHON= autoplist distutils
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 300
.if ${PYTHON_REL} < 3000
BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dbus>=0.83:${PORTSDIR}/devel/py-dbus
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dbus>=0.83:${PORTSDIR}/devel/py-dbus
.else
......
......@@ -28,7 +28,7 @@ GH_TAGNAME= b24df9f
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 300
.if ${PYTHON_REL} < 3000
TEST_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}unittest2>0:${PORTSDIR}/devel/py-unittest2
.endif
......
......@@ -20,7 +20,7 @@ USE_PYTHON= autoplist concurrent distutils
regression-test: build
# Extra tests for python 3, added in by setup3lib.py
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
@cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} build_tests
.endif
@cd ${WRKSRC} && ${PYTHON_CMD} selftest.py --verbose
......
......@@ -20,7 +20,7 @@ USE_PYTHON= distutils autoplist
# Remove files not python 3 ready and allow compile again
post-patch:
.if ${PYTHON_REL} >= 300
.if ${PYTHON_REL} >= 3000
${RM} ${WRKSRC}/olefile/olefile2.py
.endif
${REINPLACE_CMD} "/install' in sys.argv:/,+1d" ${WRKSRC}/setup.py
......
......@@ -111,7 +111,7 @@ CTAGS_CMD= ${FIND} . -type f \\| ${XARGS} ctags
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MPYTHON}
.if ${PYTHON_REL} < 300
.if ${PYTHON_REL} < 3000
MAKE_ARGS+= CONF_OPT_PYTHON="--enable-pythoninterp --disable-python3interp"
.else
MAKE_ARGS+= CONF_OPT_PYTHON="--enable-python3interp --disable-pythoninterp"
......
......@@ -262,7 +262,7 @@ post-install:
${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
-d ${PYTHONPREFIX_SITELIBDIR} -f ${PYTHONPREFIX_SITELIBDIR:S|${PREFIX}/||})
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
. if defined(PYTHON_REL) && ${PYTHON_REL} >= 300
. if defined(PYTHON_REL) && ${PYTHON_REL} >= 3000
cd ${WRKSRC}/samples/python && \
${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}/python
. else
......
......@@ -12,7 +12,7 @@ OCV_PYTHON= yes
MASTERDIR= ${.CURDIR:H}/opencv
PLIST= ${.CURDIR}/pkg-plist
.if defined(PYTHON_REL) && ${PYTHON_REL} >= 320
.if defined(PYTHON_REL) && ${PYTHON_REL} >= 3200
PLIST_SUB+= PYTHON3="" \
PYTHON2="@comment " \
PYTHON_SUFFIX="${PYTHON_SUFFIX}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment