diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-09-15 15:30:51 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-09-21 10:19:21 +0200 |
commit | 4c7f558c8e1ba4aafc2aa3741017c45484c62904 (patch) | |
tree | c5c1d44625cc075b14e6515b5f0c171c545b3b91 | |
parent | 228ca4bc6df2024c62b79e55db19d3ad6487cc26 (diff) | |
download | ptxdist-4c7f558c8e1ba4aafc2aa3741017c45484c62904.tar.gz ptxdist-4c7f558c8e1ba4aafc2aa3741017c45484c62904.tar.xz |
python3: version bump 3.4.2 -> 3.5.0
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | patches/Python-3.4.2/0001-python3-don-t-leak-host-path-into-cross-compilation.patch | 37 | ||||
-rw-r--r-- | patches/Python-3.5.0/0001-python3-don-t-leak-host-path-into-cross-compilation.patch | 35 | ||||
-rw-r--r-- | patches/Python-3.5.0/0002-use-shipped-sources.patch | 40 | ||||
-rw-r--r-- | patches/Python-3.5.0/series (renamed from patches/Python-3.4.2/series) | 3 | ||||
-rw-r--r-- | rules/host-python3.make | 6 | ||||
-rw-r--r-- | rules/python3.in | 17 | ||||
-rw-r--r-- | rules/python3.make | 57 |
7 files changed, 130 insertions, 65 deletions
diff --git a/patches/Python-3.4.2/0001-python3-don-t-leak-host-path-into-cross-compilation.patch b/patches/Python-3.4.2/0001-python3-don-t-leak-host-path-into-cross-compilation.patch deleted file mode 100644 index 7e063cddd..000000000 --- a/patches/Python-3.4.2/0001-python3-don-t-leak-host-path-into-cross-compilation.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Han Sirkstra <han@protonic.nl> -Date: Wed, 2 Sep 2015 12:49:53 +0200 -Subject: [PATCH] python3: don't leak host path into cross compilation - -Signed-off-by: David Jander <david@protonic.nl> ---- - Lib/distutils/command/build_ext.py | 2 +- - setup.py | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py -index 3ab2d04bf98a..acbe648036fc 100644 ---- a/Lib/distutils/command/build_ext.py -+++ b/Lib/distutils/command/build_ext.py -@@ -237,7 +237,7 @@ class build_ext(Command): - # Python's library directory must be appended to library_dirs - # See Issues: #1600860, #4366 - if (sysconfig.get_config_var('Py_ENABLE_SHARED')): -- if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): -+ if not sysconfig.python_build: - # building third party extensions - self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) - else: -diff --git a/setup.py b/setup.py -index 5d4f44465a8a..c37cb33b2f12 100644 ---- a/setup.py -+++ b/setup.py -@@ -493,7 +493,8 @@ class PyBuildExt(build_ext): - add_dir_to_list(dir_list, directory) - - if os.path.normpath(sys.base_prefix) != '/usr' \ -- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): -+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ -+ and not cross_compiling: - # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework - # (PYTHONFRAMEWORK is set) to avoid # linking problems when - # building a framework with different architectures than diff --git a/patches/Python-3.5.0/0001-python3-don-t-leak-host-path-into-cross-compilation.patch b/patches/Python-3.5.0/0001-python3-don-t-leak-host-path-into-cross-compilation.patch new file mode 100644 index 000000000..d157adc67 --- /dev/null +++ b/patches/Python-3.5.0/0001-python3-don-t-leak-host-path-into-cross-compilation.patch @@ -0,0 +1,35 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Tue, 15 Sep 2015 15:33:58 +0200 +Subject: [PATCH] python3: don't leak host path into cross compilation + +Based on a patch by Han Sirkstra <han@protonic.nl> + +Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> +--- + setup.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/setup.py b/setup.py +index da67731aa19f..1c3f2d09f794 100644 +--- a/setup.py ++++ b/setup.py +@@ -511,7 +511,8 @@ class PyBuildExt(build_ext): + add_dir_to_list(dir_list, directory) + + if os.path.normpath(sys.base_prefix) != '/usr' \ +- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): ++ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ ++ and not cross_compiling: + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when + # building a framework with different architectures than +@@ -1294,7 +1295,8 @@ class PyBuildExt(build_ext): + panel_library = 'panel' + if curses_library == 'ncursesw': + curses_defines.append(('HAVE_NCURSESW', '1')) +- curses_includes.append('/usr/include/ncursesw') ++ if not cross_compiling: ++ curses_includes.append('/usr/include/ncursesw') + # Bug 1464056: If _curses.so links with ncursesw, + # _curses_panel.so must link with panelw. + panel_library = 'panelw' diff --git a/patches/Python-3.5.0/0002-use-shipped-sources.patch b/patches/Python-3.5.0/0002-use-shipped-sources.patch new file mode 100644 index 000000000..710f79f6c --- /dev/null +++ b/patches/Python-3.5.0/0002-use-shipped-sources.patch @@ -0,0 +1,40 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Tue, 15 Sep 2015 12:27:00 +0200 +Subject: [PATCH] use shipped sources + +Only depend on generator tools existence. This way shipped sources are used +and no extra host tools are needed. This is especially useful when +cross-compiling because the tools are built for the target architecture. + +Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> +--- + Makefile.pre.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index ce2c0aa29006..4779227a7845 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -696,11 +696,11 @@ 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) + +-Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib ++Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py | Programs/_freeze_importlib + ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h + +-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib ++Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py | Programs/_freeze_importlib + ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h + +@@ -762,7 +762,7 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile + + $(IO_OBJS): $(IO_H) + +-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) ++$(GRAMMAR_H): $(GRAMMAR_INPUT) | $(PGEN) + @$(MKDIR_P) Include + $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + $(GRAMMAR_C): $(GRAMMAR_H) diff --git a/patches/Python-3.4.2/series b/patches/Python-3.5.0/series index 7f3b3d069..84288eec6 100644 --- a/patches/Python-3.4.2/series +++ b/patches/Python-3.5.0/series @@ -1,4 +1,5 @@ # generated by git-ptx-patches #tag:base --start-number 1 0001-python3-don-t-leak-host-path-into-cross-compilation.patch -# 3a85778f36c3116f07c55efca7ccb1a7 - git-ptx-patches magic +0002-use-shipped-sources.patch +# e50e954c62b1c19860534e34350c9138 - git-ptx-patches magic diff --git a/rules/host-python3.make b/rules/host-python3.make index 6a3beda8e..76cc84cc9 100644 --- a/rules/host-python3.make +++ b/rules/host-python3.make @@ -17,7 +17,7 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3) += host-python3 # # Paths and names # -HOST_PYTHON3_DIR = $(HOST_BUILDDIR)/$(PYTHON3) +HOST_PYTHON3_DIR = $(HOST_BUILDDIR)/$(PYTHON3) HOSTPYTHON3 = $(PTXCONF_SYSROOT_HOST)/bin/python$(PYTHON3_MAJORMINOR) @@ -25,7 +25,6 @@ HOSTPYTHON3 = $(PTXCONF_SYSROOT_HOST)/bin/python$(PYTHON3_MAJORMINOR) # Prepare # ---------------------------------------------------------------------------- -HOST_PYTHON3_PATH := PATH=$(HOST_PATH) HOST_PYTHON3_ENV := \ $(HOST_ENV) \ ac_sys_system=Linux \ @@ -35,7 +34,8 @@ HOST_PYTHON3_ENV := \ # # autoconf # -HOST_PYTHON3_AUTOCONF := \ +HOST_PYTHON3_CONF_TOOL := autoconf +HOST_PYTHON3_CONF_OPT := \ $(HOST_AUTOCONF) \ --enable-shared \ --with-pymalloc \ diff --git a/rules/python3.in b/rules/python3.in index b8bde8298..33f5c5a7b 100644 --- a/rules/python3.in +++ b/rules/python3.in @@ -2,18 +2,25 @@ menuconfig PYTHON3 tristate "python3 " + select HOST_PYTHON3 select LIBC_DL + select LIBC_CRYPT + select LIBC_M + select LIBC_NSL select LIBC_UTIL select LIBC_PTHREAD - select HOST_PYTHON3 select GCCLIBS_CXX + select EXPAT + select LIBFFI select NCURSES if PYTHON3_NCURSES select SQLITE if PYTHON3_SQLITE select BZIP2 if PYTHON3_BZ2 select BZIP2_LIBBZ2 if PYTHON3_BZ2 + select XZ if PYTHON3_LZMA select ZLIB if PYTHON3_ZLIB select READLINE if PYTHON3_READLINE select DB if PYTHON3_DB + select OPENSSL if PYTHON3_SSL help Python is a dynamic object-oriented programming language that can be used for many kinds of @@ -33,6 +40,9 @@ config PYTHON3_SQLITE config PYTHON3_BZ2 bool "libbz2 bindings" +config PYTHON3_LZMA + bool "lzma bindings" + config PYTHON3_ZLIB bool "zlib bindings" @@ -42,6 +52,9 @@ config PYTHON3_READLINE config PYTHON3_DB bool "db bindings" +config PYTHON3_SSL + bool "ssl bindings" + config PYTHON3_SYMLINK bool prompt "install symbolic link /usr/bin/python" @@ -49,7 +62,7 @@ config PYTHON3_SYMLINK config PYTHON3_LIBTK bool - prompt "Include lib-tk packages" + prompt "Include TK packages" config PYTHON3_IDLELIB bool diff --git a/rules/python3.make b/rules/python3.make index 27c638cd7..1eefbc4f7 100644 --- a/rules/python3.make +++ b/rules/python3.make @@ -17,12 +17,12 @@ PACKAGES-$(PTXCONF_PYTHON3) += python3 # # Paths and names # -PYTHON3_VERSION := 3.4.2 -PYTHON3_MD5 := 5566bc7e1fdf6bed45f9a750d5f80fc2 +PYTHON3_VERSION := 3.5.0 +PYTHON3_MD5 := d149d2812f10cbe04c042232e7964171 PYTHON3_MAJORMINOR := $(basename $(PYTHON3_VERSION)) PYTHON3_SITEPACKAGES := /usr/lib/python$(PYTHON3_MAJORMINOR)/site-packages PYTHON3 := Python-$(PYTHON3_VERSION) -PYTHON3_SUFFIX := tgz +PYTHON3_SUFFIX := tar.xz PYTHON3_SOURCE := $(SRCDIR)/$(PYTHON3).$(PYTHON3_SUFFIX) PYTHON3_DIR := $(BUILDDIR)/$(PYTHON3) @@ -36,8 +36,8 @@ CROSS_PYTHON3 := $(PTXCONF_SYSROOT_CROSS)/bin/python$(PYTHON3_MAJORMINOR) # Prepare # ---------------------------------------------------------------------------- -PYTHON3_PATH := PATH=$(HOST_PATH) -PYTHON3_ENV := \ +# Note: the LDFLAGS are used by Python scripts +PYTHON3_ENV := \ $(CROSS_ENV) \ ac_sys_system=Linux \ ac_sys_release=2 \ @@ -52,24 +52,27 @@ PYTHON3_ENV := \ LDFLAGS="-L $(PTXDIST_SYSROOT_TARGET)/lib/ \ -L $(PTXDIST_SYSROOT_TARGET)/usr/lib/" + PYTHON3_BINCONFIG_GLOB := "" # # autoconf # -PYTHON3_AUTOCONF := \ +PYTHON3_CONF_TOOL := autoconf +PYTHON3_CONF_OPT := \ $(CROSS_AUTOCONF_USR) \ $(GLOBAL_IPV6_OPTION) \ --enable-shared \ - --with-pymalloc \ + --with-system-expat \ + --with-system-ffi \ --with-signal-module \ - --with-threads \ + --with-threads=pthread \ --without-doc-strings \ + --without-tsc \ + --with-pymalloc \ + --without-valgrind \ --without-ensurepip -PYTHON3_MAKEVARS := \ - PGEN_FOR_BUILD=$(PTXCONF_SYSROOT_HOST)/bin/pgen - # ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- @@ -77,11 +80,14 @@ PYTHON3_MAKEVARS := \ $(STATEDIR)/python3.install: @$(call targetinfo) - # Remove unimportant libfiles that produce errors when compiled - @rm -vrf $(BUILDDIR)/Python-$(PYTHON3_VERSION)/Lib/lib2to3 - @rm -vrf $(BUILDDIR)/Python-$(PYTHON3_VERSION)/Lib/test +# # remove unneeded stuff + @find $(PYTHON3_DIR) \( -name test -o -name tests \) -print0 | xargs -0 rm -vrf @$(call install, PYTHON3) + + @rm -vrf $(PYTHON3_PKGDIR)/usr/lib/python$(PYTHON3_MAJORMINOR)/config-$(PYTHON3_MAJORMINOR)m + @$(call world/env, PYTHON3) ptxd_make_world_install_python_cleanup + @$(call touch) PYTHON3_PLATFORM := $(call remove_quotes,$(PTXCONF_ARCH_STRING)) @@ -103,21 +109,28 @@ $(STATEDIR)/python3.install.post: @ln -sf "python$(PYTHON3_MAJORMINOR)" \ "$(PTXCONF_SYSROOT_CROSS)/bin/python3" - # Byte compile all libraries - @$(HOSTPYTHON3) -m compileall -b -q $(PYTHON3_PKGDIR)/usr/lib/python$(PYTHON3_MAJORMINOR) @$(call touch) # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- -PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_LIBTK) += lib-tk +# These cannot be disabled during build, so just don't install the disabled modules +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_NCURSES) += curses _curses*.so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_SQLITE) += sqlite3 +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_BZ2) += bz2.pyc _bz2*.so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_LZMA) += lzma.pyc _lzma*.so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_ZLIB) += gzip.pyc zlib*so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_READLINE) += readline*so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_DB) += dbm _dbm*so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_SSL) += ssl.pyc _ssl*.so +PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_LIBTK) += tkinter PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_IDLELIB) += idlelib PYTHON3_SKIP-$(call ptx/opt-dis, PTXCONF_PYTHON3_DISTUTILS) += distutils ifneq ($(PYTHON3_SKIP-y),) -PYTHON3_SKIP_LIST_PRE :=-a \! -wholename $(quote)*/ -PYTHON3_SKIP_LIST_POST :=/*$(quote) +PYTHON3_SKIP_LIST_PRE :=-o -name $(quote) +PYTHON3_SKIP_LIST_POST :=$(quote) PYTHON3_SKIP_LIST := $(subst $(space),$(PYTHON3_SKIP_LIST_POST) $(PYTHON3_SKIP_LIST_PRE),$(PYTHON3_SKIP-y)) PYTHON3_SKIP_LIST := $(PYTHON3_SKIP_LIST_PRE)$(PYTHON3_SKIP_LIST)$(PYTHON3_SKIP_LIST_POST) @@ -135,9 +148,9 @@ $(STATEDIR)/python3.targetinstall: @cd $(PYTHON3_PKGDIR) && \ find ./usr/lib/python$(PYTHON3_MAJORMINOR) \ - \! -wholename "*/test/*" -a \! -wholename "*/tests/*" \ - $(PYTHON3_SKIP_LIST) \ - -a \( -name "*.so" -o -name "*.pyc" \) | \ + \( -name test -o -name tests -o -name __pycache__ \ + $(PYTHON3_SKIP_LIST) \) -prune \ + -o -name "*.so" -print -o -name "*.pyc" -print | \ while read file; do \ $(call install_copy, python3, 0, 0, 644, -, $${file##.}); \ done |