python3: Fix __pycache__ files included in python3-light
authorJeffery To <jeffery.to@gmail.com>
Fri, 12 May 2023 11:40:11 +0000 (19:40 +0800)
committerRosen Penev <rosenp@gmail.com>
Wed, 24 May 2023 03:04:33 +0000 (06:04 +0300)
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 <jeffery.to@gmail.com>
lang/python/python3/Makefile
lang/python/python3/patches/003-do-not-run-compileall.patch [new file with mode: 0644]
lang/python/python3/patches/016-adjust-config-paths.patch
lang/python/python3/patches/025-choose-python-config-version.patch

index 328a5c920b29e8630e72953b46156aa5ee7ab7f4..28d80b00dedb89151719af571a848fc04117150c 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 include ../python3-version.mk
 
 PKG_NAME:=python3
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 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 (file)
index 0000000..212b772
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1600,6 +1600,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 \
+@@ -1627,6 +1628,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) \
index 641661f5cb1bd5ae74f3fee87cbba8828dc29966..6c7e677001b5fdec905f9414cc3791c4fa081205 100644 (file)
@@ -19,7 +19,7 @@
                $(DESTDIR)$(LIBDEST); \
        $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
        if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
-@@ -1751,7 +1751,7 @@ sharedinstall: sharedmods
+@@ -1753,7 +1753,7 @@ sharedinstall: sharedmods
                --install-scripts=$(BINDIR) \
                --install-platlib=$(DESTSHARED) \
                --root=$(DESTDIR)/
index b5a278d8e86315ce649d00cf4a6f7c6f3c106c8a..15cfebd241b9149bb468cff083b5194bf8e292e4 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -1643,7 +1643,7 @@ python-config: $(srcdir)/Misc/python-con
+@@ -1645,7 +1645,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).