|
@@ -1,4 +1,4 @@
|
|
|
-From bc0681be87109e3e5c35e0bdd225143607350fb6 Mon Sep 17 00:00:00 2001
|
|
|
+From f034b1b0f33a7bd4dde23f0bc1fa8e00e3518c9d 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
|
|
@@ -10,17 +10,19 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
|
|
[ Andrey Smirnov: ported to Python 3.6 ]
|
|
|
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
|
|
|
+[ Adam Duskett: ported to Python 3.10.0 ]
|
|
|
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
|
|
|
---
|
|
|
- Makefile.pre.in | 16 ++++++++++++----
|
|
|
- configure.ac | 6 ++++++
|
|
|
- setup.py | 5 +++--
|
|
|
- 3 files changed, 21 insertions(+), 6 deletions(-)
|
|
|
+ Makefile.pre.in | 17 ++++++++++++-----
|
|
|
+ configure.ac | 5 +++++
|
|
|
+ setup.py | 6 +++---
|
|
|
+ 3 files changed, 20 insertions(+), 8 deletions(-)
|
|
|
|
|
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
|
|
-index dd83413f17..6324970733 100644
|
|
|
+index 28cf88e..63fa9fb 100644
|
|
|
--- a/Makefile.pre.in
|
|
|
+++ b/Makefile.pre.in
|
|
|
-@@ -1377,7 +1377,9 @@ ifeq (@PYDOC@,yes)
|
|
|
+@@ -1395,7 +1395,9 @@ ifeq (@PYDOC@,yes)
|
|
|
(cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
|
|
|
endif
|
|
|
-rm -f $(DESTDIR)$(BINDIR)/2to3
|
|
@@ -30,27 +32,28 @@ index dd83413f17..6324970733 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)) \
|
|
|
-@@ -1416,7 +1418,6 @@ LIBSUBDIRS= tkinter site-packages \
|
|
|
- html json http dbm xmlrpc \
|
|
|
- sqlite3 \
|
|
|
- logging csv wsgiref urllib \
|
|
|
-- lib2to3 lib2to3/fixes lib2to3/pgen2 \
|
|
|
- ctypes ctypes/macholib \
|
|
|
+@@ -1441,7 +1443,6 @@ LIBSUBDIRS= asyncio \
|
|
|
idlelib idlelib/Icons \
|
|
|
- distutils distutils/command $(XMLLIBSUBDIRS) \
|
|
|
-@@ -1494,9 +1495,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
|
|
|
- test/test_email test/test_email/data \
|
|
|
- test/test_json \
|
|
|
- sqlite3/test \
|
|
|
+ importlib importlib/metadata \
|
|
|
+ json \
|
|
|
+- lib2to3 lib2to3/fixes lib2to3/pgen2 \
|
|
|
+ logging \
|
|
|
+ multiprocessing multiprocessing/dummy \
|
|
|
+ site-packages \
|
|
|
+@@ -1458,10 +1459,6 @@ LIBSUBDIRS= asyncio \
|
|
|
+ TESTSUBDIRS= ctypes/test \
|
|
|
+ distutils/tests \
|
|
|
+ idlelib/idle_test \
|
|
|
- lib2to3/tests \
|
|
|
-- lib2to3/tests/data lib2to3/tests/data/fixers \
|
|
|
+- lib2to3/tests/data \
|
|
|
+- lib2to3/tests/data/fixers \
|
|
|
- lib2to3/tests/data/fixers/myfixes \
|
|
|
- ctypes/test \
|
|
|
- idlelib/idle_test \
|
|
|
- distutils/tests \
|
|
|
-@@ -1505,6 +1503,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
|
|
|
- test/test_tools test/test_warnings test/test_warnings/data \
|
|
|
- unittest/test unittest/test/testmock
|
|
|
+ sqlite3/test \
|
|
|
+ test test/audiodata \
|
|
|
+ test/capath test/cjkencodings \
|
|
|
+@@ -1535,6 +1532,14 @@ ifeq (@PYDOC@,yes)
|
|
|
+ LIBSUBDIRS += pydoc_data
|
|
|
+ endif
|
|
|
|
|
|
+ifeq (@LIB2TO3@,yes)
|
|
|
+LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
|
|
@@ -60,10 +63,10 @@ index dd83413f17..6324970733 100644
|
|
|
+ lib2to3/tests/data/fixers/myfixes
|
|
|
+endif
|
|
|
+
|
|
|
- ifeq (@TEST_MODULES@,yes)
|
|
|
- LIBSUBDIRS += $(TESTSUBDIRS)
|
|
|
- endif
|
|
|
-@@ -1605,10 +1611,12 @@ ifeq (@PYC_BUILD@,yes)
|
|
|
+ TEST_MODULES=@TEST_MODULES@
|
|
|
+ libinstall: build_all $(srcdir)/Modules/xxmodule.c
|
|
|
+ @for i in $(SCRIPTDIR) $(LIBDEST); \
|
|
|
+@@ -1637,10 +1642,12 @@ ifeq (@PYC_BUILD@,yes)
|
|
|
-j0 -d $(LIBDEST)/site-packages -f \
|
|
|
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
|
|
endif
|
|
@@ -77,27 +80,26 @@ index dd83413f17..6324970733 100644
|
|
|
# bpo-21536: Misc/python-config.sh is generated in the build directory
|
|
|
# from $(srcdir)Misc/python-config.sh.in.
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
|
-index b748ad7957..58e9a8fe7a 100644
|
|
|
+index 9079531..34c2ba9 100644
|
|
|
--- a/configure.ac
|
|
|
+++ b/configure.ac
|
|
|
-@@ -3377,6 +3377,12 @@ AC_ARG_ENABLE(test-modules,
|
|
|
- AS_HELP_STRING([--disable-test-modules], [disable test modules]),
|
|
|
- [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
|
|
|
+@@ -6014,6 +6014,11 @@ else
|
|
|
+ fi
|
|
|
+ AC_SUBST(TEST_MODULES)
|
|
|
|
|
|
+AC_SUBST(LIB2TO3)
|
|
|
+
|
|
|
+AC_ARG_ENABLE(lib2to3,
|
|
|
+ AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
|
|
|
+ [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
|
|
|
-+
|
|
|
- # Check for enable-ipv6
|
|
|
- AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
|
|
|
- AC_MSG_CHECKING([if --enable-ipv6 is specified])
|
|
|
+
|
|
|
+ # generate output files
|
|
|
+ AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
|
|
|
diff --git a/setup.py b/setup.py
|
|
|
-index dcbc109c30..8d6348f560 100644
|
|
|
+index d23f148..663fd44 100644
|
|
|
--- a/setup.py
|
|
|
+++ b/setup.py
|
|
|
-@@ -2573,10 +2573,11 @@ def main():
|
|
|
+@@ -2722,11 +2722,11 @@ def main():
|
|
|
import warnings
|
|
|
warnings.filterwarnings("ignore",category=DeprecationWarning)
|
|
|
|
|
@@ -106,11 +108,12 @@ index dcbc109c30..8d6348f560 100644
|
|
|
+ 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.20.1
|
|
|
+2.30.2
|
|
|
|