diff Makefile @ 63:87850df999db

Make compilation for Python 3.10 work: Refactor SHEBANG_FILES
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 11 Jan 2024 01:14:40 +0100
parents 4a2bf3c9eb24
children 4f846c664620
line wrap: on
line diff
--- a/Makefile	Wed Jan 10 18:54:58 2024 +0100
+++ b/Makefile	Thu Jan 11 01:14:40 2024 +0100
@@ -55,7 +55,36 @@
 MAKE_ENV+=	PYPY_LOCALBASE=${LOCALBASE} LDSHARED="${CC} -shared"
 PACKAGE_ARGS?=	--without-gdbm --without-sqlite3 --without-_tkinter
 LLD_UNSAFE=	yes
-SHEBANG_FILES?=	lib-python/2.7/plat-mac/appletrunner.py \
+
+python_OLD_CMD=	${LOCALBASE}/bin/python
+python_CMD=	${PREFIX}/bin/${PORTNAME}
+
+.if ${PORTNAME} != pypy
+PYPY_BUILD_DEPENDS=	pypy:lang/pypy
+PYPY_MINMEM_BUILD_DEPENDS=	pypy:lang/pypy
+.endif
+PYPY_VARS=	PYTHON_CMD=${LOCALBASE}/bin/pypy
+PYPY_MINMEM_VARS=	PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
+PYTHON_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser@${PY_FLAVOR}
+PYTHON_USES=	python:2.7,build
+
+DESCR=		${.CURDIR}/pkg-descr
+PATCHDIR=	${.CURDIR}/files
+
+.include "bsd.pypy.mk"
+#.include <bsd.port.pre.mk>
+
+DISTINFO_FILE?=	${.CURDIR}/distinfo
+PLIST?=		${.CURDIR}/pkg-plist
+
+.if ${OPSYS} == FreeBSD && ${ARCH} != i386 && ${ARCH} != amd64
+PYPY_ARGS=	--withoutmod-_vmprof
+.else
+LIB_DEPENDS+=	libunwind.so:devel/libunwind
+.endif
+
+.if ${PORTNAME} == pypy
+SHEBANG_FILES=	lib-python/2.7/plat-mac/appletrunner.py \
 		lib-python/2.7/plat-mac/bundlebuilder.py \
 		lib-python/2.7/keyword.py \
 		lib-python/2.7/test/regrtest.py \
@@ -90,31 +119,200 @@
 		lib-python/2.7/smtplib.py \
 		lib_pypy/_cffi_ssl/tools/make_ssl_data.py
 
-python_OLD_CMD=	${LOCALBASE}/bin/python
-python_CMD=	${PREFIX}/bin/${PORTNAME}
-
-.if ${PORTNAME} != pypy
-PYPY_BUILD_DEPENDS=	pypy:lang/pypy
-PYPY_MINMEM_BUILD_DEPENDS=	pypy:lang/pypy
+.else
+.if ${PORT_OPTIONS:MFORPYIMPL37}
+SHEBANG_FILES=	\
+		lib-python/3/base64.py \
+		lib-python/3/cProfile.py \
+		lib-python/3/cgi.py \
+		lib-python/3/encodings/rot_13.py \
+		lib-python/3/keyword.py \
+		lib-python/3/idlelib/pyshell.py \
+		lib-python/3/lib2to3/pgen2/token.py \
+		lib-python/3/lib2to3/tests/data/different_encoding.py \
+		lib-python/3/lib2to3/tests/data/false_encoding.py \
+		lib-python/3/lib2to3/tests/pytree_idempotency.py \
+		lib-python/3/pdb.py \
+		lib-python/3/platform.py \
+		lib-python/3/profile.py \
+		lib-python/3/pydoc.py \
+		lib-python/3/quopri.py \
+		lib-python/3/smtpd.py \
+		lib-python/3/smtplib.py \
+		lib-python/3/symbol.py \
+		lib-python/3/tabnanny.py \
+		lib-python/3/tarfile.py \
+		lib-python/3/test/bisect_cmd.py \
+		lib-python/3/test/crashers/recursive_call.py \
+		lib-python/3/test/curses_tests.py \
+		lib-python/3/test/pystone.py \
+		lib-python/3/test/re_tests.py \
+		lib-python/3/test/regrtest.py \
+		lib-python/3/timeit.py \
+		lib-python/3/trace.py \
+		lib-python/3/turtledemo/bytedesign.py \
+		lib-python/3/turtledemo/clock.py \
+		lib-python/3/turtledemo/forest.py \
+		lib-python/3/turtledemo/fractalcurves.py \
+		lib-python/3/turtledemo/lindenmayer.py \
+		lib-python/3/turtledemo/minimal_hanoi.py \
+		lib-python/3/turtledemo/paint.py \
+		lib-python/3/turtledemo/peace.py \
+		lib-python/3/turtledemo/penrose.py \
+		lib-python/3/turtledemo/planet_and_moon.py \
+		lib-python/3/turtledemo/tree.py \
+		lib-python/3/turtledemo/yinyang.py \
+		lib-python/3/uu.py \
+		lib-python/3/webbrowser.py \
+		lib_pypy/_cffi_ssl/tools/make_ssl_data.py
+.elif ${PORT_OPTIONS:MFORPYIMPL38}
+SHEBANG_FILES=	\
+		lib-python/3/base64.py \
+		lib-python/3/cProfile.py \
+		lib-python/3/cgi.py \
+		lib-python/3/encodings/rot_13.py \
+		lib-python/3/keyword.py \
+		lib-python/3/idlelib/pyshell.py \
+		lib-python/3/lib2to3/pgen2/token.py \
+		lib-python/3/lib2to3/tests/data/different_encoding.py \
+		lib-python/3/lib2to3/tests/data/false_encoding.py \
+		lib-python/3/lib2to3/tests/pytree_idempotency.py \
+		lib-python/3/pdb.py \
+		lib-python/3/platform.py \
+		lib-python/3/profile.py \
+		lib-python/3/pydoc.py \
+		lib-python/3/quopri.py \
+		lib-python/3/smtpd.py \
+		lib-python/3/smtplib.py \
+		lib-python/3/symbol.py \
+		lib-python/3/tabnanny.py \
+		lib-python/3/tarfile.py \
+		lib-python/3/test/bisect_cmd.py \
+		lib-python/3/test/crashers/recursive_call.py \
+		lib-python/3/test/curses_tests.py \
+		lib-python/3/test/pystone.py \
+		lib-python/3/test/re_tests.py \
+		lib-python/3/test/regrtest.py \
+		lib-python/3/timeit.py \
+		lib-python/3/trace.py \
+		lib-python/3/turtledemo/bytedesign.py \
+		lib-python/3/turtledemo/clock.py \
+		lib-python/3/turtledemo/forest.py \
+		lib-python/3/turtledemo/fractalcurves.py \
+		lib-python/3/turtledemo/lindenmayer.py \
+		lib-python/3/turtledemo/minimal_hanoi.py \
+		lib-python/3/turtledemo/paint.py \
+		lib-python/3/turtledemo/peace.py \
+		lib-python/3/turtledemo/penrose.py \
+		lib-python/3/turtledemo/planet_and_moon.py \
+		lib-python/3/turtledemo/tree.py \
+		lib-python/3/turtledemo/yinyang.py \
+		lib-python/3/uu.py \
+		lib-python/3/webbrowser.py \
+		lib-python/3/test/ziptestdata/header.sh \
+		lib-python/3/test/ziptestdata/exe_with_z64 \
+		lib-python/3/test/ziptestdata/exe_with_zip \
+		lib_pypy/_cffi_ssl/tools/make_ssl_data.py
+.elif ${PORT_OPTIONS:MFORPYIMPL39}
+SHEBANG_FILES=	\
+		lib-python/3/base64.py \
+		lib-python/3/cProfile.py \
+		lib-python/3/cgi.py \
+		lib-python/3/encodings/rot_13.py \
+		lib-python/3/keyword.py \
+		lib-python/3/idlelib/pyshell.py \
+		lib-python/3/lib2to3/pgen2/token.py \
+		lib-python/3/lib2to3/tests/data/different_encoding.py \
+		lib-python/3/lib2to3/tests/data/false_encoding.py \
+		lib-python/3/lib2to3/tests/pytree_idempotency.py \
+		lib-python/3/pdb.py \
+		lib-python/3/platform.py \
+		lib-python/3/profile.py \
+		lib-python/3/pydoc.py \
+		lib-python/3/quopri.py \
+		lib-python/3/smtpd.py \
+		lib-python/3/smtplib.py \
+		lib-python/3/symbol.py \
+		lib-python/3/tabnanny.py \
+		lib-python/3/tarfile.py \
+		lib-python/3/test/bisect_cmd.py \
+		lib-python/3/test/crashers/recursive_call.py \
+		lib-python/3/test/curses_tests.py \
+		lib-python/3/test/pystone.py \
+		lib-python/3/test/re_tests.py \
+		lib-python/3/test/regrtest.py \
+		lib-python/3/timeit.py \
+		lib-python/3/trace.py \
+		lib-python/3/turtledemo/bytedesign.py \
+		lib-python/3/turtledemo/clock.py \
+		lib-python/3/turtledemo/forest.py \
+		lib-python/3/turtledemo/fractalcurves.py \
+		lib-python/3/turtledemo/lindenmayer.py \
+		lib-python/3/turtledemo/minimal_hanoi.py \
+		lib-python/3/turtledemo/paint.py \
+		lib-python/3/turtledemo/peace.py \
+		lib-python/3/turtledemo/penrose.py \
+		lib-python/3/turtledemo/planet_and_moon.py \
+		lib-python/3/turtledemo/sorting_animate.py \
+		lib-python/3/turtledemo/tree.py \
+		lib-python/3/turtledemo/yinyang.py \
+		lib-python/3/turtledemo/__main__.py \
+		lib-python/3/uu.py \
+		lib-python/3/webbrowser.py \
+		lib_pypy/_cffi_ssl/tools/make_ssl_data.py \
+		lib-python/3/test/ziptestdata/header.sh
+		lib-python/3/test/ziptestdata/exe_with_z64 \
+		lib-python/3/test/ziptestdata/exe_with_zip
+.elif ${PORT_OPTIONS:MFORPYIMPL310}
+SHEBANG_FILES=	\
+		lib-python/3/base64.py \
+		lib-python/3/cProfile.py \
+		lib-python/3/cgi.py \
+		lib-python/3/encodings/rot_13.py \
+		lib-python/3/keyword.py \
+		lib-python/3/idlelib/pyshell.py \
+		lib-python/3/lib2to3/pgen2/token.py \
+		lib-python/3/lib2to3/tests/data/different_encoding.py \
+		lib-python/3/lib2to3/tests/data/false_encoding.py \
+		lib-python/3/lib2to3/tests/pytree_idempotency.py \
+		lib-python/3/pdb.py \
+		lib-python/3/platform.py \
+		lib-python/3/profile.py \
+		lib-python/3/pydoc.py \
+		lib-python/3/quopri.py \
+		lib-python/3/smtpd.py \
+		lib-python/3/smtplib.py \
+		lib-python/3/tabnanny.py \
+		lib-python/3/tarfile.py \
+		lib-python/3/test/bisect_cmd.py \
+		lib-python/3/test/crashers/recursive_call.py \
+		lib-python/3/test/curses_tests.py \
+		lib-python/3/test/pystone.py \
+		lib-python/3/test/re_tests.py \
+		lib-python/3/test/regrtest.py \
+		lib-python/3/timeit.py \
+		lib-python/3/trace.py \
+		lib-python/3/turtledemo/bytedesign.py \
+		lib-python/3/turtledemo/clock.py \
+		lib-python/3/turtledemo/forest.py \
+		lib-python/3/turtledemo/fractalcurves.py \
+		lib-python/3/turtledemo/lindenmayer.py \
+		lib-python/3/turtledemo/minimal_hanoi.py \
+		lib-python/3/turtledemo/paint.py \
+		lib-python/3/turtledemo/peace.py \
+		lib-python/3/turtledemo/penrose.py \
+		lib-python/3/turtledemo/planet_and_moon.py \
+		lib-python/3/turtledemo/sorting_animate.py \
+		lib-python/3/turtledemo/tree.py \
+		lib-python/3/turtledemo/yinyang.py \
+		lib-python/3/turtledemo/__main__.py \
+		lib-python/3/uu.py \
+		lib-python/3/webbrowser.py \
+		lib_pypy/_cffi_ssl/tools/make_ssl_data.py \
+		lib-python/3/test/ziptestdata/header.sh \
+		lib-python/3/test/ziptestdata/exe_with_z64 \
+		lib-python/3/test/ziptestdata/exe_with_zip
 .endif
-PYPY_VARS=	PYTHON_CMD=${LOCALBASE}/bin/pypy
-PYPY_MINMEM_VARS=	PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
-PYTHON_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser@${PY_FLAVOR}
-PYTHON_USES=	python:2.7,build
-
-DESCR=		${.CURDIR}/pkg-descr
-PATCHDIR=	${.CURDIR}/files
-
-.include "bsd.pypy.mk"
-#.include <bsd.port.pre.mk>
-
-DISTINFO_FILE?=	${.CURDIR}/distinfo
-PLIST?=		${.CURDIR}/pkg-plist
-
-.if ${OPSYS} == FreeBSD && ${ARCH} != i386 && ${ARCH} != amd64
-PYPY_ARGS=	--withoutmod-_vmprof
-.else
-LIB_DEPENDS+=	libunwind.so:devel/libunwind
 .endif
 
 pre-build: