From c545a27f7090480b2afd9a096bf1b41b136e8e6e Mon Sep 17 00:00:00 2001 From: shimoda Date: Sat, 21 Jan 2017 12:16:11 +0900 Subject: [PATCH] 1st relase of Python 3.6.0 #105 - module readline and ncurses not worked by build problems (?). - module bzip2 not worked by packaging problemns (?). --- python3-alpha/LATEST_VERSION | 2 +- python3-alpha/LATEST_VERSION_EXTRA | 2 +- python3-alpha/LATEST_VERSION_SCRIPTS | 2 +- python3-alpha/Makefile | 12 ++--- .../patches/python-3.4.2-cross-compile.patch | 11 ----- .../python-3.6.0-python-Makefile.pre.in.patch | 42 ++++++++++++++-- .../patches/python-3.6.0-python-setup.patch | 48 ++++++++++--------- 7 files changed, 71 insertions(+), 48 deletions(-) delete mode 100644 python3-alpha/patches/python-3.4.2-cross-compile.patch diff --git a/python3-alpha/LATEST_VERSION b/python3-alpha/LATEST_VERSION index 3f5cf925..ad2f1825 100644 --- a/python3-alpha/LATEST_VERSION +++ b/python3-alpha/LATEST_VERSION @@ -1 +1 @@ -r23 +r30 diff --git a/python3-alpha/LATEST_VERSION_EXTRA b/python3-alpha/LATEST_VERSION_EXTRA index 3f5cf925..ad2f1825 100644 --- a/python3-alpha/LATEST_VERSION_EXTRA +++ b/python3-alpha/LATEST_VERSION_EXTRA @@ -1 +1 @@ -r23 +r30 diff --git a/python3-alpha/LATEST_VERSION_SCRIPTS b/python3-alpha/LATEST_VERSION_SCRIPTS index 6f32b25e..ad2f1825 100644 --- a/python3-alpha/LATEST_VERSION_SCRIPTS +++ b/python3-alpha/LATEST_VERSION_SCRIPTS @@ -1 +1 @@ -r22 +r30 diff --git a/python3-alpha/Makefile b/python3-alpha/Makefile index c2057d3f..bf56a50d 100644 --- a/python3-alpha/Makefile +++ b/python3-alpha/Makefile @@ -91,6 +91,8 @@ ifeq (x$(CROSS),xx86) ZIPMAIN := $(ZIP_BINx86) endif +export _PYTHON_PROJECT_BASE := $(abspath $(PYTHONSRC)) + # build settings section 2 {{{1 ANDROID_NDK_ROOT := $(NDK_PATH) ANDROID_SYSROOT = $(NDK_PATH)/platforms/$(ANDROID_API)/$(_ANDROID_ARCH) @@ -349,7 +351,7 @@ build_zip: .build_strip rm -f $(ZIPMAIN) cd $(PYBIN)/..; zip -g ../$(ZIPMAIN) $(PYBINR)/bin/python3; \ zip -g ../$(ZIPMAIN) $(PYBINR)/lib/libpython3.so; \ - zip -g ../$(ZIPMAIN) $(PYBINR)/lib/libpython$(VER_MAJ)m.so + zip -g ../$(ZIPMAIN) $(PYBINR)/lib/libpython$(VER_MAJ)m.so.1.0 cd $(PYBIN)/..; echo $(ndk_depends) $(PYBINR)/bin/python3 cd $(PYBIN)/..; deps="libssl.so.1.0.0 libcrypto.so.1.0.0"; \ for i in $$deps; do \ @@ -378,11 +380,7 @@ $(ZIPEXTRA): $(ZIPMAIN) .build_host cp -r $(CWD)/$(PYBINR)_arm/$(PYBINR)/lib/$(PYTHONLIB)/* $(PYEXT) cp -r python-libs/* $(PYEXT)/site-packages rm -rf $(PYEXT)/site-packages/ase # ignore ase - $(PYTHON_FOR_BUILD) -OO -m compileall -qf -x'tests*/.*' $(PYEXT) || echo - # FIXME: complex shell script: change __cache__/.pyo to .pyc - find $(PYEXT) -name *.pyo -exec sh -c \ - 'cp $$0 $$(echo $$0 | sed "s/\/__pycache__//" | \ - sed s/.cpython-$(VER_MAJ_NODOT).pyo/.pyc/)' {} \; + $(PYTHON_FOR_BUILD) -OO -m compileall -qfb -x'tests*/.*' $(PYEXT) cd $(PYEXT_); \ zip -Dqgrx"*.so" -x"test/*" -x"*/test/*" -x"*/tests/*" \ @@ -390,8 +388,6 @@ $(ZIPEXTRA): $(ZIPMAIN) .build_host -x"*/ensurepip/*" \ -x"*.pyo" -x"*.py" -x"*/__pycache__/*" \ -x"*.so*" -x"*.exe" -x"*.a" $(CWD)/$@ * - # zip -d $@ "*.pc" "*pkgconfig*" "*/libpython$(VER_MAJ)m.a" \ - # "*.a" "bin/*" "*.la" $(ZIPSCRIPTS): echo "Packing $(ZIPSCRIPTS)" diff --git a/python3-alpha/patches/python-3.4.2-cross-compile.patch b/python3-alpha/patches/python-3.4.2-cross-compile.patch deleted file mode 100644 index efc07d10..00000000 --- a/python3-alpha/patches/python-3.4.2-cross-compile.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ru Python-3.3.5/Makefile.pre.in Python-3.3.5-android/Makefile.pre.in ---- Python-3.3.5/Makefile.pre.in 2014-03-09 09:40:23.000000000 +0100 -+++ Python-3.3.5-android/Makefile.pre.in 2014-08-04 22:13:00.000000000 +0200 -@@ -1243,6 +1243,7 @@ - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -+ CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \ - $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ diff --git a/python3-alpha/patches/python-3.6.0-python-Makefile.pre.in.patch b/python3-alpha/patches/python-3.6.0-python-Makefile.pre.in.patch index d917df28..69c15cd9 100644 --- a/python3-alpha/patches/python-3.6.0-python-Makefile.pre.in.patch +++ b/python3-alpha/patches/python-3.6.0-python-Makefile.pre.in.patch @@ -1,6 +1,15 @@ -diff -ru python-src_arm/Makefile.pre.in.orig python-src_arm/Makefile.pre.in ---- python-src_arm/Makefile.pre.in.orig 2017-01-10 03:35:50.729625699 +0900 -+++ python-src_arm/Makefile.pre.in 2017-01-10 17:14:22.379438976 +0900 +diff -ur host-src/Makefile.pre.in python-src_arm/Makefile.pre.in +--- host-src/Makefile.pre.in 2016-12-23 11:21:21.000000000 +0900 ++++ python-src_arm/Makefile.pre.in 2017-01-20 07:29:33.327508353 +0900 +@@ -142,7 +142,7 @@ + + # Symbols used for using shared libraries + SHLIB_SUFFIX= @SHLIB_SUFFIX@ +-EXT_SUFFIX= @EXT_SUFFIX@ ++export EXT_SUFFIX=@EXT_SUFFIX@ + LDSHARED= @LDSHARED@ $(PY_LDFLAGS) + BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) + LDCXXSHARED= @LDCXXSHARED@ @@ -229,9 +229,9 @@ PYTHON_FOR_GEN=@PYTHON_FOR_GEN@ @@ -13,3 +22,30 @@ diff -ru python-src_arm/Makefile.pre.in.orig python-src_arm/Makefile.pre.in # Tcl and Tk config info from --with-tcltk-includes and -libs options TCLTK_INCLUDES= @TCLTK_INCLUDES@ +@@ -250,6 +250,8 @@ + + # === Definitions added by makesetup === + ++export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) ++ + + ########################################################################## + # Modules +@@ -585,6 +587,9 @@ + rm -f ./pybuilddir.txt ; \ + exit 1 ; \ + fi ++ cp `cat pybuilddir.txt`/$(_PYTHON_SYSCONFIGDATA_NAME).py \ ++ $(abspath $(PYTHON_FOR_BUILD)/../..)/lib/python$(VERSION)/ ++ cd ..; patch -p0 < patches/_sysconfigdata-$(_PYTHON_HOST_PLATFORM).patch + + # This is shared by the math and cmath modules + Modules/_math.o: Modules/_math.c Modules/_math.h +@@ -1431,6 +1436,7 @@ + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods ++ CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ diff --git a/python3-alpha/patches/python-3.6.0-python-setup.patch b/python3-alpha/patches/python-3.6.0-python-setup.patch index 201b2fef..c93ed5dc 100644 --- a/python3-alpha/patches/python-3.6.0-python-setup.patch +++ b/python3-alpha/patches/python-3.6.0-python-setup.patch @@ -1,7 +1,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py --- host-src/setup.py 2016-12-23 11:21:22.000000000 +0900 -+++ python-src_arm/setup.py 2017-01-13 08:11:01.077979638 +0900 -@@ -18,11 +18,35 @@ ++++ python-src_arm/setup.py 2017-01-20 02:39:24.242570580 +0900 +@@ -18,11 +18,37 @@ cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ @@ -16,6 +16,8 @@ diff -ur host-src/setup.py python-src_arm/setup.py + + for override in (('CC', ), + ('HOST_GNU_TYPE', ), ++ ('EXT_SUFFIX', ), ++ ('SO', os.environ["EXT_SUFFIX"]), + ('srcdir', + os.path.dirname(sysconfig.get_config_h_filename())), + ): @@ -38,7 +40,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py class Dummy: """Hack for parallel build""" -@@ -600,63 +624,66 @@ +@@ -600,63 +626,66 @@ # # array objects @@ -128,7 +130,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py # Modules with some UNIX dependencies -- on by default: # (If you have a really backward UNIX, select and socket may not be -@@ -667,30 +694,33 @@ +@@ -667,30 +696,33 @@ if (config_h_vars.get('FLOCK_NEEDS_LIBBSD', False)): # May be necessary on AIX for flock function libs = ['bsd'] @@ -170,7 +172,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py # # Here ends the simple stuff. From here on, modules need certain -@@ -706,7 +736,7 @@ +@@ -706,7 +738,7 @@ # 64-bit platforms. # # audioop needs math_libs for floor() in multiple functions. @@ -179,7 +181,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py libraries=math_libs) ) # readline -@@ -785,7 +815,7 @@ +@@ -785,7 +817,7 @@ ['/usr/lib/termcap'], 'termcap'): readline_libs.append('termcap') @@ -188,7 +190,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py library_dirs=['/usr/lib/termcap'], extra_link_args=readline_extra_link_args, libraries=readline_libs) ) -@@ -798,17 +828,19 @@ +@@ -798,17 +830,19 @@ libs = ['crypt'] else: libs = [] @@ -213,7 +215,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ '/usr/local/ssl/include', -@@ -869,8 +901,8 @@ +@@ -869,8 +903,8 @@ if have_usable_openssl: # The _hashlib module wraps optimized implementations # of hash functions from the OpenSSL library. @@ -224,7 +226,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py include_dirs = ssl_incs, library_dirs = ssl_libs, libraries = ['ssl', 'crypto']) ) -@@ -882,14 +914,14 @@ +@@ -882,14 +916,14 @@ # We always compile these even when OpenSSL is available (issue #14693). # It's harmless and the object code is tiny (40-50 KB per module, # only loaded when actually used). @@ -247,7 +249,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py blake2_deps = glob(os.path.join(os.getcwd(), srcdir, 'Modules/_blake2/impl/*')) -@@ -901,9 +933,9 @@ +@@ -901,9 +935,9 @@ blake2_macros.append(('BLAKE2_USE_SSE', '1')) exts.append( Extension('_blake2', @@ -260,7 +262,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py define_macros=blake2_macros, depends=blake2_deps) ) -@@ -911,7 +943,7 @@ +@@ -911,7 +945,7 @@ 'Modules/_sha3/kcp/*')) sha3_deps.append('hashlib.h') exts.append( Extension('_sha3', @@ -269,7 +271,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py depends=sha3_deps)) # Modules that provide persistent dictionary-like semantics. You will -@@ -1324,9 +1356,9 @@ +@@ -1324,9 +1358,9 @@ # Unix-only modules if host_platform != 'win32': # Steen Lumholt's termios module @@ -281,7 +283,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py # Sun yellow pages. Some systems have the functions in libc. if (host_platform not in ['cygwin', 'qnx6'] and -@@ -1410,7 +1442,10 @@ +@@ -1410,7 +1444,10 @@ # # You can upgrade zlib to version 1.1.4 yourself by going to # http://www.gzip.org/zlib/ @@ -293,7 +295,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py have_zlib = False if zlib_inc is not None: zlib_h = zlib_inc[0] + '/zlib.h' -@@ -1427,12 +1462,12 @@ +@@ -1427,12 +1464,12 @@ version = line.split()[2] break if version >= version_req: @@ -308,7 +310,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py libraries = ['z'], extra_link_args = zlib_extra_link_args)) have_zlib = True -@@ -1453,7 +1488,7 @@ +@@ -1453,7 +1490,7 @@ extra_compile_args = [] libraries = [] extra_link_args = [] @@ -317,7 +319,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py extra_compile_args = extra_compile_args, libraries = libraries, extra_link_args = extra_link_args) ) -@@ -1495,32 +1530,33 @@ +@@ -1495,32 +1532,33 @@ expat_sources = [] expat_depends = [] else: @@ -367,7 +369,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py depends = expat_depends, )) -@@ -1542,10 +1578,10 @@ +@@ -1542,10 +1580,10 @@ # Hye-Shik Chang's CJKCodecs modules. exts.append(Extension('_multibytecodec', @@ -380,7 +382,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py # Stefan Krah's _decimal module exts.append(self._decimal_ext()) -@@ -1590,11 +1626,11 @@ +@@ -1590,11 +1628,11 @@ ] else: @@ -394,7 +396,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py if sysconfig.get_config_var('WITH_THREAD'): exts.append ( Extension('_multiprocessing', multiprocessing_srcs, -@@ -1606,7 +1642,7 @@ +@@ -1606,7 +1644,7 @@ # Platform-specific libraries if host_platform.startswith(('linux', 'freebsd', 'gnukfreebsd')): @@ -403,7 +405,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py else: missing.append('ossaudiodev') -@@ -1631,7 +1667,7 @@ +@@ -1631,7 +1669,7 @@ ## self.extensions.append(ext) if 'd' not in sys.abiflags: @@ -412,7 +414,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py define_macros=[('Py_LIMITED_API', '0x03050000')]) self.extensions.append(ext) -@@ -2008,7 +2044,7 @@ +@@ -2008,7 +2046,7 @@ depends=depends) # function my_sqrt() needs math library for sqrt() ext_test = Extension('_ctypes_test', @@ -421,7 +423,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py libraries=math_libs) self.extensions.extend([ext, ext_test]) -@@ -2064,40 +2100,40 @@ +@@ -2064,40 +2102,40 @@ 'libmpdec'))] libraries = [] sources = [ @@ -494,7 +496,7 @@ diff -ur host-src/setup.py python-src_arm/setup.py ] config = { -@@ -2293,7 +2329,7 @@ +@@ -2293,7 +2331,7 @@ 'install_lib': PyBuildInstallLib}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined.