diff --git a/packages/lang/Python3/package.mk b/packages/lang/Python3/package.mk index d23fd6e9b4..ceb4c1949b 100644 --- a/packages/lang/Python3/package.mk +++ b/packages/lang/Python3/package.mk @@ -2,14 +2,14 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="Python3" -PKG_VERSION="3.6.3" -PKG_SHA256="cda7d967c9a4bfa52337cdf551bcc5cff026b6ac50a8834e568ce4a794ca81da" +PKG_VERSION="3.7.0" +PKG_SHA256="0382996d1ee6aafe59763426cf0139ffebe36984474d0ec4126dd1c40a8b3549" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://www.python.org/" PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/${PKG_NAME::-1}-$PKG_VERSION.tar.xz" PKG_SOURCE_DIR="${PKG_NAME::-1}-$PKG_VERSION*" -PKG_DEPENDS_HOST="zlib:host bzip2:host" +PKG_DEPENDS_HOST="zlib:host bzip2:host libffi:host" PKG_DEPENDS_TARGET="toolchain sqlite expat zlib bzip2 openssl Python3:host readline ncurses" PKG_SECTION="lang" PKG_SHORTDESC="python3: The Python3 programming language" diff --git a/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch b/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch index 681dddb2db..d39eea7b09 100644 --- a/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch +++ b/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch @@ -1,13 +1,25 @@ +From 722c059f586ffd26bb3c447c56cb4d2601d9f94c Mon Sep 17 00:00:00 2001 +From: MilhouseVH +Date: Sat, 8 Sep 2018 06:24:14 +0100 +Subject: [PATCH] Default is optimized + +--- + Python/pylifecycle.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index 640271f..cad052e 100644 +index fdb759f..432119e 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c -@@ -82,7 +82,7 @@ int Py_VerboseFlag; /* Needed by import.c */ - int Py_QuietFlag; /* Needed by sysmodule.c */ - int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ - int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */ +@@ -115,7 +115,7 @@ int Py_VerboseFlag = 0; /* Needed by import.c */ + int Py_QuietFlag = 0; /* Needed by sysmodule.c */ + int Py_InteractiveFlag = 0; /* Needed by Py_FdIsInteractive() below */ + int Py_InspectFlag = 0; /* Needed to determine whether to exit at SystemExit */ -int Py_OptimizeFlag = 0; /* Needed by compile.c */ +int Py_OptimizeFlag = 2; /* Needed by compile.c */ - int Py_NoSiteFlag; /* Suppress 'import site' */ - int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */ - int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */ + int Py_NoSiteFlag = 0; /* Suppress 'import site' */ + int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */ + int Py_FrozenFlag = 0; /* Needed by getpath.c */ +-- +2.7.4 + diff --git a/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch b/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch index e7d5a900d1..9d678cbe08 100644 --- a/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch +++ b/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch @@ -1,7 +1,7 @@ -From 53400bbcc7078d0589cd6831adc2c8b2752c6e84 Mon Sep 17 00:00:00 2001 +From 1df58e4e6932c4c887fdd2f6a92509ae91e3d86f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 16:21:31 -0800 -Subject: [PATCH 01/29] Make the build of pyc files conditional +Subject: [PATCH 01/32] Make the build of pyc files conditional This commit adds a new configure option --disable-pyc-build to disable the compilation of pyc. @@ -15,10 +15,10 @@ Signed-off-by: Andrey Smirnov 2 files changed, 8 insertions(+) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 82e8307..b38bd79 100644 +index 4c23c0e..ca52776 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1311,6 +1311,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c +@@ -1385,6 +1385,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ $(DESTDIR)$(LIBDEST)/distutils/tests ; \ fi @@ -26,7 +26,7 @@ index 82e8307..b38bd79 100644 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -@@ -1338,6 +1339,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c +@@ -1412,6 +1413,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages @@ -35,10 +35,10 @@ index 82e8307..b38bd79 100644 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ diff --git a/configure.ac b/configure.ac -index 9620067..a76b544 100644 +index b5beb08..027901d 100644 --- a/configure.ac +++ b/configure.ac -@@ -1113,6 +1113,12 @@ fi +@@ -1107,6 +1107,12 @@ fi AC_MSG_CHECKING(LDLIBRARY) @@ -52,13 +52,13 @@ index 9620067..a76b544 100644 # library that we build, but we do not want to link against it (we # will find it with a -framework option). For this reason there is an -- -2.11.0 +2.7.4 -From e571fe09b611227a15d3c15ef1f175e5b7aaacc9 Mon Sep 17 00:00:00 2001 +From 4bf9295c7c03ecdcfeb40cf9cabeefb414fa3b2f Mon Sep 17 00:00:00 2001 From: Vanya Sergeev Date: Wed, 23 Dec 2015 11:30:33 +0100 -Subject: [PATCH 02/29] Disable buggy_getaddrinfo configure test when +Subject: [PATCH 02/32] Disable buggy_getaddrinfo configure test when cross-compiling with IPv6 support Signed-off-by: Vanya Sergeev @@ -67,10 +67,10 @@ Signed-off-by: Vanya Sergeev 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index a76b544..5f87c4d 100644 +index 027901d..3aa3e33 100644 --- a/configure.ac +++ b/configure.ac -@@ -3939,7 +3939,7 @@ fi +@@ -3985,7 +3985,7 @@ fi AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) @@ -80,13 +80,13 @@ index a76b544..5f87c4d 100644 if test $ipv6 = yes then -- -2.11.0 +2.7.4 -From c00a2f3c52f71c11c5b383d91ea8624cf1003851 Mon Sep 17 00:00:00 2001 +From 3c1728bb10f2d8e5dbe42d35bd7b1ec354e31d89 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 16:33:22 -0800 -Subject: [PATCH 03/29] Add infrastructure to disable the build of certain +Subject: [PATCH 03/32] Add infrastructure to disable the build of certain extensions Some of the extensions part of the Python core have dependencies on @@ -130,10 +130,10 @@ Signed-off-by: Andrey Smirnov 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index b38bd79..4ce917a 100644 +index ca52776..5d64ab7 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -190,6 +190,8 @@ FILEMODE= 644 +@@ -196,6 +196,8 @@ FILEMODE= 644 # configure script arguments CONFIG_ARGS= @CONFIG_ARGS@ @@ -142,15 +142,15 @@ index b38bd79..4ce917a 100644 # Subdirectories with code SRCDIRS= @SRCDIRS@ -@@ -575,6 +577,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -609,6 +611,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o esac; \ - $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - - -@@ -1436,7 +1439,8 @@ libainstall: @DEF_MAKE_RULE@ python-config + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ +@@ -1508,7 +1511,8 @@ libainstall: @DEF_MAKE_RULE@ python-config # Install the dynamically loadable modules # This goes into $(exec_prefix) sharedinstall: sharedmods @@ -161,10 +161,10 @@ index b38bd79..4ce917a 100644 --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ diff --git a/configure.ac b/configure.ac -index 5f87c4d..d5ee2ae 100644 +index 3aa3e33..d68d410 100644 --- a/configure.ac +++ b/configure.ac -@@ -2810,6 +2810,8 @@ LIBS="$withval $LIBS" +@@ -2902,6 +2902,8 @@ LIBS="$withval $LIBS" PKG_PROG_PKG_CONFIG @@ -174,7 +174,7 @@ index 5f87c4d..d5ee2ae 100644 AC_MSG_CHECKING(for --with-system-expat) AC_ARG_WITH(system_expat, diff --git a/setup.py b/setup.py -index fe47797..86643ae 100644 +index a97a755..e62b499 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,11 @@ host_platform = get_platform() @@ -191,13 +191,13 @@ index fe47797..86643ae 100644 def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (after any relative -- -2.11.0 +2.7.4 -From 2fcb53edf6f4545f56c513d26f88ffdd8904b35a Mon Sep 17 00:00:00 2001 +From 4ba45fbf70789f51f5bb83a513a7633c065ee6f3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:33:14 +0100 -Subject: [PATCH 04/29] Adjust library/header paths for cross-compilation +Subject: [PATCH 04/32] Adjust library/header paths for cross-compilation When cross-compiling third-party extensions, the get_python_inc() or get_python_lib() can be called, to return the path to headers or @@ -217,7 +217,7 @@ Signed-off-by: Thomas Petazzoni 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py -index 74de782..d0c847b 100644 +index 8fad9cd..bfe5122 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -233,7 +233,10 @@ class build_ext(Command): @@ -233,7 +233,7 @@ index 74de782..d0c847b 100644 # building python standard extensions self.library_dirs.append('.') diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 2bcd1dd..422c13f 100644 +index e07a6c8..a9d78a5 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -17,10 +17,17 @@ import sys @@ -257,15 +257,15 @@ index 2bcd1dd..422c13f 100644 + BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) # Path to the base directory of the project. On Windows the binary may - # live in project/PCBuild/win32 or project/PCBuild/amd64. + # live in project/PCbuild/win32 or project/PCbuild/amd64. -- -2.11.0 +2.7.4 -From 7d03fb519099ce471f28163dfb1309fbd8db66dd Mon Sep 17 00:00:00 2001 +From 5737dfd186e53233c63c36aa2f359fa15081d3bc Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:36:00 +0100 -Subject: [PATCH 05/29] Don't look in /usr/lib/termcap for libraries +Subject: [PATCH 05/32] Don't look in /usr/lib/termcap for libraries Signed-off-by: Thomas Petazzoni --- @@ -273,10 +273,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py -index 86643ae..cd00fbd 100644 +index e62b499..c065092 100644 --- a/setup.py +++ b/setup.py -@@ -786,12 +786,9 @@ class PyBuildExt(build_ext): +@@ -850,12 +850,9 @@ class PyBuildExt(build_ext): pass # Issue 7384: Already linked against curses or tinfo. elif curses_library: readline_libs.append(curses_library) @@ -291,13 +291,13 @@ index 86643ae..cd00fbd 100644 libraries=readline_libs) ) else: -- -2.11.0 +2.7.4 -From 84e958a0164cd4c713a5d21c60f8d4c7fa5c4bbb Mon Sep 17 00:00:00 2001 +From 1dd3495fcbec3ad495fc0a05cd2f0cb6a68c4bba Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:36:27 +0100 -Subject: [PATCH 06/29] Don't add multiarch paths +Subject: [PATCH 06/32] Don't add multiarch paths The add_multiarch_paths() function leads, in certain build environments, to the addition of host header paths to the CFLAGS, @@ -313,10 +313,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py -index cd00fbd..c956fa0 100644 +index c065092..c44a683 100644 --- a/setup.py +++ b/setup.py -@@ -497,10 +497,10 @@ class PyBuildExt(build_ext): +@@ -547,10 +547,10 @@ class PyBuildExt(build_ext): if not cross_compiling: add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') @@ -329,13 +329,13 @@ index cd00fbd..c956fa0 100644 # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. -- -2.11.0 +2.7.4 -From 9761791ba9714639e1cee2d466beac5f199aa237 Mon Sep 17 00:00:00 2001 +From af7fdaf9d5ac109f052a5ac687e5ebf3254a0ae6 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:43:24 +0100 -Subject: [PATCH 07/29] Abort on failed module build +Subject: [PATCH 07/32] Abort on failed module build When building a Python module fails, the setup.py script currently doesn't exit with an error, and simply continues. This is not a really @@ -348,10 +348,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py -index c956fa0..b3add2b 100644 +index c44a683..a6eb2be 100644 --- a/setup.py +++ b/setup.py -@@ -312,6 +312,7 @@ class PyBuildExt(build_ext): +@@ -358,6 +358,7 @@ class PyBuildExt(build_ext): print("Failed to build these modules:") print_three_column(failed) print() @@ -360,13 +360,13 @@ index c956fa0..b3add2b 100644 if self.failed_on_import: failed = self.failed_on_import[:] -- -2.11.0 +2.7.4 -From a6094130b3476c499e2b063a857913cfc7292d2a Mon Sep 17 00:00:00 2001 +From bb03d2ab3820d0ba0f6788c58c7d02b7ec5a6f2e Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Wed, 23 Dec 2015 11:44:02 +0100 -Subject: [PATCH 08/29] Serial ioctl() workaround +Subject: [PATCH 08/32] Serial ioctl() workaround The ioctls.h of some architectures (notably xtensa) references structs from linux/serial.h. Make sure to include this header as well. @@ -380,10 +380,10 @@ Signed-off-by: Baruch Siach 1 file changed, 2 insertions(+) diff --git a/Modules/termios.c b/Modules/termios.c -index b78d33e..58b0444 100644 +index b4aa77f..760a4a8 100644 --- a/Modules/termios.c +++ b/Modules/termios.c -@@ -9,7 +9,9 @@ +@@ -15,7 +15,9 @@ #endif #include @@ -394,13 +394,13 @@ index b78d33e..58b0444 100644 /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR, * MDTR, MRI, and MRTS (appearantly used internally by some things -- -2.11.0 +2.7.4 -From 5260336b011dafc6aec799c47b7267ce9e72960f Mon Sep 17 00:00:00 2001 +From fc9e8c17bd551d71a8e8250fd8d03717328f7ef0 Mon Sep 17 00:00:00 2001 From: Christophe Vu-Brugier Date: Wed, 23 Dec 2015 11:44:30 +0100 -Subject: [PATCH 09/29] Do not adjust the shebang of Python scripts for +Subject: [PATCH 09/32] Do not adjust the shebang of Python scripts for cross-compilation The copy_scripts() method in distutils copies the scripts listed in @@ -430,13 +430,13 @@ index ccc70e6..d6d5419 100644 self.build_dir) updated_files.append(outfile) -- -2.11.0 +2.7.4 -From a7166d6e3eed0062b096c0a34e06c96a735d789c Mon Sep 17 00:00:00 2001 +From f02eded6c8aa395e287c17d1514bbef76be22c07 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 20 Nov 2014 13:24:59 +0100 -Subject: [PATCH 10/29] Misc/python-config.sh.in: ensure sed invocations only +Subject: [PATCH 10/32] Misc/python-config.sh.in: ensure sed invocations only match beginning of strings The build/real prefix handling using sed breaks if build != real and the @@ -456,48 +456,55 @@ Submitted upstream: http://bugs.python.org/issue22907 Signed-off-by: Peter Korsgaard --- - Misc/python-config.sh.in | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) + Misc/python-config.sh.in | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in -index 30c6927..f905a71 100644 +index d1d3275..9e259c0 100644 --- a/Misc/python-config.sh.in +++ b/Misc/python-config.sh.in -@@ -29,12 +29,12 @@ prefix_real=$(installed_prefix "$0") +@@ -24,18 +24,19 @@ installed_prefix () + echo $RESULT + } + ++prefix_build="@prefix@" + prefix_real=$(installed_prefix "$0") # Use sed to fix paths from their built-to locations to their installed-to - # locations. --prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#") + # locations. Keep prefix & exec_prefix using their original values in case + # they are referenced in other configure variables, to prevent double + # substitution, issue #22140. +-prefix="@prefix@" +-exec_prefix="@exec_prefix@" +prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") - exec_prefix_build="@exec_prefix@" --exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#") --includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#") --libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#") --CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#") +exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") + exec_prefix_real=${prefix_real} +-includedir=$(echo "@includedir@" | sed "s#$prefix#$prefix_real#") +-libdir=$(echo "@libdir@" | sed "s#$prefix#$prefix_real#") +-CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix#$prefix_real#") +includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") +libdir=$(echo "@libdir@" | sed "s#^$prefix_build#$prefix_real#") +CFLAGS=$(echo "@CFLAGS@" | sed "s#^$prefix_build#$prefix_real#") VERSION="@VERSION@" LIBM="@LIBM@" LIBC="@LIBC@" -@@ -48,7 +48,7 @@ OPT="@OPT@" +@@ -49,7 +50,7 @@ OPT="@OPT@" PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" LDVERSION="@LDVERSION@" - LIBDEST=${prefix}/lib/python${VERSION} --LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#") + LIBDEST=${prefix_real}/lib/python${VERSION} +-LIBPL=$(echo "@LIBPL@" | sed "s#$prefix#$prefix_real#") +LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") SO="@EXT_SUFFIX@" PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" -- -2.11.0 +2.7.4 -From 2d68f738170735e5fb01684f532850da536e1abb Mon Sep 17 00:00:00 2001 +From d60ebafd835463f75ea05ef1dc2be46d10f9f9fb Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Wed, 23 Dec 2015 11:45:48 +0100 -Subject: [PATCH 11/29] Override system locale and set to default when adding +Subject: [PATCH 11/32] Override system locale and set to default when adding gcc paths Forces the use of the default locale in the function @@ -516,10 +523,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py -index b3add2b..29bfd17 100644 +index a6eb2be..184999e 100644 --- a/setup.py +++ b/setup.py -@@ -457,7 +457,7 @@ class PyBuildExt(build_ext): +@@ -514,7 +514,7 @@ class PyBuildExt(build_ext): tmpfile = os.path.join(self.build_temp, 'gccpaths') if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) @@ -529,13 +536,13 @@ index b3add2b..29bfd17 100644 in_incdirs = False inc_dirs = [] -- -2.11.0 +2.7.4 -From 755576f79f5ac13c36e4aedbd695745d0a104df7 Mon Sep 17 00:00:00 2001 +From bc0f12d5f610852f9dd59f7c77e275c9c5d6b50a Mon Sep 17 00:00:00 2001 From: Christophe Vu-Brugier Date: Wed, 22 Feb 2017 16:48:49 -0800 -Subject: [PATCH 12/29] Add importlib fix for PEP 3147 issue +Subject: [PATCH 12/32] Add importlib fix for PEP 3147 issue Python 3 has a new standard for installing .pyc file, called PEP 3147. Unfortunately, this standard requires both the .py and .pyc @@ -559,10 +566,10 @@ Signed-off-by: Andrey Smirnov 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py -index 9feec50..3550013 100644 +index 53b24ff..8b28bad 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py -@@ -275,8 +275,6 @@ def cache_from_source(path, debug_override=None, *, optimization=None): +@@ -283,8 +283,6 @@ def cache_from_source(path, debug_override=None, *, optimization=None): a True value is the same as setting 'optimization' to the empty string while a False value is equivalent to setting 'optimization' to '1'. @@ -571,7 +578,7 @@ index 9feec50..3550013 100644 """ if debug_override is not None: _warnings.warn('the debug_override parameter is deprecated; use ' -@@ -288,10 +286,7 @@ def cache_from_source(path, debug_override=None, *, optimization=None): +@@ -296,10 +294,7 @@ def cache_from_source(path, debug_override=None, *, optimization=None): path = _os.fspath(path) head, tail = _path_split(path) base, sep, rest = tail.rpartition('.') @@ -583,7 +590,7 @@ index 9feec50..3550013 100644 if optimization is None: if sys.flags.optimize == 0: optimization = '' -@@ -302,40 +297,17 @@ def cache_from_source(path, debug_override=None, *, optimization=None): +@@ -310,40 +305,17 @@ def cache_from_source(path, debug_override=None, *, optimization=None): if not optimization.isalnum(): raise ValueError('{!r} is not alphanumeric'.format(optimization)) almost_filename = '{}.{}{}'.format(almost_filename, _OPT, optimization) @@ -629,13 +636,13 @@ index 9feec50..3550013 100644 -- -2.11.0 +2.7.4 -From fc5d897b1fcc0dd313c6c1519150365826960e55 Mon Sep 17 00:00:00 2001 +From 84d23f2038c36b100d168586609abba7d1de03e3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:01:18 -0800 -Subject: [PATCH 13/29] Add an option to disable installation of test modules +Subject: [PATCH 13/32] Add an option to disable installation of test modules The Python standard distribution comes with many test modules, that are not necessarly useful on embedded targets. @@ -645,15 +652,15 @@ Signed-off-by: Samuel Martin [ Andrey Smirnov: ported to Python 3.6 ] Signed-off-by: Andrey Smirnov --- - Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++------------------- + Makefile.pre.in | 54 ++++++++++++++++++++++++++++++++++++------------------ configure.ac | 5 +++++ - 2 files changed, 41 insertions(+), 19 deletions(-) + 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 4ce917a..4110fff 100644 +index 5d64ab7..194dbfc 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1194,8 +1194,28 @@ maninstall: altmaninstall +@@ -1251,8 +1251,28 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax @@ -684,10 +691,10 @@ index 4ce917a..4110fff 100644 test/audiodata \ test/capath test/data \ test/cjkencodings test/decimaltestdata test/xmltestdata \ -@@ -1229,29 +1249,26 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ - test/test_importlib/namespace_pkgs/project3/parent/child \ - test/test_importlib/namespace_pkgs/module_and_namespace_package \ - test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \ +@@ -1306,26 +1326,24 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ + test/test_importlib/source \ + test/test_importlib/zipdata01 \ + test/test_importlib/zipdata02 \ - asyncio \ test/test_asyncio \ - collections concurrent concurrent/futures encodings \ @@ -706,13 +713,10 @@ index 4ce917a..4110fff 100644 - ctypes ctypes/test ctypes/macholib \ - idlelib idlelib/Icons idlelib/idle_test \ - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ -- importlib test/test_importlib test/test_importlib/builtin \ + ctypes/test \ + idlelib/idle_test \ + distutils/tests \ + test/test_importlib test/test_importlib/builtin \ - test/test_importlib/extension test/test_importlib/frozen \ - test/test_importlib/import_ test/test_importlib/source \ test/test_tools test/test_warnings test/test_warnings/data \ - turtledemo \ - multiprocessing multiprocessing/dummy \ @@ -729,11 +733,11 @@ index 4ce917a..4110fff 100644 @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ diff --git a/configure.ac b/configure.ac -index d5ee2ae..f924937 100644 +index d68d410..ea7aaeb 100644 --- a/configure.ac +++ b/configure.ac -@@ -3112,6 +3112,11 @@ if test "$posix_threads" = "yes"; then - AC_CHECK_FUNCS(pthread_atfork) +@@ -3162,6 +3162,11 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_getcpuclockid) fi +AC_SUBST(TEST_MODULES) @@ -745,13 +749,13 @@ index d5ee2ae..f924937 100644 # Check for enable-ipv6 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) -- -2.11.0 +2.7.4 -From 9ba352418daeded77feabeec008cb6e7c63342db Mon Sep 17 00:00:00 2001 +From 66627f9f652400a125cf78a2356bf5b984ef707c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:07:56 -0800 -Subject: [PATCH 14/29] Add an option to disable pydoc +Subject: [PATCH 14/32] Add an option to disable pydoc It removes 0.5 MB of data from the target plus the pydoc script itself. @@ -767,10 +771,10 @@ Signed-off-by: Andrey Smirnov 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 4110fff..badb2af 100644 +index 194dbfc..efba1b5 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1164,7 +1164,9 @@ bininstall: altbininstall +@@ -1221,7 +1221,9 @@ bininstall: altbininstall -rm -f $(DESTDIR)$(BINDIR)/idle3 (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) -rm -f $(DESTDIR)$(BINDIR)/pydoc3 @@ -780,7 +784,7 @@ index 4110fff..badb2af 100644 -rm -f $(DESTDIR)$(BINDIR)/2to3 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) -rm -f $(DESTDIR)$(BINDIR)/pyvenv -@@ -1212,7 +1214,7 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1269,7 +1271,7 @@ LIBSUBDIRS= tkinter site-packages \ multiprocessing multiprocessing/dummy \ unittest \ venv venv/scripts venv/scripts/common venv/scripts/posix \ @@ -789,7 +793,7 @@ index 4110fff..badb2af 100644 TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ tkinter/test/test_ttk test \ -@@ -1269,6 +1271,10 @@ ifeq (@TEST_MODULES@,yes) +@@ -1344,6 +1346,10 @@ ifeq (@TEST_MODULES@,yes) LIBSUBDIRS += $(TESTSUBDIRS) endif @@ -801,11 +805,11 @@ index 4110fff..badb2af 100644 @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ diff --git a/configure.ac b/configure.ac -index f924937..1621fa1 100644 +index ea7aaeb..608ef45 100644 --- a/configure.ac +++ b/configure.ac -@@ -3112,6 +3112,12 @@ if test "$posix_threads" = "yes"; then - AC_CHECK_FUNCS(pthread_atfork) +@@ -3162,6 +3162,12 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_getcpuclockid) fi +AC_SUBST(PYDOC) @@ -818,10 +822,10 @@ index f924937..1621fa1 100644 AC_ARG_ENABLE(test-modules, diff --git a/setup.py b/setup.py -index 29bfd17..94dd337 100644 +index 184999e..0492942 100644 --- a/setup.py +++ b/setup.py -@@ -2281,6 +2281,12 @@ def main(): +@@ -2332,6 +2332,12 @@ def main(): # turn off warnings when deprecated modules are imported import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) @@ -834,7 +838,7 @@ index 29bfd17..94dd337 100644 setup(# PyPI Metadata (PEP 301) name = "Python", version = sys.version.split()[0], -@@ -2305,8 +2311,7 @@ def main(): +@@ -2356,8 +2362,7 @@ def main(): # If you change the scripts installed here, you also need to # check the PyBuildScripts command above, and change the links # created by the bininstall target in Makefile.pre.in @@ -845,13 +849,13 @@ index 29bfd17..94dd337 100644 # --install-platlib -- -2.11.0 +2.7.4 -From 83a7fcf8bdd163f2bfcaed1b8493ccb8f5db960f Mon Sep 17 00:00:00 2001 +From 9879ed6a7efae3152feabc880f4d01e1fa2ff389 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:15:31 -0800 -Subject: [PATCH 15/29] Add an option to disable lib2to3 +Subject: [PATCH 15/32] Add an option to disable lib2to3 lib2to3 is a library to convert Python 2.x code to Python 3.x. As such, it is probably not very useful on embedded system targets. @@ -867,10 +871,10 @@ Signed-off-by: Andrey Smirnov 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index badb2af..931cc3e 100644 +index efba1b5..017844f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1168,7 +1168,9 @@ ifeq (@PYDOC@,yes) +@@ -1225,7 +1225,9 @@ ifeq (@PYDOC@,yes) (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) endif -rm -f $(DESTDIR)$(BINDIR)/2to3 @@ -880,7 +884,7 @@ index badb2af..931cc3e 100644 -rm -f $(DESTDIR)$(BINDIR)/pyvenv (cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv) if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ -@@ -1205,7 +1207,6 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1262,7 +1264,6 @@ LIBSUBDIRS= tkinter site-packages \ html json http dbm xmlrpc \ sqlite3 \ logging csv wsgiref urllib \ @@ -888,7 +892,7 @@ index badb2af..931cc3e 100644 ctypes ctypes/macholib \ idlelib idlelib/Icons \ distutils distutils/command $(XMLLIBSUBDIRS) \ -@@ -1255,9 +1256,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1332,9 +1333,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_email test/test_email/data \ test/test_json \ sqlite3/test \ @@ -898,7 +902,7 @@ index badb2af..931cc3e 100644 ctypes/test \ idlelib/idle_test \ distutils/tests \ -@@ -1267,6 +1265,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1342,6 +1340,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_tools test/test_warnings test/test_warnings/data \ unittest/test unittest/test/testmock @@ -913,7 +917,7 @@ index badb2af..931cc3e 100644 ifeq (@TEST_MODULES@,yes) LIBSUBDIRS += $(TESTSUBDIRS) endif -@@ -1366,10 +1372,12 @@ ifeq (@PYC_BUILD@,yes) +@@ -1441,10 +1447,12 @@ ifeq (@PYC_BUILD@,yes) -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages endif @@ -925,12 +929,12 @@ index badb2af..931cc3e 100644 +endif python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh - # Substitution happens here, as the completely-expanded BINDIR + @ # Substitution happens here, as the completely-expanded BINDIR diff --git a/configure.ac b/configure.ac -index 1621fa1..13b2edf 100644 +index 608ef45..3f73186 100644 --- a/configure.ac +++ b/configure.ac -@@ -3124,6 +3124,12 @@ AC_ARG_ENABLE(test-modules, +@@ -3174,6 +3174,12 @@ AC_ARG_ENABLE(test-modules, AS_HELP_STRING([--disable-test-modules], [disable test modules]), [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) @@ -944,10 +948,10 @@ index 1621fa1..13b2edf 100644 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) AC_MSG_CHECKING([if --enable-ipv6 is specified]) diff --git a/setup.py b/setup.py -index 94dd337..76429e1 100644 +index 0492942..2c2fbd5 100644 --- a/setup.py +++ b/setup.py -@@ -2282,10 +2282,11 @@ def main(): +@@ -2333,10 +2333,11 @@ def main(): import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) @@ -962,13 +966,13 @@ index 94dd337..76429e1 100644 setup(# PyPI Metadata (PEP 301) name = "Python", -- -2.11.0 +2.7.4 -From 72bcd78208f9b53c1af0508c56d0fb87d02e6447 Mon Sep 17 00:00:00 2001 +From 8a8ea383325abb2237f526d7a3744172a19c881f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:20:45 -0800 -Subject: [PATCH 16/29] Add option to disable the sqlite3 module +Subject: [PATCH 16/32] Add option to disable the sqlite3 module Signed-off-by: Thomas Petazzoni Signed-off-by: Samuel Martin @@ -980,10 +984,10 @@ Signed-off-by: Andrey Smirnov 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 931cc3e..a1ce071 100644 +index 017844f..c5f1389 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1205,7 +1205,6 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1262,7 +1262,6 @@ LIBSUBDIRS= tkinter site-packages \ email email/mime \ ensurepip ensurepip/_bundled \ html json http dbm xmlrpc \ @@ -991,7 +995,7 @@ index 931cc3e..a1ce071 100644 logging csv wsgiref urllib \ ctypes ctypes/macholib \ idlelib idlelib/Icons \ -@@ -1255,7 +1254,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1332,7 +1331,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_asyncio \ test/test_email test/test_email/data \ test/test_json \ @@ -999,7 +1003,7 @@ index 931cc3e..a1ce071 100644 ctypes/test \ idlelib/idle_test \ distutils/tests \ -@@ -1273,6 +1271,11 @@ TESTSUBDIRS += lib2to3/tests \ +@@ -1348,6 +1346,11 @@ TESTSUBDIRS += lib2to3/tests \ lib2to3/tests/data/fixers/myfixes endif @@ -1012,11 +1016,11 @@ index 931cc3e..a1ce071 100644 LIBSUBDIRS += $(TESTSUBDIRS) endif diff --git a/configure.ac b/configure.ac -index 13b2edf..d7582cf 100644 +index 3f73186..8252ee9 100644 --- a/configure.ac +++ b/configure.ac -@@ -3112,6 +3112,15 @@ if test "$posix_threads" = "yes"; then - AC_CHECK_FUNCS(pthread_atfork) +@@ -3162,6 +3162,15 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_getcpuclockid) fi +AC_SUBST(SQLITE3) @@ -1032,13 +1036,13 @@ index 13b2edf..d7582cf 100644 AC_ARG_ENABLE(pydoc, -- -2.11.0 +2.7.4 -From 1451f9d151c787ea9e82945b8ce545adfb89356a Mon Sep 17 00:00:00 2001 +From 44fb56b626118fc994277a433930d2bd5f77e446 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:23:42 -0800 -Subject: [PATCH 17/29] Add an option to disable the tk module +Subject: [PATCH 17/32] Add an option to disable the tk module Signed-off-by: Thomas Petazzoni Signed-off-by: Samuel Martin @@ -1050,10 +1054,10 @@ Signed-off-by: Andrey Smirnov 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index a1ce071..dc1e917 100644 +index c5f1389..62b0617 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1199,7 +1199,7 @@ maninstall: altmaninstall +@@ -1256,7 +1256,7 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax @@ -1062,7 +1066,7 @@ index a1ce071..dc1e917 100644 asyncio \ collections concurrent concurrent/futures encodings \ email email/mime \ -@@ -1216,8 +1216,7 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1273,8 +1273,7 @@ LIBSUBDIRS= tkinter site-packages \ venv venv/scripts venv/scripts/common venv/scripts/posix \ curses @@ -1072,7 +1076,7 @@ index a1ce071..dc1e917 100644 test/audiodata \ test/capath test/data \ test/cjkencodings test/decimaltestdata test/xmltestdata \ -@@ -1263,6 +1262,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1338,6 +1337,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_tools test/test_warnings test/test_warnings/data \ unittest/test unittest/test/testmock @@ -1086,10 +1090,10 @@ index a1ce071..dc1e917 100644 LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 TESTSUBDIRS += lib2to3/tests \ diff --git a/configure.ac b/configure.ac -index d7582cf..6a56a5b 100644 +index 8252ee9..a668e0e 100644 --- a/configure.ac +++ b/configure.ac -@@ -3121,6 +3121,15 @@ if test "$SQLITE3" = "no" ; then +@@ -3171,6 +3171,15 @@ if test "$SQLITE3" = "no" ; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" fi @@ -1106,13 +1110,13 @@ index d7582cf..6a56a5b 100644 AC_ARG_ENABLE(pydoc, -- -2.11.0 +2.7.4 -From 703aaff814d8433dd742e95e98e523de2490d2d9 Mon Sep 17 00:00:00 2001 +From fadc3279588dbf99fb5f044edd329dc4ea2b30a6 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:31:51 -0800 -Subject: [PATCH 18/29] Add an option to disable the curses module +Subject: [PATCH 18/32] Add an option to disable the curses module Signed-off-by: Thomas Petazzoni Signed-off-by: Samuel Martin @@ -1124,10 +1128,10 @@ Signed-off-by: Andrey Smirnov 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index dc1e917..6a6bc08 100644 +index 62b0617..5cef555 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1213,8 +1213,7 @@ LIBSUBDIRS= site-packages \ +@@ -1270,8 +1270,7 @@ LIBSUBDIRS= site-packages \ turtledemo \ multiprocessing multiprocessing/dummy \ unittest \ @@ -1137,7 +1141,7 @@ index dc1e917..6a6bc08 100644 TESTSUBDIRS= test \ test/audiodata \ -@@ -1268,6 +1267,10 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ +@@ -1343,6 +1342,10 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ tkinter/test/test_ttk endif @@ -1149,10 +1153,10 @@ index dc1e917..6a6bc08 100644 LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 TESTSUBDIRS += lib2to3/tests \ diff --git a/configure.ac b/configure.ac -index 6a56a5b..5896b39 100644 +index a668e0e..c4b15ce 100644 --- a/configure.ac +++ b/configure.ac -@@ -3130,6 +3130,15 @@ if test "$TK" = "no"; then +@@ -3180,6 +3180,15 @@ if test "$TK" = "no"; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" fi @@ -1169,13 +1173,13 @@ index 6a56a5b..5896b39 100644 AC_ARG_ENABLE(pydoc, -- -2.11.0 +2.7.4 -From d6f3165356840c8ea03538b38078b478c2fd1c5d Mon Sep 17 00:00:00 2001 +From d14bc30bf2758459a42f1315601e5a829935601e Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 22 Feb 2017 17:40:45 -0800 -Subject: [PATCH 19/29] Add an option to disable expat +Subject: [PATCH 19/32] Add an option to disable expat This patch replaces the existing --with-system-expat option with a --with-expat={system,builtin,none} option, which allows to tell Python @@ -1194,10 +1198,10 @@ Signed-off-by: Andrey Smirnov 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 6a6bc08..dc4b92b 100644 +index 5cef555..d703c36 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1208,7 +1208,7 @@ LIBSUBDIRS= site-packages \ +@@ -1265,7 +1265,7 @@ LIBSUBDIRS= site-packages \ logging csv wsgiref urllib \ ctypes ctypes/macholib \ idlelib idlelib/Icons \ @@ -1206,7 +1210,7 @@ index 6a6bc08..dc4b92b 100644 importlib \ turtledemo \ multiprocessing multiprocessing/dummy \ -@@ -1271,6 +1271,10 @@ ifeq (@CURSES@,yes) +@@ -1346,6 +1346,10 @@ ifeq (@CURSES@,yes) LIBSUBDIRS += curses endif @@ -1218,10 +1222,10 @@ index 6a6bc08..dc4b92b 100644 LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 TESTSUBDIRS += lib2to3/tests \ diff --git a/configure.ac b/configure.ac -index 5896b39..6f21482 100644 +index c4b15ce..46fef2c 100644 --- a/configure.ac +++ b/configure.ac -@@ -2813,13 +2813,21 @@ PKG_PROG_PKG_CONFIG +@@ -2905,13 +2905,21 @@ PKG_PROG_PKG_CONFIG AC_SUBST(DISABLED_EXTENSIONS) # Check for use of the system expat library @@ -1249,10 +1253,10 @@ index 5896b39..6f21482 100644 # Check for use of the system libffi library AC_MSG_CHECKING(for --with-system-ffi) diff --git a/setup.py b/setup.py -index 76429e1..38aa5e6 100644 +index 2c2fbd5..27c4e1a 100644 --- a/setup.py +++ b/setup.py -@@ -1495,7 +1495,7 @@ class PyBuildExt(build_ext): +@@ -1485,7 +1485,7 @@ class PyBuildExt(build_ext): # # More information on Expat can be found at www.libexpat.org. # @@ -1260,15 +1264,15 @@ index 76429e1..38aa5e6 100644 + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"): expat_inc = [] define_macros = [] - expat_lib = ['expat'] + extra_compile_args = [] -- -2.11.0 +2.7.4 -From 847e684c0c280be1dd6c734837db78e3a6e3d94d Mon Sep 17 00:00:00 2001 +From aa2d0e7d0cd008f4a9b886806119d05bf81cebe1 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:49:55 +0100 -Subject: [PATCH 20/29] Add an option to disable CJK codecs +Subject: [PATCH 20/32] Add an option to disable CJK codecs Signed-off-by: Thomas Petazzoni --- @@ -1276,10 +1280,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac -index 6f21482..c7742fa 100644 +index 46fef2c..db47ca1 100644 --- a/configure.ac +++ b/configure.ac -@@ -3129,6 +3129,12 @@ if test "$SQLITE3" = "no" ; then +@@ -3179,6 +3179,12 @@ if test "$SQLITE3" = "no" ; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" fi @@ -1293,13 +1297,13 @@ index 6f21482..c7742fa 100644 AC_ARG_ENABLE(tk, AS_HELP_STRING([--disable-tk], [disable tk]), -- -2.11.0 +2.7.4 -From f05d7c051207b17d8568ab8fdc6bed3edfb253c5 Mon Sep 17 00:00:00 2001 +From 453934f6ffbcbe113f0a1ca01f6747810472392e Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:50:11 +0100 -Subject: [PATCH 21/29] Add an option to disable NIS +Subject: [PATCH 21/32] Add an option to disable NIS NIS is not necessarily available in uClibc, so we need an option to not compile support for it. @@ -1310,10 +1314,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac -index c7742fa..42a871b 100644 +index db47ca1..7a79890 100644 --- a/configure.ac +++ b/configure.ac -@@ -3135,6 +3135,12 @@ AC_ARG_ENABLE(codecs-cjk, +@@ -3185,6 +3185,12 @@ AC_ARG_ENABLE(codecs-cjk, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" fi]) @@ -1327,13 +1331,13 @@ index c7742fa..42a871b 100644 AC_ARG_ENABLE(tk, AS_HELP_STRING([--disable-tk], [disable tk]), -- -2.11.0 +2.7.4 -From 28bef549b43643d779c281e2840a16d9c79d7c5a Mon Sep 17 00:00:00 2001 +From 423e0dbcb0e14e8b14b42a77056b646a1eb21ebd Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:50:27 +0100 -Subject: [PATCH 22/29] Add an option to disable unicodedata +Subject: [PATCH 22/32] Add an option to disable unicodedata Signed-off-by: Thomas Petazzoni --- @@ -1341,10 +1345,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac -index 42a871b..1d610e1 100644 +index 7a79890..9ea602f 100644 --- a/configure.ac +++ b/configure.ac -@@ -3141,6 +3141,12 @@ AC_ARG_ENABLE(nis, +@@ -3191,6 +3191,12 @@ AC_ARG_ENABLE(nis, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" fi]) @@ -1358,13 +1362,13 @@ index 42a871b..1d610e1 100644 AC_ARG_ENABLE(tk, AS_HELP_STRING([--disable-tk], [disable tk]), -- -2.11.0 +2.7.4 -From 119dbb9d99934bbf6a10376862c5be71897f0245 Mon Sep 17 00:00:00 2001 +From d7f5a846ebc198214364fb810880778f5ff16d46 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 22 Feb 2017 17:45:14 -0800 -Subject: [PATCH 23/29] Add an option to disable IDLE +Subject: [PATCH 23/32] Add an option to disable IDLE IDLE is an IDE embedded into python, written using Tk, so it doesn't make much sense to have it into our build. @@ -1379,10 +1383,10 @@ Signed-off-by: Andrey Smirnov 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index dc4b92b..3e43066 100644 +index d703c36..b8e9388 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1162,7 +1162,9 @@ bininstall: altbininstall +@@ -1219,7 +1219,9 @@ bininstall: altbininstall -rm -f $(DESTDIR)$(LIBPC)/python3.pc (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc) -rm -f $(DESTDIR)$(BINDIR)/idle3 @@ -1392,7 +1396,7 @@ index dc4b92b..3e43066 100644 -rm -f $(DESTDIR)$(BINDIR)/pydoc3 ifeq (@PYDOC@,yes) (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) -@@ -1207,7 +1209,6 @@ LIBSUBDIRS= site-packages \ +@@ -1264,7 +1266,6 @@ LIBSUBDIRS= site-packages \ html json http dbm xmlrpc \ logging csv wsgiref urllib \ ctypes ctypes/macholib \ @@ -1400,7 +1404,7 @@ index dc4b92b..3e43066 100644 distutils distutils/command \ importlib \ turtledemo \ -@@ -1275,6 +1276,10 @@ ifeq (@EXPAT@,yes) +@@ -1350,6 +1351,10 @@ ifeq (@EXPAT@,yes) LIBSUBDIRS += $(XMLLIBSUBDIRS) endif @@ -1412,10 +1416,10 @@ index dc4b92b..3e43066 100644 LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 TESTSUBDIRS += lib2to3/tests \ diff --git a/configure.ac b/configure.ac -index 1d610e1..2699e7c 100644 +index 9ea602f..047d080 100644 --- a/configure.ac +++ b/configure.ac -@@ -3183,6 +3183,12 @@ AC_ARG_ENABLE(lib2to3, +@@ -3233,6 +3233,12 @@ AC_ARG_ENABLE(lib2to3, AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) @@ -1429,10 +1433,10 @@ index 1d610e1..2699e7c 100644 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) AC_MSG_CHECKING([if --enable-ipv6 is specified]) diff --git a/setup.py b/setup.py -index 38aa5e6..d642825 100644 +index 27c4e1a..c0995ed 100644 --- a/setup.py +++ b/setup.py -@@ -2282,11 +2282,13 @@ def main(): +@@ -2333,11 +2333,13 @@ def main(): import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) @@ -1448,13 +1452,13 @@ index 38aa5e6..d642825 100644 setup(# PyPI Metadata (PEP 301) name = "Python", -- -2.11.0 +2.7.4 -From 38737ed2625b882d7314dcb210bfc1ef6efe0bad Mon Sep 17 00:00:00 2001 +From 7dfb61f2454472b8acf1e8fad3867ba91c20273f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:51:31 +0100 -Subject: [PATCH 24/29] Add an option to disable decimal +Subject: [PATCH 24/32] Add an option to disable decimal This patch replaces the existing --with-system-libmpdec option with a --with-libmpdec={system,builtin,none} option, which allows to tell @@ -1462,17 +1466,19 @@ Python whether we want to use the system libmpdec (already installed), the libmpdec builtin the Python sources, or no libmpdec at all. Signed-off-by: Thomas Petazzoni +[aduskett@gmail.com: Update for python 3.7.0] +Signed-off-by: Adam Duskett --- configure.ac | 17 ++++++++++++----- setup.py | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac -index 2699e7c..e2c3b6f 100644 +index 047d080..8fd595e 100644 --- a/configure.ac +++ b/configure.ac -@@ -2862,13 +2862,20 @@ AC_SUBST(LIBFFI_INCLUDEDIR) - AC_MSG_RESULT($with_system_ffi) +@@ -2956,13 +2956,20 @@ fi + AC_SUBST(LIBFFI_INCLUDEDIR) # Check for use of the system libmpdec library -AC_MSG_CHECKING(for --with-system-libmpdec) @@ -1498,10 +1504,10 @@ index 2699e7c..e2c3b6f 100644 # Check for support for loadable sqlite extensions AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions) diff --git a/setup.py b/setup.py -index d642825..5b98255 100644 +index c0995ed..1a7085c 100644 --- a/setup.py +++ b/setup.py -@@ -2058,7 +2058,7 @@ class PyBuildExt(build_ext): +@@ -2010,7 +2010,7 @@ class PyBuildExt(build_ext): def _decimal_ext(self): extra_compile_args = [] undef_macros = [] @@ -1511,13 +1517,13 @@ index d642825..5b98255 100644 libraries = [':libmpdec.so.2'] sources = ['_decimal/_decimal.c'] -- -2.11.0 +2.7.4 -From c7d30980dd5b8b4067bb1a0053ea0f8b761c669c Mon Sep 17 00:00:00 2001 +From 27bbc7b6892807d152f1ce808eadfa87fc0e9349 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 23 Dec 2015 11:51:58 +0100 -Subject: [PATCH 25/29] Add an option to disable the ossaudiodev module +Subject: [PATCH 25/32] Add an option to disable the ossaudiodev module Signed-off-by: Thomas Petazzoni --- @@ -1525,10 +1531,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac -index e2c3b6f..8e3dded 100644 +index 8fd595e..2287a3e 100644 --- a/configure.ac +++ b/configure.ac -@@ -2877,6 +2877,12 @@ else +@@ -2971,6 +2971,12 @@ else fi AC_SUBST(MPDEC) @@ -1542,78 +1548,13 @@ index e2c3b6f..8e3dded 100644 AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions) AC_ARG_ENABLE(loadable-sqlite-extensions, -- -2.11.0 +2.7.4 -From 01818db0a7056c054e5170aefaae06a2d87980c6 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:53:40 -0800 -Subject: [PATCH 26/29] Support PGEN_FOR_BUILD and FREEZE_IMPORTLIB_FOR_BUILD - -Signed-off-by: Thomas Petazzoni -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 10 ++++++++++ - configure.ac | 3 +++ - 2 files changed, 13 insertions(+) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 3e43066..6aa0bd3 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -688,10 +688,15 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) - ############################################################################ - # Importlib - -+ifeq (@FREEZE_IMPORTLIB_FOR_BUILD@,) - Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile - - Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) - $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -+else -+Programs/_freeze_importlib: @FREEZE_IMPORTLIB_FOR_BUILD@ -+ cp $^ $@ -+endif - - .PHONY: regen-importlib - regen-importlib: Programs/_freeze_importlib -@@ -769,8 +774,13 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile - - $(IO_OBJS): $(IO_H) - -+ifeq (@PGEN_FOR_BUILD@,) - $(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) -+else -+$(PGEN): @PGEN_FOR_BUILD@ -+ cp $^ $@ -+endif - - .PHONY: regen-grammar - regen-grammar: $(PGEN) -diff --git a/configure.ac b/configure.ac -index 8e3dded..1c7a3b5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -82,6 +82,9 @@ else - fi - AC_SUBST(PYTHON_FOR_BUILD) - -+AC_SUBST(PGEN_FOR_BUILD) -+AC_SUBST(FREEZE_IMPORTLIB_FOR_BUILD) -+ - dnl Ensure that if prefix is specified, it does not end in a slash. If - dnl it does, we get path names containing '//' which is both ugly and - dnl can cause trouble. --- -2.11.0 - - -From 8b987f6996ee8b07410409888e08d0168b12dd23 Mon Sep 17 00:00:00 2001 +From e335230b4e7f82a4e8aa628fd41cc0bac4cbb58b Mon Sep 17 00:00:00 2001 From: Nicolas Cavallari Date: Wed, 22 Feb 2017 17:55:59 -0800 -Subject: [PATCH 27/29] Add an option to disable openssl support. +Subject: [PATCH 26/32] Add an option to disable openssl support. Signed-off-by: Nicolas Cavallari --- @@ -1621,10 +1562,10 @@ Signed-off-by: Nicolas Cavallari 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac -index 1c7a3b5..534a903 100644 +index 2287a3e..5433aaa 100644 --- a/configure.ac +++ b/configure.ac -@@ -3163,6 +3163,12 @@ AC_ARG_ENABLE(unicodedata, +@@ -3210,6 +3210,12 @@ AC_ARG_ENABLE(unicodedata, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" fi]) @@ -1638,13 +1579,13 @@ index 1c7a3b5..534a903 100644 AC_ARG_ENABLE(tk, AS_HELP_STRING([--disable-tk], [disable tk]), -- -2.11.0 +2.7.4 -From 06a41285075d146ab35090e899da91c2edf334f1 Mon Sep 17 00:00:00 2001 +From 3f17b4b32b490f451d20e88f59ad0d12b1a77aa7 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 7 Mar 2017 23:29:05 +0100 -Subject: [PATCH 28/29] Add an option to disable the readline module +Subject: [PATCH 27/32] Add an option to disable the readline module Signed-off-by: Thomas Petazzoni --- @@ -1652,10 +1593,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac -index 534a903..5df3b10 100644 +index 5433aaa..1bfade6 100644 --- a/configure.ac +++ b/configure.ac -@@ -3169,6 +3169,12 @@ AC_ARG_ENABLE(openssl, +@@ -3216,6 +3216,12 @@ AC_ARG_ENABLE(openssl, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" fi]) @@ -1669,13 +1610,13 @@ index 534a903..5df3b10 100644 AC_ARG_ENABLE(tk, AS_HELP_STRING([--disable-tk], [disable tk]), -- -2.11.0 +2.7.4 -From df007a6f4f082f0abab53c95dc58b30b7a9d7336 Mon Sep 17 00:00:00 2001 +From fbe47fb2f70635ffeb7b44d9af23cc6352ade250 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 7 Mar 2017 23:31:11 +0100 -Subject: [PATCH 29/29] Add options to disable zlib, bzip2 and xz modules +Subject: [PATCH 28/32] Add options to disable zlib, bzip2 and xz modules Signed-off-by: Thomas Petazzoni --- @@ -1683,10 +1624,10 @@ Signed-off-by: Thomas Petazzoni 1 file changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac -index 5df3b10..43290e3 100644 +index 1bfade6..b022460 100644 --- a/configure.ac +++ b/configure.ac -@@ -3175,6 +3175,24 @@ AC_ARG_ENABLE(readline, +@@ -3222,6 +3222,24 @@ AC_ARG_ENABLE(readline, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" fi]) @@ -1712,5 +1653,171 @@ index 5df3b10..43290e3 100644 AC_ARG_ENABLE(tk, AS_HELP_STRING([--disable-tk], [disable tk]), -- -2.11.0 +2.7.4 + + +From 3ce895014bc7a43e4af09268037ca3ae11ab5434 Mon Sep 17 00:00:00 2001 +From: Matt Weber +Date: Fri, 6 Oct 2017 09:54:15 -0500 +Subject: [PATCH 29/32] python-config.sh: don't reassign ${prefix} + +When prefix is set to a path like /usr during crossbuild +the sed operations end up executing twice, once for the prefix +reassignment and another for includedir if it is set as a string +including the ${prefix} variable. This results in an issue +when the build directory is under /usr. + +This patch updates the remaining location which uses the prefix +variable to also sed and update to use the real path. + +Upstream bug report: +https://bugs.python.org/issue31713 + +Buildroot bug: +https://bugs.busybox.net/show_bug.cgi?id=10361 + +Fixes failures like the following: +dbus-python-1.2.4 | NOK | http://autobuild.buildroot.net/results/758858efa97b6273c1b470513f5492258a6d8853 + +Signed-off-by: Matthew Weber +--- + Misc/python-config.sh.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index 9e259c0..8b249d9 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -31,7 +31,7 @@ prefix_real=$(installed_prefix "$0") + # locations. Keep prefix & exec_prefix using their original values in case + # they are referenced in other configure variables, to prevent double + # substitution, issue #22140. +-prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") ++prefix=$prefix_build + exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") + exec_prefix_real=${prefix_real} + includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") +@@ -49,7 +49,7 @@ LINKFORSHARED="@LINKFORSHARED@" + OPT="@OPT@" + PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" + LDVERSION="@LDVERSION@" +-LIBDEST=${prefix_real}/lib/python${VERSION} ++LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#") + LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") + SO="@EXT_SUFFIX@" + PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" +-- +2.7.4 + + +From cacbe32e00706bd30ac85c61c3ef7968e7842daa Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Fri, 20 Jul 2018 10:17:39 -0400 +Subject: [PATCH 30/32] Fix cross compiling the uuid module + +Python 3.7 has a new _uuid module, however, the include directory +search path for uuid.h is hardcoded to /usr/include/uuid, which should +not be used when cross-compiling. + +To fix this, use the same solution as the one used by the NIS +detection: append "uuid" to each of the include directories in +"inc_dirs", instead of hardcoding /usr/include/uuid. + +Signed-off-by: Adam Duskett +[Thomas: drop STAGING_DIR based solution, use a solution similar to +the one used for the NIS detection.] +Signed-off-by: Thomas Petazzoni +--- + setup.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 1a7085c..f33d0b5 100644 +--- a/setup.py ++++ b/setup.py +@@ -1627,7 +1627,8 @@ class PyBuildExt(build_ext): + missing.append('_tkinter') + + # Build the _uuid module if possible +- uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"]) ++ uuid_incs = find_file("uuid.h", inc_dirs, ++ [os.path.join(inc_dir, 'uuid') for inc_dir in inc_dirs]) + if uuid_incs is not None: + if self.compiler.find_library_file(lib_dirs, 'uuid'): + uuid_libs = ['uuid'] +-- +2.7.4 + + +From 2fa6601532a26fa443af815515fb4606e3ed365c Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 18 Aug 2018 10:54:56 +0200 +Subject: [PATCH 31/32] Add an option to disable uuid module + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index b022460..505b7c9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3258,6 +3258,15 @@ if test "$CURSES" = "no"; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" + fi + ++AC_SUBST(UUID) ++AC_ARG_ENABLE(uuid, ++ AS_HELP_STRING([--disable-uuid], [disable uuid]), ++ [ UUID="${enableval}" ], [ UUID=yes ]) ++ ++if test "$UUID" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _uuid" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.7.4 + + +From 09ce21cc094ef0545eda45299474365d910cb91f Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Thu, 16 Aug 2018 14:52:37 -0700 +Subject: [PATCH 32/32] fix building on older distributions + +Python > 3.6.3 calls os.replace in the update_file.py script, during the +regen-importlib phase of the build process. + +According to Doc/whatsnew/3.3.rst line 1631, os.replace acts in the same +way as os.rename, however, it is now cross-platform compatible for Windows. + +Because BuildRoot is guaranteed only to be built in POSIX environment, it is +safe to change os.replace back to os.rename. + +This change fixes building on older systems such as CentOS7, that only come +with python 2. + +Signed-off-by: Adam Duskett +--- + Tools/scripts/update_file.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Tools/scripts/update_file.py b/Tools/scripts/update_file.py +index 224585c..ef458c0 100644 +--- a/Tools/scripts/update_file.py ++++ b/Tools/scripts/update_file.py +@@ -16,7 +16,7 @@ def main(old_path, new_path): + with open(new_path, 'rb') as f: + new_contents = f.read() + if old_contents != new_contents: +- os.replace(new_path, old_path) ++ os.rename(new_path, old_path) + else: + os.unlink(new_path) + +-- +2.7.4