diff --git a/lang/python/Makefile b/lang/python/Makefile index 1d4777ba82e..b4834b60498 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -1,7 +1,5 @@ SUBDIR = SUBDIR += 2.7 -SUBDIR += 3.9 -SUBDIR += 3.10 -SUBDIR += 3.11 +SUBDIR += 3 .include diff --git a/lang/python/Makefile.inc b/lang/python/Makefile.inc index c08170c2e4a..eb2462eb8e0 100644 --- a/lang/python/Makefile.inc +++ b/lang/python/Makefile.inc @@ -43,6 +43,7 @@ MAINTAINER = Kurt Mosiejczuk PERMIT_PACKAGE = Yes .if ${VERSION} == "2.7" +V_SUBDIR = ${VERSION} MULTI_PACKAGES = -main -tests -tools -gdbm -idle -tkinter -bsddb DEBUG_PACKAGES ?= -main -gdbm -tkinter -bsddb @@ -50,6 +51,7 @@ DEBUG_PACKAGES ?= -main -gdbm -tkinter -bsddb # setup.py:allow_db_version). XXX revisit if databases/db/v4 is updated to 4.7 ONLY_FOR_ARCHS-bsddb= amd64 i386 .else +V_SUBDIR = 3 MULTI_PACKAGES = -main -tests -gdbm -idle -tkinter DEBUG_PACKAGES ?= -main -gdbm -tkinter .endif @@ -59,7 +61,7 @@ COMPILER_LANGS = c # All subpackages depend on the main python package. -RUN_DEPENDS = ${FULLPKGNAME-main}:lang/python/${VERSION},-main +RUN_DEPENDS = ${FULLPKGNAME-main}:lang/python/${V_SUBDIR},-main LIB_DEPENDS = LIB_DEPENDS-main += archivers/bzip2 \ @@ -70,18 +72,15 @@ RUN_DEPENDS-main = WANTLIB-main += bz2 c crypto expat ffi intl m curses panel pthread \ readline sqlite3 ssl util z .if ${VERSION} != "2.7" -LIB_DEPENDS-main += archivers/xz -WANTLIB-main += lzma -.endif -.if ${VERSION} == "3.11" -LIB_DEPENDS-main += security/libb2 -WANTLIB-main += b2 +LIB_DEPENDS-main += archivers/xz \ + security/libb2 +WANTLIB-main += b2 lzma .endif WANTLIB-tests = WANTLIB-tools = -LIB_DEPENDS-bsddb = lang/python/${VERSION},-main +LIB_DEPENDS-bsddb = lang/python/${V_SUBDIR},-main .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" # XXX recursion: if we have java, then db/v4 depends on libxml LIB_DEPENDS-bsddb += databases/db/v4,no_tcl,no_java,bootstrap @@ -91,10 +90,10 @@ LIB_DEPENDS-bsddb += databases/db/v4 WANTLIB-bsddb = lib/db4/db>=4 pthread python${VERSION} LIB_DEPENDS-gdbm = databases/gdbm \ - lang/python/${VERSION},-main + lang/python/${V_SUBDIR},-main WANTLIB-gdbm = gdbm>=3 pthread python${VERSION} -RUN_DEPENDS-idle = lang/python/${VERSION},-tkinter \ +RUN_DEPENDS-idle = lang/python/${V_SUBDIR},-tkinter \ ${RUN_DEPENDS} WANTLIB-idle = @@ -106,7 +105,7 @@ MODTK_VERSION = 8.5 MODTK_VERSION = 8.6 .endif -LIB_DEPENDS-tkinter = lang/python/${VERSION},-main \ +LIB_DEPENDS-tkinter = lang/python/${V_SUBDIR},-main \ ${MODTK_LIB_DEPENDS} WANTLIB-tkinter = pthread python${VERSION} \ ${MODTK_WANTLIB} diff --git a/lang/python/python.port.mk b/lang/python/python.port.mk index baea69ceedc..89c64e90c71 100644 --- a/lang/python/python.port.mk +++ b/lang/python/python.port.mk @@ -5,50 +5,13 @@ CATEGORIES += lang/python # define the default versions MODPY_DEFAULT_VERSION_2 = 2.7 -MODPY_DEFAULT_VERSION_3 = 3.10 +MODPY_DEFAULT_VERSION_3 = 3.11 # If switching to a new MODPY_DEFAULT_VERSION_3, say 3.x to 3.y: -# - All ports with a run/lib dep on python must be REVISION-bumped. -# - Move PY_DEFAULTONLY and --with-ensurepip=no from 3.x/Makefile -# to 3.y/Makefile (remove from old, add to new), regenerate PLISTs -# to add/remove "ensurepip" files. -# - In 3.x/Makefile and 3.y/Makefile, bump REVISION for -main and -idle -# (i.e. those PLISTs with "PY_DEFAULTONLY" lines) -# - In 3.y/PLIST-main and 3.y/PLIST-idle add a @conflict on the old -# REVISION of the old version. For example, for the 3.8->3.9 switch, -# 3.8 -main was 3.8.12p2 and -idle was 3.8.12, so the following -# were needed: -# PLIST-main: @conflict python->=3,<3.8.12p3 -# PLIST-idle: @conflict python-idle->=3,<3.8.12p0 -# (Bear in mind that the subpackages might have different REVISIONs) -# - In 3.x (old default) add a conflict marker with the old versions of -# py3-pip and py3-setuptools (bin/pip3.x and lib/python3.x files were -# in pip/setuptools packages but will now be in python3.x "ensurepip" -# files) +# - All ports with PLISTs that depend on the Python version number +# must be REVISION-bumped. # - Keep xenocara/share/mk/bsd.xorg.mk PYTHON_VERSION in sync -# If later *removing* an old version: -# - *move* the numbered @conflict python-*->=3.2,<3.x to the new version -# and update e.g. to @conflict python-*->=3.2,<3.y -# - *move* the @pkgpath markers to the new version and add a new one for -# the old version you have just retired. -# - bump revision for any plists that have changed - -# In all cases: -# - keep the @conflict python-*-${VERSION_SPEC} PLIST lines as-is, they are -# there to override the "@option no-default-conflict" and set automatically -# from the variable defined in 3.x/Makefile. -# - after a change to PLISTs (or dependencies etc) in -current, keep -# the package version in -current higher than in -stable for the -# previous version (i.e. change made in 7.1-current -> REVISION -# must be set higher in 7.1-current/7.2 than 7.1-stable and this -# needs to be kept when Python is updated in -stable) - -# Also note: -# - Some subpackages e.g. -idle have a conflict on an old version of the main -# package e.g. "@conflict python->=3.6,<3.6.8p0", this is due to a file -# moving between subpackages in the past. - .if !defined(MODPY_VERSION) FLAVOR ?= @@ -72,10 +35,11 @@ MODPY_VERSION ?= ${MODPY_DEFAULT_VERSION_2} .endif # verify if MODPY_VERSION found is correct -.if ${MODPY_VERSION} != "2.7" && \ - ${MODPY_VERSION} != "3.9" && \ - ${MODPY_VERSION} != "3.10" && \ - ${MODPY_VERSION} != "3.11" +.if ${MODPY_VERSION} == "2.7" +_MODPY_SUBDIR = 2.7 +.elif ${MODPY_VERSION} == "3.11" +_MODPY_SUBDIR = 3 +.else ERRORS += "Fatal: unknown or unsupported MODPY_VERSION: ${MODPY_VERSION}" .endif @@ -83,6 +47,7 @@ MODPY_MAJOR_VERSION = ${MODPY_VERSION:R} .if ${MODPY_MAJOR_VERSION} == 2 MODPY_FLAVOR = +# use MODPY_BIN_SUFFIX for binaries to avoid conflict MODPY_BIN_SUFFIX = -2 MODPY_PY_PREFIX = py- MODPY_PYCACHE = @@ -94,7 +59,6 @@ MODPY_PYOEXTENSION = pyo # replace py- prefix by py3- FULLPKGNAME ?= ${PKGNAME:S/^py-/py3-/}${FLAVOR_EXT:S/-python3//} MODPY_FLAVOR = ,python3 -# use MODPY_BIN_SUFFIX for binaries to avoid conflict MODPY_BIN_SUFFIX = MODPY_PY_PREFIX = py3- MODPY_PYCACHE = __pycache__/ @@ -121,9 +85,9 @@ MODPY_PYTEST ?= Yes MODPY_WANTLIB = python${MODPY_VERSION} -MODPY_RUN_DEPENDS = lang/python/${MODPY_VERSION} -MODPY_LIB_DEPENDS = lang/python/${MODPY_VERSION} -_MODPY_BUILD_DEPENDS = lang/python/${MODPY_VERSION} +MODPY_RUN_DEPENDS = lang/python/${_MODPY_SUBDIR} +MODPY_LIB_DEPENDS = lang/python/${_MODPY_SUBDIR} +_MODPY_BUILD_DEPENDS = lang/python/${_MODPY_SUBDIR} .if ${MODPY_PYTEST:L} == "yes" . if ${MODPY_VERSION} == ${MODPY_DEFAULT_VERSION_2} @@ -259,7 +223,7 @@ SITES = ${SITE_PYPI:=${MODPY_PI_DIR}/} HOMEPAGE ?= https://pypi.python.org/pypi/${_MODPY_EGG_NAME} .endif -MODPY_TKINTER_DEPENDS = lang/python/${MODPY_VERSION},-tkinter +MODPY_TKINTER_DEPENDS = lang/python/${_MODPY_SUBDIR},-tkinter MODPY_BIN = ${LOCALBASE}/bin/python${MODPY_VERSION} MODPY_INCDIR = ${LOCALBASE}/include/python${MODPY_VERSION}