diff options
author | wiz <wiz@pkgsrc.org> | 2022-01-12 08:34:34 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2022-01-12 08:34:34 +0000 |
commit | 95f6a4ff137a99db1081fb057536ec24bf5242fa (patch) | |
tree | 99a83195526ece8beae492a76481e977a62b46bb /lang | |
parent | 734e25dae09008f7d7264f18c6ecd3e32b3371b8 (diff) | |
download | pkgsrc-95f6a4ff137a99db1081fb057536ec24bf5242fa.tar.gz |
python: update comments for *.mk
Also, remove PY_NO_EGG support, unused
Diffstat (limited to 'lang')
-rw-r--r-- | lang/python/egg.mk | 28 | ||||
-rw-r--r-- | lang/python/extension.mk | 27 |
2 files changed, 21 insertions, 34 deletions
diff --git a/lang/python/egg.mk b/lang/python/egg.mk index d4ce4dadefd..74d51f2a5c5 100644 --- a/lang/python/egg.mk +++ b/lang/python/egg.mk @@ -1,4 +1,4 @@ -# $NetBSD: egg.mk,v 1.34 2022/01/09 11:58:15 wiz Exp $ +# $NetBSD: egg.mk,v 1.35 2022/01/12 08:34:34 wiz Exp $ # # Common logic to handle Python Eggs # @@ -6,8 +6,9 @@ .include "../../lang/python/pyversion.mk" # This file should be included to package python "distributions" which -# use setuptools to create an egg. Some distributions use distutils, -# which creates an egg-info file; those should use distutils.mk +# use setuptools to create an egg. +# +# For wheel (*.whl) support, look at wheel.mk. EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info @@ -15,16 +16,15 @@ EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info PYDISTUTILSPKG= yes PY_PATCHPLIST= yes -# True eggs always have an egg-info directory, and thus there is no -# PLIST conditional (as in distutils.mk for old versions of python). -# Note that we substitute EGG_INFODIR rather than EGG_FILE, because -# the egg information in an egg comprises multiple files in an +# True eggs always have an egg-info directory egg.mk can also +# be used for distutils packages, in which case there will be no # egg-info directory. -# The PLIST substitution of EGG_NAME is not necessary. However, it -# is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem -# packages to understand other examples of this feature in non-python -# packages. +# Please note that some packages do not provide this directory +# with the last setuptools version that supports python 2.7. +# In this case, the ${EGG_INFODIR} lines in the PLIST need to +# be prefixed with ${PLIST.py3x} - please always test with both +# python 2.7 and the current python 3.x default! PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX} PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR} @@ -37,10 +37,8 @@ PRINT_PLIST_AWK+= { gsub(/${PYVERSSUFFIX:S,.,\.,g}/, \ USE_PKG_RESOURCES?= no -# py-setuptools depends on a couple py-* packages that need to be installed -# beforehand. Of course, those can not be built and installed using py-setuptools -# itself; so use the setuptools version included with python itself for installing -# them. +# py-setuptools needs to be bootstrapped from python itself, without using +# py-setuptools. BOOTSTRAP_SETUPTOOLS?= no .if ${BOOTSTRAP_SETUPTOOLS} == "yes" TOOL_DEPENDS+= ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat diff --git a/lang/python/extension.mk b/lang/python/extension.mk index 11d915998f3..d851b438832 100644 --- a/lang/python/extension.mk +++ b/lang/python/extension.mk @@ -1,15 +1,12 @@ -# $NetBSD: extension.mk,v 1.58 2020/08/28 00:47:57 gutteridge Exp $ +# $NetBSD: extension.mk,v 1.59 2022/01/12 08:34:34 wiz Exp $ .include "../../lang/python/pyversion.mk" -# Packages that are a non-egg distutils extension should set -# PYDISTUTILSPKG=YES and include this mk file. - # This mk fragment is included to handle packages that create # extensions to python, which by definition are those that place files # in ${PYSITELIB}. Extensions can be implemented via setuptools as -# eggs (see egg.mk), via distutils (confusing, with an egg-info file, -# even though they are not eggs), or via more ad hoc methods. +# eggs (see egg.mk), via wheels (see wheel.mk), or via more ad hoc +# methods. .if defined(PYDISTUTILSPKG) .include "../../mk/bsd.prefs.mk" @@ -49,18 +46,6 @@ do-test: .endif -# PY_NO_EGG suppress the installation of the egg info file (and -# therefore its inclusion in the package). Python practice is be to -# use these files to let 'require' verify that python distributions -# are present, and therefore the default value of PY_NO_EGG=yes causes -# pkgsrc not to conform to python norms. The reason for this behavior -# appears to be that creating egg info files was new in Python 2.5. -PY_NO_EGG?= yes -.if !empty(PY_NO_EGG:M[yY][eE][sS]) -# see python*/patches/patch-Lib_distutils_command_install.py -INSTALL_ENV+= PKGSRC_PYTHON_NO_EGG=defined -.endif - .if defined(PY_PATCHPLIST) PLIST_SUBST+= PYINC=${PYINC} PYLIB=${PYLIB} PYSITELIB=${PYSITELIB} PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX} @@ -69,7 +54,7 @@ PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX} # mostly for ALTERNATIVES files FILES_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX} -# prepare Python>=3.2 bytecode file location change +# Python>=3.2 bytecode file location change # http://www.python.org/dev/peps/pep-3147/ .if empty(_PYTHON_VERSION:M2?) PLIST_AWK+= -f ${PKGSRCDIR}/lang/python/plist-python.awk @@ -80,6 +65,10 @@ EARLY_PRINT_PLIST_AWK+= gsub(/opt-1\.pyc$$/, "pyo") EARLY_PRINT_PLIST_AWK+= gsub(/\.cpython-${_PYTHON_VERSION}/, "")} .endif +# For running tests before installation of the package, +# this is sometimes needed; or setting +# TEST_ENV+= PYTHONPATH=${WRKSRC}/build/lib + DISTUTILS_BUILDDIR_IN_TEST_ENV?= no .if ${DISTUTILS_BUILDDIR_IN_TEST_ENV} == "yes" |