diff options
| author | aTanW <villy@sft.ru> | 2015-06-28 17:58:00 +0300 |
|---|---|---|
| committer | aTanW <villy@sft.ru> | 2015-06-28 17:58:00 +0300 |
| commit | f60ca0b30f92dea792e776db08d7f109c172be58 (patch) | |
| tree | 5e200b2eb9bbd074e79d68014339dc823ac2db56 /lang/python | |
| parent | 2564e407d26d45ecc68befa7a3d1786dbb5982b5 (diff) | |
| parent | 9d423ba553041b5d45918b6ebd8677e43990cb88 (diff) | |
Merge https://github.com/openwrt/packages
Conflicts:
net/ipsec-tools/Makefile
Diffstat (limited to 'lang/python')
30 files changed, 512 insertions, 85 deletions
diff --git a/lang/python/Makefile b/lang/python/Makefile index bb4252292..133bab0d9 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2014 OpenWrt.org +# Copyright (C) 2006-2015 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -12,11 +12,11 @@ include ./files/python-package.mk PKG_NAME:=python PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO) -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION) -PKG_MD5SUM:=38d530f7efc373d64a8fb1637e3baaa7 +PKG_MD5SUM:=c685ef0b8e9f27b5e3db5db12b268ac6 PKG_LICENSE:=PSF PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE @@ -54,7 +54,7 @@ endef define Package/python-base $(call Package/python/Default) TITLE:=Python $(PYTHON_VERSION) interpreter - DEPENDS:=+libpthread +zlib +libffi +libopenssl + DEPENDS:=+libpthread +zlib endef define Package/python-base/description @@ -62,13 +62,44 @@ define Package/python-base/description for the interpreter to start. endef +define Package/python-light +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) light installation + DEPENDS:=+python-base +libffi +libbz2 +endef + +define Package/python-light/description + This package is essentially the python-base package plus + a few of the rarely used (and big) libraries stripped out + into separate packages. +endef + +# Define newline here, since it's not defined in OpenWRT +define newline + + +endef + +PYTHON_LIB_FILES_DEL:= +PYTHON_PACKAGES:= +define PyBasePackage + PYTHON_PACKAGES+=$(1) + PYTHON_LIB_FILES_DEL+=$(2) + define PyPackage/$(1)/filespec + $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file))) + endef +endef + +include ./files/python-package-*.mk + define Package/python $(call Package/python/Default) - DEPENDS:=+python-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libexpat +libdb47 + DEPENDS:=+python-light $(foreach package,$(PYTHON_PACKAGES),+$(package)) endef define Package/python/description This package contains the (almost) full Python install. + It's python-light + all other packages. endef MAKE_FLAGS+=\ @@ -124,31 +155,36 @@ define Build/InstallDev $(1)/usr/lib/python$(PYTHON_VERSION)/ endef +PYTHON_BASE_LIB_FILES:= \ + /usr/lib/python$(PYTHON_VERSION)/_abcoll.py \ + /usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \ + /usr/lib/python$(PYTHON_VERSION)/_weakrefset.py \ + /usr/lib/python$(PYTHON_VERSION)/abc.py \ + /usr/lib/python$(PYTHON_VERSION)/copy_reg.py \ + /usr/lib/python$(PYTHON_VERSION)/genericpath.py \ + /usr/lib/python$(PYTHON_VERSION)/linecache.py \ + /usr/lib/python$(PYTHON_VERSION)/posixpath.py \ + /usr/lib/python$(PYTHON_VERSION)/os.py \ + /usr/lib/python$(PYTHON_VERSION)/re.py \ + /usr/lib/python$(PYTHON_VERSION)/site.py \ + /usr/lib/python$(PYTHON_VERSION)/sre_compile.py \ + /usr/lib/python$(PYTHON_VERSION)/sre_constants.py \ + /usr/lib/python$(PYTHON_VERSION)/sre_parse.py \ + /usr/lib/python$(PYTHON_VERSION)/sysconfig.py \ + /usr/lib/python$(PYTHON_VERSION)/stat.py \ + /usr/lib/python$(PYTHON_VERSION)/traceback.py \ + /usr/lib/python$(PYTHON_VERSION)/types.py \ + /usr/lib/python$(PYTHON_VERSION)/UserDict.py \ + /usr/lib/python$(PYTHON_VERSION)/warnings.py + +PYTHON_LIB_FILES_DEL+=$(PYTHON_BASE_LIB_FILES) + define PyPackage/python-base/filespec +|/usr/bin/python$(PYTHON_VERSION) -+|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py -+|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py -+|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py -+|/usr/lib/python$(PYTHON_VERSION)/abc.py -+|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py -+|/usr/lib/python$(PYTHON_VERSION)/genericpath.py -+|/usr/lib/python$(PYTHON_VERSION)/linecache.py -+|/usr/lib/python$(PYTHON_VERSION)/posixpath.py -+|/usr/lib/python$(PYTHON_VERSION)/os.py -+|/usr/lib/python$(PYTHON_VERSION)/re.py -+|/usr/lib/python$(PYTHON_VERSION)/site.py -+|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py -+|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py -+|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py -+|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py -+|/usr/lib/python$(PYTHON_VERSION)/stat.py -+|/usr/lib/python$(PYTHON_VERSION)/traceback.py -+|/usr/lib/python$(PYTHON_VERSION)/types.py -+|/usr/lib/python$(PYTHON_VERSION)/UserDict.py -+|/usr/lib/python$(PYTHON_VERSION)/warnings.py +$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON_BASE_LIB_FILES),+|$(lib_file))) endef -define PyPackage/python/filespec +define PyPackage/python-light/filespec +|/usr/lib/python$(PYTHON_VERSION) -|/usr/lib/python$(PYTHON_VERSION)/config -|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py @@ -164,26 +200,7 @@ define PyPackage/python/filespec -|/usr/lib/python$(PYTHON_VERSION)/*/test -|/usr/lib/python$(PYTHON_VERSION)/*/tests -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so --|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py --|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py --|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py --|/usr/lib/python$(PYTHON_VERSION)/abc.py --|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py --|/usr/lib/python$(PYTHON_VERSION)/genericpath.py --|/usr/lib/python$(PYTHON_VERSION)/linecache.py --|/usr/lib/python$(PYTHON_VERSION)/posixpath.py --|/usr/lib/python$(PYTHON_VERSION)/os.py --|/usr/lib/python$(PYTHON_VERSION)/re.py --|/usr/lib/python$(PYTHON_VERSION)/site.py --|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py --|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py --|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py --|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py --|/usr/lib/python$(PYTHON_VERSION)/stat.py --|/usr/lib/python$(PYTHON_VERSION)/traceback.py --|/usr/lib/python$(PYTHON_VERSION)/types.py --|/usr/lib/python$(PYTHON_VERSION)/UserDict.py --|/usr/lib/python$(PYTHON_VERSION)/warnings.py +$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON_LIB_FILES_DEL),-|$(lib_file))) endef define PyPackage/python-base/install @@ -192,6 +209,10 @@ define PyPackage/python-base/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/ endef +define PyPackage/python/filespec +-|$(PYTHON_PKG_DIR) +endef + HOST_CFLAGS+= \ -I/usr/include/ncursesw \ -I/usr/include/ncurses @@ -213,8 +234,15 @@ endef $(eval $(call HostBuild)) +$(foreach package, $(PYTHON_PACKAGES), \ + $(eval $(call PyPackage,$(package))) \ + $(eval $(call BuildPackage,$(package))) \ +) + $(eval $(call PyPackage,python-base)) +$(eval $(call PyPackage,python-light)) $(eval $(call PyPackage,python)) $(eval $(call BuildPackage,python-base)) +$(eval $(call BuildPackage,python-light)) $(eval $(call BuildPackage,python)) diff --git a/lang/python/files/python-package-codecs.mk b/lang/python/files/python-package-codecs.mk new file mode 100644 index 000000000..d6e183500 --- /dev/null +++ b/lang/python/files/python-package-codecs.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-codecs +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) codecs + unicode support + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-codecs, \ + /usr/lib/python$(PYTHON_VERSION)/encodings \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_cn.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_hk.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_iso2022.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_jp.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_kr.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_tw.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so \ +)) diff --git a/lang/python/files/python-package-compiler.mk b/lang/python/files/python-package-compiler.mk new file mode 100644 index 000000000..fbe8bf2e6 --- /dev/null +++ b/lang/python/files/python-package-compiler.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-compiler +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) compiler module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-compiler, \ + /usr/lib/python$(PYTHON_VERSION)/compiler \ +)) diff --git a/lang/python/files/python-package-ctypes.mk b/lang/python/files/python-package-ctypes.mk new file mode 100644 index 000000000..66b303310 --- /dev/null +++ b/lang/python/files/python-package-ctypes.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-ctypes +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) ctypes module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-ctypes, \ + /usr/lib/python$(PYTHON_VERSION)/ctypes \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so \ +)) diff --git a/lang/python/files/python-package-db.mk b/lang/python/files/python-package-db.mk new file mode 100644 index 000000000..26f35d882 --- /dev/null +++ b/lang/python/files/python-package-db.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-db +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) db module + DEPENDS:=+python-light +libdb47 +endef + +$(eval $(call PyBasePackage,python-db, \ + /usr/lib/python$(PYTHON_VERSION)/bsddb \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so \ +)) diff --git a/lang/python/files/python-package-decimal.mk b/lang/python/files/python-package-decimal.mk new file mode 100644 index 000000000..33e3a21d2 --- /dev/null +++ b/lang/python/files/python-package-decimal.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-decimal +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) decimal module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-decimal, \ + /usr/lib/python$(PYTHON_VERSION)/decimal.py \ +)) diff --git a/lang/python/files/python-package-distutils.mk b/lang/python/files/python-package-distutils.mk new file mode 100644 index 000000000..f5119fac3 --- /dev/null +++ b/lang/python/files/python-package-distutils.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-distutils +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) distutils + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-distutils, \ + /usr/lib/python$(PYTHON_VERSION)/distutils \ +)) diff --git a/lang/python/files/python-package-email.mk b/lang/python/files/python-package-email.mk new file mode 100644 index 000000000..51fa8d12a --- /dev/null +++ b/lang/python/files/python-package-email.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-email +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) email module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-email, \ + /usr/lib/python$(PYTHON_VERSION)/email \ +)) diff --git a/lang/python/files/python-package-gdbm.mk b/lang/python/files/python-package-gdbm.mk new file mode 100644 index 000000000..8e0b16f9c --- /dev/null +++ b/lang/python/files/python-package-gdbm.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-gdbm +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) gdbm module + DEPENDS:=+python-light +libgdbm +endef + +$(eval $(call PyBasePackage,python-gdbm, \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so \ +)) diff --git a/lang/python/files/python-package-logging.mk b/lang/python/files/python-package-logging.mk new file mode 100644 index 000000000..f45de35dc --- /dev/null +++ b/lang/python/files/python-package-logging.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-logging +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) logging module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-logging, \ + /usr/lib/python$(PYTHON_VERSION)/logging \ +)) diff --git a/lang/python/files/python-package-multiprocessing.mk b/lang/python/files/python-package-multiprocessing.mk new file mode 100644 index 000000000..2a9f5b185 --- /dev/null +++ b/lang/python/files/python-package-multiprocessing.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-multiprocessing +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) multiprocessing + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-multiprocessing, \ + /usr/lib/python$(PYTHON_VERSION)/multiprocessing \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_multiprocessing.so \ +)) diff --git a/lang/python/files/python-package-ncurses.mk b/lang/python/files/python-package-ncurses.mk new file mode 100644 index 000000000..bab941559 --- /dev/null +++ b/lang/python/files/python-package-ncurses.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-ncurses +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) ncurses module + DEPENDS:=+python-light +libncurses +endef + +$(eval $(call PyBasePackage,python-ncurses, \ + /usr/lib/python$(PYTHON_VERSION)/curses \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so \ +)) diff --git a/lang/python/files/python-package-openssl.mk b/lang/python/files/python-package-openssl.mk new file mode 100644 index 000000000..4d897eb81 --- /dev/null +++ b/lang/python/files/python-package-openssl.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-openssl +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) SSL module + DEPENDS:=+python-light +libopenssl +endef + +$(eval $(call PyBasePackage,python-openssl, \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_hashlib.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so \ +)) diff --git a/lang/python/files/python-package-pydoc.mk b/lang/python/files/python-package-pydoc.mk new file mode 100644 index 000000000..ca27f9b36 --- /dev/null +++ b/lang/python/files/python-package-pydoc.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-pydoc +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) pydoc module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-pydoc, \ + /usr/lib/python$(PYTHON_VERSION)/doctest.py \ + /usr/lib/python$(PYTHON_VERSION)/pydoc.py \ + /usr/lib/python$(PYTHON_VERSION)/pydoc_data \ +)) diff --git a/lang/python/files/python-package-sqlite3.mk b/lang/python/files/python-package-sqlite3.mk new file mode 100644 index 000000000..c5abb122e --- /dev/null +++ b/lang/python/files/python-package-sqlite3.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-sqlite3 +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) sqlite3 module + DEPENDS:=+python-light +libsqlite3 +endef + +$(eval $(call PyBasePackage,python-sqlite3, \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so \ + /usr/lib/python$(PYTHON_VERSION)/sqlite3 \ +)) diff --git a/lang/python/files/python-package-unittest.mk b/lang/python/files/python-package-unittest.mk new file mode 100644 index 000000000..6e1ab552d --- /dev/null +++ b/lang/python/files/python-package-unittest.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-unittest +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) unittest module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-unittest, \ + /usr/lib/python$(PYTHON_VERSION)/unittest \ +)) diff --git a/lang/python/files/python-package-xml.mk b/lang/python/files/python-package-xml.mk new file mode 100644 index 000000000..69074ccb4 --- /dev/null +++ b/lang/python/files/python-package-xml.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-xml +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) xml libs + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-xml, \ + /usr/lib/python$(PYTHON_VERSION)/xml \ + /usr/lib/python$(PYTHON_VERSION)/xmllib.py \ + /usr/lib/python$(PYTHON_VERSION)/xmlrpclib.py \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_elementtree.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so \ +)) diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index c8cbcda57..5ab35195d 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -1,12 +1,12 @@ # -# Copyright (C) 2007-2014 OpenWrt.org +# Copyright (C) 2006-2015 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # PYTHON_VERSION:=2.7 -PYTHON_VERSION_MICRO:=9 +PYTHON_VERSION_MICRO:=10 PYTHON_DIR:=$(STAGING_DIR)/usr PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin @@ -25,11 +25,21 @@ define HostPython ( export PYTHONPATH="$(PYTHONPATH)"; \ export PYTHONOPTIMIZE=""; \ export PYTHONDONTWRITEBYTECODE=1; \ + export _python_sysroot="$(STAGING_DIR)"; \ + export _python_prefix="/usr"; \ + export _python_exec_prefix="/usr"; \ $(1) \ $(HOST_PYTHON_BIN) $(2); \ ) endef +# These configure args are needed in detection of path to Python header files +# using autotools. +CONFIGURE_ARGS += \ + _python_sysroot="$(STAGING_DIR)" \ + _python_prefix="/usr" \ + _python_exec_prefix="/usr" + PKG_USE_MIPS16:=0 # This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16 # flags are inherited from the Python base package (via sysconfig module) diff --git a/lang/python/patches/110-enable-zlib.patch b/lang/python/patches/001-enable-zlib.patch index 780831e86..780831e86 100644 --- a/lang/python/patches/110-enable-zlib.patch +++ b/lang/python/patches/001-enable-zlib.patch diff --git a/lang/python/patches/120-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch index fb2fe8a77..fb2fe8a77 100644 --- a/lang/python/patches/120-do-not-add-include-dirs-when-cross-compiling.patch +++ b/lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch diff --git a/lang/python/patches/003-do-not-compile-tests-at-build.patch b/lang/python/patches/003-do-not-compile-tests-at-build.patch new file mode 100644 index 000000000..a6774e174 --- /dev/null +++ b/lang/python/patches/003-do-not-compile-tests-at-build.patch @@ -0,0 +1,20 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 7f4ec2f..e270bf2 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1038,6 +1038,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c + done; \ + done + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt ++ifeq (@COMPILE_ALL_TESTS@,yes) + if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ +@@ -1064,6 +1065,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt ++endif + + # Create the PLATDIR source directory, if one wasn't distributed.. + $(srcdir)/Lib/$(PLATDIR): diff --git a/lang/python/patches/140-do-not-write-bytes-codes.patch b/lang/python/patches/004-do-not-write-bytes-codes.patch index f67e7dcad..f67e7dcad 100644 --- a/lang/python/patches/140-do-not-write-bytes-codes.patch +++ b/lang/python/patches/004-do-not-write-bytes-codes.patch diff --git a/lang/python/patches/150-fix-libffi-x86-64-configure.patch b/lang/python/patches/005-fix-libffi-x86-64-configure.patch index ea062a350..ea062a350 100644 --- a/lang/python/patches/150-fix-libffi-x86-64-configure.patch +++ b/lang/python/patches/005-fix-libffi-x86-64-configure.patch diff --git a/lang/python/patches/160-remove-debian-multiarch-support.patch b/lang/python/patches/006-remove-debian-multiarch-support.patch index 52d52b94e..52d52b94e 100644 --- a/lang/python/patches/160-remove-debian-multiarch-support.patch +++ b/lang/python/patches/006-remove-debian-multiarch-support.patch diff --git a/lang/python/patches/007-distutils-do-not-adjust-path.patch b/lang/python/patches/007-distutils-do-not-adjust-path.patch new file mode 100644 index 000000000..49fe92629 --- /dev/null +++ b/lang/python/patches/007-distutils-do-not-adjust-path.patch @@ -0,0 +1,10 @@ +--- a/Lib/distutils/command/build_scripts.py ++++ b/Lib/distutils/command/build_scripts.py +@@ -89,6 +89,7 @@ class build_scripts (Command): + adjust = 1 + post_interp = match.group(1) or '' + ++ adjust = 0 + if adjust: + log.info("copying and adjusting %s -> %s", script, + self.build_dir) diff --git a/lang/python/patches/008-distutils-use-python-sysroot.patch b/lang/python/patches/008-distutils-use-python-sysroot.patch new file mode 100644 index 000000000..7cd748761 --- /dev/null +++ b/lang/python/patches/008-distutils-use-python-sysroot.patch @@ -0,0 +1,54 @@ +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 +libraries. However, they use the sys.prefix of the host Python, which +returns incorrect paths when cross-compiling (paths pointing to host +headers and libraries). + +In order to fix this, we introduce the _python_sysroot, _python_prefix +and _python_exec_prefix variables, that allow to override these +values, and get correct header/library paths when cross-compiling +third-party Python modules. + +The _python_sysroot variable is also used to prefix the LIBDIR value +taken from the sysconfigdata module. + +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> + +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -19,8 +19,13 @@ + from distutils.errors import DistutilsPlatformError + + # These are needed in a couple of spots, so just compute them once. +-PREFIX = os.path.normpath(sys.prefix) +-EXEC_PREFIX = os.path.normpath(sys.exec_prefix) ++if "_python_sysroot" in os.environ: ++ _sysroot=os.environ.get('_python_sysroot') ++ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix')) ++ EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix')) ++else: ++ PREFIX = os.path.normpath(sys.prefix) ++ EXEC_PREFIX = os.path.normpath(sys.exec_prefix) + + # Path to the base directory of the project. On Windows the binary may + # live in project/PCBuild9. If we're dealing with an x64 Windows build, +Index: b/Lib/distutils/command/build_ext.py +=================================================================== +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -237,7 +237,10 @@ + if (sysconfig.get_config_var('Py_ENABLE_SHARED')): + if not sysconfig.python_build: + # building third party extensions +- self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) ++ libdir = sysconfig.get_config_var('LIBDIR') ++ if "_python_sysroot" in os.environ: ++ libdir = os.environ.get("_python_sysroot") + libdir ++ self.library_dirs.append(libdir) + else: + # building python standard extensions + self.library_dirs.append('.') diff --git a/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch b/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch new file mode 100644 index 000000000..b59809754 --- /dev/null +++ b/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch @@ -0,0 +1,34 @@ +diff --git a/setup.py b/setup.py +index 7868b7b..10ec68f 100644 +--- a/setup.py ++++ b/setup.py +@@ -1067,6 +1067,7 @@ class PyBuildExt(build_ext): + if db_setup_debug: print "db lib: ", dblib, "not found" + + except db_found: ++ rt_dblib_dir = None if cross_compiling else dblib_dir + if db_setup_debug: + print "bsddb using BerkeleyDB lib:", db_ver, dblib + print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir +@@ -1081,7 +1082,7 @@ class PyBuildExt(build_ext): + exts.append(Extension('_bsddb', ['_bsddb.c'], + depends = ['bsddb.h'], + library_dirs=dblib_dir, +- runtime_library_dirs=dblib_dir, ++ runtime_library_dirs=rt_dblib_dir, + include_dirs=db_incs, + libraries=dblibs)) + else: +@@ -1292,10 +1293,11 @@ class PyBuildExt(build_ext): + break + elif cand == "bdb": + if db_incs is not None: ++ rt_dblib_dir = None if cross_compiling else dblib_dir + print "building dbm using bdb" + dbmext = Extension('dbm', ['dbmmodule.c'], + library_dirs=dblib_dir, +- runtime_library_dirs=dblib_dir, ++ runtime_library_dirs=rt_dblib_dir, + include_dirs=db_incs, + define_macros=[ + ('HAVE_BERKDB_H', None), diff --git a/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch new file mode 100644 index 000000000..5a106d4e8 --- /dev/null +++ b/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch @@ -0,0 +1,15 @@ +diff --git a/setup.py b/setup.py +index 7868b7b..544fa7e 100644 +--- a/setup.py ++++ b/setup.py +@@ -452,8 +452,9 @@ class PyBuildExt(build_ext): + # directly since an inconsistently reproducible issue comes up where + # the environment variable is not set even though the value were passed + # into configure and stored in the Makefile (issue found on OS X 10.3). ++ rt_lib_dirs = [] if cross_compiling else self.compiler.runtime_library_dirs + for env_var, arg_name, dir_list in ( +- ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), ++ ('LDFLAGS', '-R', rt_lib_dirs), + ('LDFLAGS', '-L', self.compiler.library_dirs), + ('CPPFLAGS', '-I', self.compiler.include_dirs)): + env_val = sysconfig.get_config_var(env_var) diff --git a/lang/python/patches/011-do-not-prefer-ncursesw.patch b/lang/python/patches/011-do-not-prefer-ncursesw.patch new file mode 100644 index 000000000..c5f323c43 --- /dev/null +++ b/lang/python/patches/011-do-not-prefer-ncursesw.patch @@ -0,0 +1,15 @@ +diff --git a/setup.py b/setup.py +index 7868b7b..86b0119 100644 +--- a/setup.py ++++ b/setup.py +@@ -725,8 +725,8 @@ class PyBuildExt(build_ext): + # use the same library for the readline and curses modules. + if 'curses' in readline_termcap_library: + curses_library = readline_termcap_library +- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'): +- curses_library = 'ncursesw' ++ #elif self.compiler.find_library_file(lib_dirs, 'ncursesw'): ++ # curses_library = 'ncursesw' + elif self.compiler.find_library_file(lib_dirs, 'ncurses'): + curses_library = 'ncurses' + elif self.compiler.find_library_file(lib_dirs, 'curses'): diff --git a/lang/python/patches/130-do-not-run-distutils-tests.patch b/lang/python/patches/130-do-not-run-distutils-tests.patch deleted file mode 100644 index 4fdd2bb4b..000000000 --- a/lang/python/patches/130-do-not-run-distutils-tests.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in -index bcd83bf..c4dcc6d 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1005,32 +1005,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c - done; \ - done - $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt -- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ -- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ -- $(DESTDIR)$(LIBDEST)/distutils/tests ; \ -- fi -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST) -f \ -- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ -- $(DESTDIR)$(LIBDEST) -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST) -f \ -- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ -- $(DESTDIR)$(LIBDEST) -- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST)/site-packages -f \ -- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST)/site-packages -f \ -- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt -- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt - - # Create the PLATDIR source directory, if one wasn't distributed.. - $(srcdir)/Lib/$(PLATDIR): |
