|
@@ -1,4 +1,4 @@
|
|
|
-From d53e271be8952fd95a593741f91bf0ef2a7e5f02 Mon Sep 17 00:00:00 2001
|
|
|
+From 0e4f0a525ea0a68f6d4c5349c301da2e9b0c8ac9 Mon Sep 17 00:00:00 2001
|
|
|
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
Date: Wed, 22 Feb 2017 17:15:31 -0800
|
|
|
Subject: [PATCH] Add an option to disable lib2to3
|
|
@@ -14,18 +14,17 @@ Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
|
|
|
Signed-off-by: Adam Duskett <aduskett@gmail.com>
|
|
|
[ Bernd Kuhls: ported to Python 3.11.4]
|
|
|
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
-[ Adam Duskett: ported to Python 3.12.1 ]
|
|
|
-Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
|
|
|
---
|
|
|
- Makefile.pre.in | 19 ++++++++++++++-----
|
|
|
+ Makefile.pre.in | 17 ++++++++++++-----
|
|
|
configure.ac | 6 ++++++
|
|
|
- 2 files changed, 20 insertions(+), 5 deletions(-)
|
|
|
+ setup.py | 6 +++---
|
|
|
+ 3 files changed, 21 insertions(+), 8 deletions(-)
|
|
|
|
|
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
|
|
-index ecf1b995c01..a5feddcbbc3 100644
|
|
|
+index 403380e181..f5d0573067 100644
|
|
|
--- a/Makefile.pre.in
|
|
|
+++ b/Makefile.pre.in
|
|
|
-@@ -2052,7 +2052,9 @@ ifeq (@PYDOC@,yes)
|
|
|
+@@ -1868,7 +1868,9 @@ ifeq (@PYDOC@,yes)
|
|
|
(cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
|
|
|
endif
|
|
|
-rm -f $(DESTDIR)$(BINDIR)/2to3
|
|
@@ -35,7 +34,7 @@ index ecf1b995c01..a5feddcbbc3 100644
|
|
|
if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
|
|
|
rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
|
|
|
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
|
|
|
-@@ -2099,7 +2101,6 @@ LIBSUBDIRS= asyncio \
|
|
|
+@@ -1914,7 +1916,6 @@ LIBSUBDIRS= asyncio \
|
|
|
idlelib idlelib/Icons \
|
|
|
importlib importlib/resources importlib/metadata \
|
|
|
json \
|
|
@@ -43,34 +42,34 @@ index ecf1b995c01..a5feddcbbc3 100644
|
|
|
logging \
|
|
|
multiprocessing multiprocessing/dummy \
|
|
|
re \
|
|
|
-@@ -2203,10 +2204,6 @@ TESTSUBDIRS= idlelib/idle_test \
|
|
|
- test/test_importlib/resources/zipdata02 \
|
|
|
- test/test_importlib/source \
|
|
|
- test/test_json \
|
|
|
-- test/test_lib2to3 \
|
|
|
-- test/test_lib2to3/data \
|
|
|
-- test/test_lib2to3/data/fixers \
|
|
|
-- test/test_lib2to3/data/fixers/myfixes \
|
|
|
- test/test_module \
|
|
|
- test/test_peg_generator \
|
|
|
- test/test_sqlite3 \
|
|
|
-@@ -2253,6 +2250,14 @@ ifeq (@PYDOC@,yes)
|
|
|
+@@ -1934,10 +1935,6 @@ LIBSUBDIRS= asyncio \
|
|
|
+ TESTSUBDIRS= ctypes/test \
|
|
|
+ distutils/tests \
|
|
|
+ idlelib/idle_test \
|
|
|
+- lib2to3/tests \
|
|
|
+- lib2to3/tests/data \
|
|
|
+- lib2to3/tests/data/fixers \
|
|
|
+- lib2to3/tests/data/fixers/myfixes \
|
|
|
+ test \
|
|
|
+ test/audiodata \
|
|
|
+ test/capath \
|
|
|
+@@ -2013,6 +2010,14 @@ ifeq (@PYDOC@,yes)
|
|
|
LIBSUBDIRS += pydoc_data
|
|
|
endif
|
|
|
|
|
|
+ifeq (@LIB2TO3@,yes)
|
|
|
+LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
|
|
|
-+TESTSUBDIRS += test/test_lib2to3 \
|
|
|
-+ test/test_lib2to3/data \
|
|
|
-+ test/test_lib2to3/data/fixers \
|
|
|
-+ test/test_lib2to3/data/fixers/myfixes
|
|
|
++TESTSUBDIRS += lib2to3/tests \
|
|
|
++ lib2to3/tests/data \
|
|
|
++ lib2to3/tests/data/fixers \
|
|
|
++ lib2to3/tests/data/fixers/myfixes
|
|
|
+endif
|
|
|
+
|
|
|
TEST_MODULES=@TEST_MODULES@
|
|
|
-
|
|
|
- .PHONY: libinstall
|
|
|
-@@ -2336,10 +2341,12 @@ ifeq (@PYC_BUILD@,yes)
|
|
|
- -o 0 -o 1 -o 2 $(COMPILEALL_OPTS) -d $(LIBDEST)/site-packages -f \
|
|
|
+ libinstall: all $(srcdir)/Modules/xxmodule.c
|
|
|
+ @for i in $(SCRIPTDIR) $(LIBDEST); \
|
|
|
+@@ -2115,10 +2120,12 @@ ifeq (@PYC_BUILD@,yes)
|
|
|
+ -j0 -d $(LIBDEST)/site-packages -f \
|
|
|
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
|
|
endif
|
|
|
+ifeq (@LIB2TO3@,yes)
|
|
@@ -82,21 +81,11 @@ index ecf1b995c01..a5feddcbbc3 100644
|
|
|
|
|
|
# bpo-21536: Misc/python-config.sh is generated in the build directory
|
|
|
# from $(srcdir)Misc/python-config.sh.in.
|
|
|
-@@ -2465,7 +2472,9 @@ libainstall: all scripts
|
|
|
- $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
|
|
- $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
|
|
|
- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
|
|
|
-+ifeq (@LIB2TO3@,yes)
|
|
|
- $(INSTALL_SCRIPT) $(SCRIPT_2TO3) $(DESTDIR)$(BINDIR)/2to3-$(VERSION)
|
|
|
-+endif
|
|
|
- $(INSTALL_SCRIPT) $(SCRIPT_IDLE) $(DESTDIR)$(BINDIR)/idle$(VERSION)
|
|
|
- ifeq (@PYDOC@,yes)
|
|
|
- $(INSTALL_SCRIPT) $(SCRIPT_PYDOC) $(DESTDIR)$(BINDIR)/pydoc$(VERSION)
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
|
-index 277a16a903e..654f903ef12 100644
|
|
|
+index f68ea72321..d8e10cf2b2 100644
|
|
|
--- a/configure.ac
|
|
|
+++ b/configure.ac
|
|
|
-@@ -7535,6 +7535,12 @@ PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$ac_cv_fu
|
|
|
+@@ -7078,6 +7078,12 @@ PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$ac_cv_fu
|
|
|
# substitute multiline block, must come after last PY_STDLIB_MOD()
|
|
|
AC_SUBST([MODULE_BLOCK])
|
|
|
|
|
@@ -107,8 +96,27 @@ index 277a16a903e..654f903ef12 100644
|
|
|
+ [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
|
|
|
+
|
|
|
# generate output files
|
|
|
- AC_CONFIG_FILES(m4_normalize([
|
|
|
- Makefile.pre
|
|
|
+ AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
|
|
|
+ AC_CONFIG_FILES([Modules/Setup.bootstrap Modules/Setup.stdlib])
|
|
|
+diff --git a/setup.py b/setup.py
|
|
|
+index 3e55f5b2e0..c490b0b08f 100644
|
|
|
+--- a/setup.py
|
|
|
++++ b/setup.py
|
|
|
+@@ -1594,11 +1594,11 @@ class DummyProcess:
|
|
|
+ import warnings
|
|
|
+ warnings.filterwarnings("ignore",category=DeprecationWarning)
|
|
|
+
|
|
|
+- scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3',
|
|
|
+- 'Lib/smtpd.py']
|
|
|
++ scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
|
|
|
+ if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
|
|
|
+ scripts += [ 'Tools/scripts/pydoc3' ]
|
|
|
+-
|
|
|
++ if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
|
|
|
++ scripts += [ 'Tools/scripts/2to3' ]
|
|
|
+ setup(# PyPI Metadata (PEP 301)
|
|
|
+ name = "Python",
|
|
|
+ version = sys.version.split()[0],
|
|
|
--
|
|
|
-2.43.0
|
|
|
+2.34.1
|
|
|
|