From f5dc45c3aba66f555fc804cb20cd39e882f878b7 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 12 May 2023 19:40:11 +0800 Subject: [PATCH] python3: Fix __pycache__ files included in python3-light 003-do-not-run-distutils-tests.patch was removed in 4e05541782edeb06b51d691dadf52648df24c940. This patch stopped "make install" from, among other things, running compileall. When this patch was removed, "make install" ran compileall as normal and created bytecode files in __pycache__ directories. These files were then packaged in python3-light. This adds a patch to stop compileall from being run during "make install". Fixes: 4e05541782ed ("python3: bump to version 3.10.0") Signed-off-by: Jeffery To (cherry picked from commit 8a4da017902d21ac6cada21a3bb23caa5b39af0b, adjusted PKG_RELEASE, refreshed patches) Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 2 +- .../patches/003-do-not-run-compileall.patch | 18 ++++++++++++++++++ .../patches/016-adjust-config-paths.patch | 2 +- .../025-choose-python-config-version.patch | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 lang/python/python3/patches/003-do-not-run-compileall.patch diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 3088c6147e..c8f4687fd5 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz diff --git a/lang/python/python3/patches/003-do-not-run-compileall.patch b/lang/python/python3/patches/003-do-not-run-compileall.patch new file mode 100644 index 0000000000..6be5549f39 --- /dev/null +++ b/lang/python/python3/patches/003-do-not-run-compileall.patch @@ -0,0 +1,18 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1601,6 +1601,7 @@ libinstall: build_all $(srcdir)/Modules/ + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi ++ifeq (1,) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ +@@ -1628,6 +1629,7 @@ libinstall: build_all $(srcdir)/Modules/ + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages ++endif + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ diff --git a/lang/python/python3/patches/016-adjust-config-paths.patch b/lang/python/python3/patches/016-adjust-config-paths.patch index 951e715dab..76a0101912 100644 --- a/lang/python/python3/patches/016-adjust-config-paths.patch +++ b/lang/python/python3/patches/016-adjust-config-paths.patch @@ -19,7 +19,7 @@ $(DESTDIR)$(LIBDEST); \ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ -@@ -1752,7 +1752,7 @@ sharedinstall: sharedmods +@@ -1754,7 +1754,7 @@ sharedinstall: sharedmods --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ --root=$(DESTDIR)/ diff --git a/lang/python/python3/patches/025-choose-python-config-version.patch b/lang/python/python3/patches/025-choose-python-config-version.patch index 7b9ee1e6b3..d3596a24db 100644 --- a/lang/python/python3/patches/025-choose-python-config-version.patch +++ b/lang/python/python3/patches/025-choose-python-config-version.patch @@ -1,6 +1,6 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1644,7 +1644,7 @@ python-config: $(srcdir)/Misc/python-con +@@ -1646,7 +1646,7 @@ python-config: $(srcdir)/Misc/python-con @ # On Darwin, always use the python version of the script, the shell @ # version doesn't use the compiler customizations that are provided @ # in python (_osx_support.py).