diff options
author | wiz <wiz@pkgsrc.org> | 2014-01-16 10:27:36 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2014-01-16 10:27:36 +0000 |
commit | 461f9617c3dd2b5b21a07255233335d0dbd9bc5b (patch) | |
tree | 44f14e7d95582f68b172b3bc2b77658f3fe429bd /lang/python | |
parent | 093c5ed5424cffaa6cc1e6b35481bb51a76ac130 (diff) | |
download | pkgsrc-461f9617c3dd2b5b21a07255233335d0dbd9bc5b.tar.gz |
Add support for python package modules having different pkgsrc packages
depending on python major version.
For now, this supports the dateutil module.
Diffstat (limited to 'lang/python')
-rw-r--r-- | lang/python/versioned_dependencies.mk | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lang/python/versioned_dependencies.mk b/lang/python/versioned_dependencies.mk new file mode 100644 index 00000000000..0cb6e47a0e2 --- /dev/null +++ b/lang/python/versioned_dependencies.mk @@ -0,0 +1,37 @@ +# $NetBSD: versioned_dependencies.mk,v 1.1 2014/01/16 10:27:36 wiz Exp $ +# +# This file determines which separate distribution of a Python +# package is used as dependency, depending on the Python version +# used. +# +# === User-settable variables === +# +# PYTHON_VERSIONED_DEPENDENCIES +# The Python package which should be added as a dependency. +# +# Possible values: dateutil +# Default: (nothing) +# + +.include "../../lang/python/pyversion.mk" + +_SUPPORTED_PACKAGES=# empty +#_SUPPORTED_PACKAGES+=cairo graphics/py-cairo graphics/py-cairo3 +_SUPPORTED_PACKAGES+=dateutil time/py-dateutil time/py-dateutil2 + +.for pkg in ${PYTHON_VERSIONED_DEPENDENCIES} +_PKG_MATCHED= no +.for name py2dir py3dir in ${_SUPPORTED_PACKAGES} +.if ${pkg} == ${name} +_PKG_MATCHED= yes +.if ${PYPKGPREFIX} == "py26" || ${PYPKGPREFIX} == "py27" +DEPENDS+= ${PYPKGPREFIX}-${pkg}-[0-9]*:../../${py2dir} +.else +DEPENDS+= ${PYPKGPREFIX}-${pkg}-[0-9]*:../../${py3dir} +.endif +.endif +.endfor +.if ${_PKG_MATCHED} == "no" +PKG_FAIL_REASON= "${pkg} unsupported in PYTHON_PACKAGE_AUTOSWITCH" +.endif +.endfor |