Commit 61e8e566 authored by mva's avatar mva
Browse files

- Rename PYTHON_FEATURES to USE_PYTHON to comply to USE_PERL5 and to avoid a

  conflict in behaviour with the read-only COMPILER_FEATURES knob
- Fix the deprecated USE_PYTHON_BUILD and USE_PYTHON_RUN behaviour, which
  usually should be mutually exclusive, but some ports include both knobs

Phabric:		D581
Recommended by:	danfe@, makc@
Reviewed by:	danfe, wg, antoine
Approved by:	portmgr
With hat:		python@
parent a07c225f
......@@ -22,10 +22,10 @@ AUTHOR: mva@FreeBSD.org
...
Additionally, several Python specific features have been converted
to USES-inspired PYTHON_FEATURES=<featureA>,<featureB>.
to USES-inspired USE_PYTHON=<featureA>,<featureB>.
USE_PYDISTUTILS becomes PYTHON_FEATURES=distutils
PYDISTUTILS_AUTOPLIST becomes PYTHON_FEATURES=autoplist
USE_PYDISTUTILS becomes USE_PYTHON=distutils
PYDISTUTILS_AUTOPLIST becomes USE_PYTHON=autoplist
...
Please read the header comments of Uses/python.mk for more details
......
......@@ -40,7 +40,7 @@
#
# Variables, which can be set by the port:
#
# PYTHON_FEATURES - A list of additional features and functionality to
# USE_PYTHON - A list of additional features and functionality to
# enable. Supported features are:
#
# concurrent - Indicates that the port can be installed for
......@@ -80,7 +80,7 @@
# when defined. Use this for ports that do *not* use
# standard Python packaging mechanisms such as
# distutils, and support *both* Python 2.x and 3.x.
# Not needed, if PYTHON_FEATURES=autoplist is set.
# Not needed, if USE_PYTHON=autoplist is set.
#
# pythonprefix - Says that the port installs in ${PYTHONBASE} instead
# of ${PREFIX}.
......@@ -169,7 +169,7 @@
#
# There are PREFIX-clean variants of the PYTHON_*DIR variables above.
# They are meant to be used by ports instead of the above variables, so the
# ports respect ${PREFIX} (unless PYTHON_FEATURES=pythonprefix is specified).
# ports respect ${PREFIX} (unless USE_PYTHON=pythonprefix is specified).
#
# PYTHONPREFIX_INCLUDEDIR default: ${PREFIX}/include/${PYTHON_VERSION}
# PYTHONPREFIX_LIBDIR default: ${PREFIX}/lib/${PYTHON_VERSION}
......@@ -197,16 +197,16 @@
# Deprecated variables, which exist for compatibility and will be removed
# soon:
#
# USE_PYDISTUTILS - Deprecated, use PYTHON_FEATURES=distutils instead
# USE_PYDISTUTILS - Deprecated, use USE_PYTHON=distutils instead
#
# PYDISTUTILS_AUTOPLIST
# - Deprecated, use PYTHON_FEATURES=autoplist instead
# - Deprecated, use USE_PYTHON=autoplist instead
#
# PYTHON_PY3K_PLIST_HACK
# - Deprecated, use PYTHON_FEATURES=py3kplist instead
# - Deprecated, use USE_PYTHON=py3kplist instead
#
# PYDISTUTILS_NOEGGINFO
# - Deprecated, use PYTHON_FEATURES=noegginfo instead
# - Deprecated, use USE_PYTHON=noegginfo instead
#
# PYTHON_MASTER_SITES
# - Deprecated, use MASTER_SITE_PYTHON instead,
......@@ -223,9 +223,9 @@
# default: -py${PYTHON_SUFFIX}
#
# PYTHON_CONCURRENT_INSTALL
# - Deprecated, use PYTHON_FEATURES=concurrent instead
# - Deprecated, use USE_PYTHON=concurrent instead
#
# USE_PYTHON_PREFIX - Deprecated, use PYTHON_FEATURES=pythonprefix instead
# USE_PYTHON_PREFIX - Deprecated, use USE_PYTHON=pythonprefix instead
#
# PYDISTUTILS_INSTALLNOSINGLE
# - Deprecated without replacement
......@@ -247,44 +247,75 @@ python_ARGS= #empty
.endif
# COMPAT KNOBS, remove them, once the tree is cleaned
.undef _PY_COMPAT_OLD
# We will reuse USE_PYTHON with a different meaning, so make sure that, while
# we are in the transition phase from USE_PYTHON -> USES=python, it is mapped
# and reassigned correctly
.if defined(USE_PYTHON_BUILD) || defined(USE_PYTHON_RUN)
# old style
_PY_COMPAT_OLD= yes
.elif defined(USE_PYTHON)
.if ${USE_PYTHON} == "yes"
# old style
_PY_COMPAT_OLD= yes
.elif ${USE_PYTHON:C/[-0-9.+]*//} == ""
# old style X.Y, X.Y+, X.Y-, -X.Y, X.Y-Z.A
_PY_COMPAT_OLD= yes
.endif # ${USE_PYTHON} == "yes" ...
.endif # defined(USE_PYTHON_BUILD) || defined(USE_PYTHON_RUN)
.if defined(_PY_COMPAT_OLD)
.if defined(USE_PYTHON)
.if ${USE_PYTHON} != "yes"
python_ARGS= ${USE_PYTHON}
python_ARGS:= ${USE_PYTHON}
.endif
.elif defined(USE_PYTHON_BUILD)
.else
.if defined(USE_PYTHON_BUILD)
.if ${USE_PYTHON_BUILD} != "yes"
python_ARGS= ${USE_PYTHON_BUILD},build
.else
python_ARGS= build
.endif
.elif defined(USE_PYTHON_RUN)
.endif # defined(USE_PYTHON_BUILD)
.if defined(USE_PYTHON_RUN)
.if ${USE_PYTHON_RUN} != "yes"
python_ARGS= ${USE_PYTHON_RUN},run
python_ARGS+= ${USE_PYTHON_RUN},run
.else
python_ARGS+= run
.endif
.endif # defined(USE_PYTHON_RUN)
.endif # defined(USE_PYTHON)
.if !defined(PYTHON_FEATURES)
PYTHON_FEATURES=
# Everything passed to python_ARGS, undef USE_PYTHON, since we will reuse
# it with a different meaning below
.undef USE_PYTHON
.endif # defined(_PY_COMPAT_OLD)
.undef _PY_COMPAT_OLD
.if !defined(USE_PYTHON)
USE_PYTHON=
.if defined(USE_PYDISTUTILS)
PYTHON_FEATURES+= distutils
USE_PYTHON+= distutils
.endif
.if defined(PYDISTUTILS_AUTOPLIST)
PYTHON_FEATURES+= autoplist
USE_PYTHON+= autoplist
.endif
.if defined(PYTHON_PY3K_PLIST_HACK)
PYTHON_FEATURES+= py3kplist
USE_PYTHON+= py3kplist
.endif
.if defined(PYTHON_CONCURRENT_INSTALL)
PYTHON_FEATURES+= concurrent
USE_PYTHON+= concurrent
.endif
.if defined(USE_PYTHON_PREFIX)
PYTHON_FEATURES+= pythonprefix
USE_PYTHON+= pythonprefix
.endif
.if defined(PYDISTUTILS_NOEGGINFO)
PYTHON_FEATURES+= noegginfo
USE_PYTHON+= noegginfo
.endif
.endif # !defined(PYTHON_FEATURES)
.endif # !defined(USE_PYTHON)
# COMPAT KNOBS END
# Make each individual feature available as _PYTHON_FEATURE_<FEATURENAME>
.for var in ${PYTHON_FEATURES:S/,/ /g}
.for var in ${USE_PYTHON:S/,/ /g}
_PYTHON_FEATURE_${var:tu}= yes
.endfor
......@@ -468,10 +499,10 @@ _PYTHONPKGLIST= ${WRKDIR}/.PLIST.pymodtmp
# What makes a port 'bound' to a certain python version?
# - it installs data into PYTHON_SITELIBDIR, PYTHON_INCLUDEDIR, ...
# - it links against libpython*.so
# - it uses PYTHON_FEATURES=distutils
# - it uses USE_PYTHON=distutils
#
.if defined(NO_STAGE) && defined(_PYTHON_FEATURE_CONCURRENT)
BROKEN= PYTHON_FEATURES=concurrent uses USES=uniquefiles, which is not stage-safe
BROKEN= USE_PYTHON=concurrent uses USES=uniquefiles, which is not stage-safe
.endif
.if defined(_PYTHON_FEATURE_CONCURRENT)
......
......@@ -118,11 +118,12 @@ DEV_WARNING+= "USE_AUTOTOOLS=libtool is deprecated, please use USES=libtool"
DEV_WARNING+= "USE_GNOME=ltverhack is deprecated, please use USES=libtool"
.endif
.if defined(USE_PYTHON)
.if ${USE_PYTHON} != "yes"
DEV_WARNING+= "USE_PYTHON is deprecated, please use USES=python:${USE_PYTHON}"
.if defined(USE_PYTHON) && (${USE_PYTHON} == "yes" || ${USE_PYTHON:C/[-0-9.+]*//} == "")
_PYTHON_VAL := ${USE_PYTHON}
.if ${_PYTHON_VAL} != "yes"
DEV_WARNING+= "USE_PYTHON=${_PYTHON_VAL} is deprecated, please use USES=python:${_PYTHON_VAL}"
.else
DEV_WARNING+= "USE_PYTHON is deprecated, please use USES=python"
DEV_WARNING+= "USE_PYTHON=yes is deprecated, please use USES=python"
.endif
.endif
.if defined(USE_PYTHON_RUN)
......@@ -173,12 +174,12 @@ USE_FUSE_ALT= USES=fuse
USE_GETTEXT_ALT= USES=gettext
USE_SCONS_ALT= USES=scons
USE_DRUPAL_ALT= USES=drupal
USE_PYDISTUTILS_ALT= PYTHON_FEATURES=distutils
PYTHON_CONCURRENT_INSTALL_ALT= PYTHON_FEATURES=concurrent
PYDISTUTILS_AUTOPLIST_ALT= PYTHON_FEATURES=autoplist
PYTHON_PY3K_PLIST_HACK_ALT= PYTHON_FEATURES=py3kplist
PYDISTUTILS_NOEGGINFO_ALT= PYTHON_FEATURES=noegginfo
USE_PYTHON_PREFIX_ALT= PYTHON_FEATURES=pythonprefix
USE_PYDISTUTILS_ALT= USE_PYTHON=distutils
PYTHON_CONCURRENT_INSTALL_ALT= USE_PYTHON=concurrent
PYDISTUTILS_AUTOPLIST_ALT= USE_PYTHON=autoplist
PYTHON_PY3K_PLIST_HACK_ALT= USE_PYTHON=py3kplist
PYDISTUTILS_NOEGGINFO_ALT= USE_PYTHON=noegginfo
USE_PYTHON_PREFIX_ALT= USE_PYTHON=pythonprefix
PYTHON_PKGNAMESUFFIX_ALT= PYTHON_PKGNAMEPREFIX
PYTHON_MASTER_SITES_ALT= MASTER_SITE_PYTHON
NO_INSTALL_MANPAGES_ALT= USES=imake:noman
......
......@@ -12,7 +12,7 @@ COMMENT= ATK accessibility wrapper for python
USES= pkgconfig python:2
USE_GNOME= atk
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
EXAMPLES= atkaction.py atkapplication.py atkcapi.c atktext.py atkvalue.py \
msaaapplication.py msaacapi.cpp
......
......@@ -22,8 +22,8 @@ MATPLOTLIB_DESC= Add support for Matplotlib
PYFITS_DESC= Add Support for PyFITS
PYGAME_DESC= Add Support for PyGame
USES= python
PYTHON_FEATURES= distutils autoplist
USES= python
USE_PYTHON= distutils autoplist
MATPLOTLIB_RUN_DEPENDS= ${PKGNAMEPREFIX}matplotlib>=0.98:${PORTSDIR}/math/py-matplotlib
PYFITS_RUN_DEPENDS= ${PKGNAMEPREFIX}pyfits>=1.1:${PORTSDIR}/astro/py-pyfits
......
......@@ -11,6 +11,6 @@ MAINTAINER= mva@FreeBSD.org
COMMENT= PyAL is a binding of OpenAL for Python
USES= openal:al python
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
.include <bsd.port.mk>
......@@ -12,7 +12,7 @@ COMMENT= Pure-Python Interface to the PostgreSQL Database
LICENSE= BSD3CLAUSE
USES= python:2
PYTHON_FEATURES= distutils autoplist
USES= python:2
USE_PYTHON= distutils autoplist
.include <bsd.port.mk>
......@@ -18,7 +18,7 @@ RUN_DEPENDS= pytest:${PORTSDIR}/devel/py-logilab-common
USES= python
WRKSRC= ${WRKDIR}/logilab-astroid-e003574ae51b
MAKE_ENV= NO_SETUPTOOLS=1
PYTHON_FEATURES=distutils
USE_PYTHON= distutils
.include <bsd.port.pre.mk>
......
......@@ -13,7 +13,7 @@ COMMENT= Dynamic Scripting for adaptive AI systems
LICENSE= ZLIB
USES= python
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
OPTIONS_DEFINE= DOCS
......
......@@ -20,7 +20,7 @@ RUN_DEPENDS= ${PYNUMPY}
USES= python
USE_SDL= ttf image mixer sdl
USE_GCC= any
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
SDLNOX11= sdl-nox11-[0-9]*
......
......@@ -16,7 +16,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dateutil>0:${PORTSDIR}/devel/py-dateutil \
${PYTHON_PKGNAMEPREFIX}pytz>0:${PORTSDIR}/devel/py-pytz
USES= python:2
PYTHON_FEATURES= distutils, autoplist
USE_PYTHON= distutils autoplist
DOCSDIR= ${PREFIX}/share/doc/py-${PORTNAME}
PORTDOCS= *
......
......@@ -15,6 +15,6 @@ LICENSE= LGPL20
USES= python
MAKE_ENV= NO_SETUPTOOLS=1
PYTHON_FEATURES=distutils
USE_PYTHON= distutils
.include <bsd.port.mk>
......@@ -19,7 +19,6 @@ RUN_DEPENDS= ${LOCALBASE}/include/${PYTHON_VERSION}/pygame/pygame.h:${PORTSDIR}/
USES= python:2
USE_GNOME= atk
PYTHON_FEATURES= autoplist distutils
USE_PYTHON= autoplist distutils
.include <bsd.port.mk>
......@@ -13,7 +13,7 @@ COMMENT= Python Lex-Yacc
LICENSE= BSD3CLAUSE
USES= python
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
PORTDOCS= ply.html internal.html README
......
......@@ -12,9 +12,9 @@ COMMENT= Python bindings to the SDL2 libraries
LICENSE= ZLIB
USES= python
USE_SDL= sdl2 gfx2 image2 ttf2 mixer2
PYTHON_FEATURES= autoplist distutils
USES= python
USE_SDL= sdl2 gfx2 image2 ttf2 mixer2
USE_PYTHON= autoplist distutils
OPTIONS_DEFINE= DOCS
......
......@@ -12,7 +12,7 @@ COMMENT= Python source code checking tool to help hunting common bugs
LICENSE= BSD3CLAUSE
USES= python
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
DOCS= ChangeLog COPYRIGHT KNOWN_BUGS MAINTAINERS README TODO VERSION
......
......@@ -16,7 +16,7 @@ LICENSE= LGPL21
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}astroid>=1.1.0:${PORTSDIR}/devel/py-astroid
USES= python
PYTHON_FEATURES=distutils
USE_PYTHON= distutils
OPTIONS_DEFINE= GUI
......
......@@ -14,7 +14,7 @@ COMMENT= Programming Language for writing Python extension modules
LICENSE= APACHE20
USES= python:2
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}/Manual
......
......@@ -16,7 +16,7 @@ LICENSE= GPLv2
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/Crypto/__init__.py:${PORTSDIR}/security/py-pycrypto
USES= python
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
USE_WX= 3.0+
WX_COMPS= python
......
......@@ -18,7 +18,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinte
${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging
USES= python tar:bzip2
PYTHON_FEATURES=autoplist distutils
USE_PYTHON= autoplist distutils
PLIST_FILES= share/pixmaps/pysolfc.png
DATADIR= ${PREFIX}/share/PySolFC
......
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