From 0169d40b8147e8cbf579b5a7ce2e4b7867164aab Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 24 Sep 2014 11:08:37 +0300 Subject: [PATCH 1/5] python: import package as-is from old packages Signed-off-by: Alexandru Ardelean --- lang/python/Makefile | 511 ++++++++++++++++++ lang/python/files/python-package.mk | 77 +++ lang/python/patches/000-cross-compile.patch | 112 ++++ .../020-dont-compile-python-files.patch | 33 ++ .../patches/030-fixup-include-dirs.patch | 50 ++ ...0-dont-import-cross-compiled-modules.patch | 43 ++ .../patches/070-dont-clean-ipkg-install.patch | 23 + .../080-distutils-dont_adjust_files.patch | 63 +++ lang/python/patches/110-enable-zlib.patch | 15 + ...0-force-internal-modules-for-hashlib.patch | 25 + lang/python/patches/130-readline-setup.patch | 36 ++ .../patches/140-verbose-sharedmods.patch | 11 + lang/python/patches/150-no-sqlite-rpath.patch | 10 + 13 files changed, 1009 insertions(+) create mode 100644 lang/python/Makefile create mode 100644 lang/python/files/python-package.mk create mode 100644 lang/python/patches/000-cross-compile.patch create mode 100644 lang/python/patches/020-dont-compile-python-files.patch create mode 100644 lang/python/patches/030-fixup-include-dirs.patch create mode 100644 lang/python/patches/040-dont-import-cross-compiled-modules.patch create mode 100644 lang/python/patches/070-dont-clean-ipkg-install.patch create mode 100644 lang/python/patches/080-distutils-dont_adjust_files.patch create mode 100644 lang/python/patches/110-enable-zlib.patch create mode 100644 lang/python/patches/120-force-internal-modules-for-hashlib.patch create mode 100644 lang/python/patches/130-readline-setup.patch create mode 100644 lang/python/patches/140-verbose-sharedmods.patch create mode 100644 lang/python/patches/150-no-sqlite-rpath.patch diff --git a/lang/python/Makefile b/lang/python/Makefile new file mode 100644 index 000000000..8493b5574 --- /dev/null +++ b/lang/python/Makefile @@ -0,0 +1,511 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python +PKG_VERSION:=2.7.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION) +PKG_MD5SUM:=62c4c1699170078c469f79ddfed21bc0 + +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 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +HOST_BUILD_PARALLEL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=python/host + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk +-include $(if $(DUMP),,./files/python-package.mk) + +define Package/python/Default + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python $(PYTHON_VERSION) programming language + URL:=http://www.python.org/ +endef + +define Package/python/Default/description + Python is a dynamic object-oriented programming language that can be used + for many kinds of software development. It offers strong support for + integration with other languages and tools, comes with extensive standard + libraries, and can be learned in a few days. Many Python programmers + report substantial productivity gains and feel the language encourages + the development of higher quality, more maintainable code. +endef + +define Package/python +$(call Package/python/Default) + TITLE+= (full) + DEPENDS:=+libpthread +zlib +libffi +python-mini +endef + +define Package/python/description +$(call Package/python/Default/description) + . + This package contains the full Python install. +endef + +define Package/python-mini +$(call Package/python/Default) + TITLE+= (minimal) + DEPENDS:=+libpthread +zlib +endef + +define Package/python-mini/description +$(call Package/python/Default/description) + . + This package contains only a minimal Python install. +endef + +define Package/python-doc +$(call Package/python/Default) + TITLE:=Python interactive documentation + DEPENDS+=+python-mini +endef + +define Package/python-bzip2 +$(call Package/python/Default) + TITLE:=Python support for Bzip2 + DEPENDS+=+python-mini +libbz2 +endef + +define Package/python-expat +$(call Package/python/Default) + TITLE:=Python support for expat + DEPENDS+=+python-mini +libexpat +endef + +define Package/python-gzip +$(call Package/python/Default) + TITLE:=Python support for gzip + DEPENDS+=+python-mini +endef + +define Package/python-openssl +$(call Package/python/Default) + TITLE:=Python support for OpenSSL + DEPENDS+=+python-mini +libopenssl +endef + +define Package/python-shutil +$(call Package/python/Default) + TITLE:=Python support for shutil + DEPENDS+=+python-mini +endef + +# Needs datetime +define Package/python-sqlite3 +$(call Package/python/Default) + TITLE:=Python support for sqlite3 + DEPENDS+=+python +libsqlite3 +endef + +define Package/python-gdbm +$(call Package/python/Default) + TITLE:=Python support for gdbm + DEPENDS+=+python-mini +libgdbm +endef + +define Package/python-readline +$(call Package/python/Default) + TITLE:=Python support for readline + DEPENDS+=+python-mini +libreadline +libncurses @BROKEN +endef + +define Package/python-ncurses +$(call Package/python/Default) + TITLE:=Python support for readline + DEPENDS+=+python-mini +libncurses +endef + +MAKE_FLAGS:=\ + $(TARGET_CONFIGURE_OPTS) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + CROSS_COMPILE=yes \ + CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + LD="$(TARGET_CC)" \ + HOSTPYTHON=./hostpython \ + HOSTPGEN=./hostpgen + +ENABLE_IPV6:= +ifeq ($(CONFIG_IPV6),y) + ENABLE_IPV6 += --enable-ipv6 +endif + +define Build/Configure + -$(MAKE) -C $(PKG_BUILD_DIR) distclean + (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0) + # The python executable needs to stay in the rootdir since its location will + # be used to compute the path of the config files. + $(CP) $(STAGING_DIR_HOST)/bin/pgen $(PKG_BUILD_DIR)/hostpgen + $(CP) $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) $(PKG_BUILD_DIR)/hostpython + $(call Build/Configure/Default, \ + --sysconfdir=/etc \ + --disable-shared \ + --without-cxx-main \ + --with-threads \ + --with-system-ffi="$(STAGING_DIR)/usr" \ + $(ENABLE_IPV6) \ + ac_cv_have_chflags=no \ + ac_cv_have_lchflags=no \ + ac_cv_py_format_size_t=no \ + ac_cv_have_long_long_format=yes \ + ac_cv_buggy_getaddrinfo=no \ + OPT="$(TARGET_CFLAGS)" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib + $(INSTALL_DIR) $(STAGING_DIR)/mk/ + $(INSTALL_DATA) ./files/python-package.mk $(STAGING_DIR)/mk/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \ + $(1)/usr/include/ + $(CP) \ + $(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \ + $(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \ + $(1)/usr/lib/python$(PYTHON_VERSION)/ + + $(CP) \ + $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) \ + $(1)/usr/bin/hostpython + (cd $(2)/bin; \ + ln -sf ../../usr/bin/hostpython python$(PYTHON_VERSION); \ + ln -sf python$(PYTHON_VERSION) python) + + $(CP) \ + $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \ + $(2)/bin/ + $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config + + (cd $(2)/bin; \ + ln -sf python$(PYTHON_VERSION)-config python-config;) +endef + +define PyPackage/python/filespec ++|/usr/lib/python$(PYTHON_VERSION) +-|/usr/lib/python$(PYTHON_VERSION)/bsddb/test +-|/usr/lib/python$(PYTHON_VERSION)/config +-|/usr/lib/python$(PYTHON_VERSION)/ctypes/test +-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst-*.exe +-|/usr/lib/python$(PYTHON_VERSION)/distutils/tests +-|/usr/lib/python$(PYTHON_VERSION)/email/test +-|/usr/lib/python$(PYTHON_VERSION)/idlelib +-|/usr/lib/python$(PYTHON_VERSION)/json/tests +-|/usr/lib/python$(PYTHON_VERSION)/lib-tk +-|/usr/lib/python$(PYTHON_VERSION)/sqlite3 +-|/usr/lib/python$(PYTHON_VERSION)/test +-|/usr/lib/python$(PYTHON_VERSION)/lib2to3 +-|/usr/lib/python$(PYTHON_VERSION)/lib-old +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so +-|/usr/lib/python$(PYTHON_VERSION)/pydoc_data +-|/usr/lib/python$(PYTHON_VERSION)/pydoc.py +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so +-|/usr/lib/python$(PYTHON_VERSION)/__future__.py +-|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py +-|/usr/lib/python$(PYTHON_VERSION)/abc.py +-|/usr/lib/python$(PYTHON_VERSION)/codecs.py +-|/usr/lib/python$(PYTHON_VERSION)/compileall.py +-|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py +-|/usr/lib/python$(PYTHON_VERSION)/copy.py +-|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py +-|/usr/lib/python$(PYTHON_VERSION)/dis.py +-|/usr/lib/python$(PYTHON_VERSION)/encodings +-|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py +-|/usr/lib/python$(PYTHON_VERSION)/genericpath.py +-|/usr/lib/python$(PYTHON_VERSION)/getopt.py +-|/usr/lib/python$(PYTHON_VERSION)/glob.py +-|/usr/lib/python$(PYTHON_VERSION)/hashlib.py +-|/usr/lib/python$(PYTHON_VERSION)/inspect.py +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so +-|/usr/lib/python$(PYTHON_VERSION)/linecache.py +-|/usr/lib/python$(PYTHON_VERSION)/md5.py +-|/usr/lib/python$(PYTHON_VERSION)/new.py +-|/usr/lib/python$(PYTHON_VERSION)/opcode.py +-|/usr/lib/python$(PYTHON_VERSION)/optparse.py +-|/usr/lib/python$(PYTHON_VERSION)/os.py +-|/usr/lib/python$(PYTHON_VERSION)/pickle.py +-|/usr/lib/python$(PYTHON_VERSION)/pickle.py +-|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py +-|/usr/lib/python$(PYTHON_VERSION)/popen2.py +-|/usr/lib/python$(PYTHON_VERSION)/posixpath.py +-|/usr/lib/python$(PYTHON_VERSION)/py_compile.py +-|/usr/lib/python$(PYTHON_VERSION)/random.py +-|/usr/lib/python$(PYTHON_VERSION)/repr.py +-|/usr/lib/python$(PYTHON_VERSION)/re.py +-|/usr/lib/python$(PYTHON_VERSION)/sha.py +-|/usr/lib/python$(PYTHON_VERSION)/site.py +-|/usr/lib/python$(PYTHON_VERSION)/socket.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)/sre.py +-|/usr/lib/python$(PYTHON_VERSION)/stat.py +-|/usr/lib/python$(PYTHON_VERSION)/StringIO.py +-|/usr/lib/python$(PYTHON_VERSION)/stringprep.py +-|/usr/lib/python$(PYTHON_VERSION)/string.py +-|/usr/lib/python$(PYTHON_VERSION)/struct.py +-|/usr/lib/python$(PYTHON_VERSION)/subprocess.py +-|/usr/lib/python$(PYTHON_VERSION)/tempfile.py +-|/usr/lib/python$(PYTHON_VERSION)/textwrap.py +-|/usr/lib/python$(PYTHON_VERSION)/tokenize.py +-|/usr/lib/python$(PYTHON_VERSION)/token.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 +-|/usr/lib/python$(PYTHON_VERSION)/weakref.py +-|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py +-|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py +-|/usr/lib/python$(PYTHON_VERSION)/functools.py +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so +-|/usr/lib/python$(PYTHON_VERSION)/collections.py +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so +-|/usr/lib/python$(PYTHON_VERSION)/keyword.py +-|/usr/lib/python$(PYTHON_VERSION)/heapq.py +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so +-|/usr/lib/python$(PYTHON_VERSION)/bisect.py +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so +endef + +define PyPackage/python-mini/filespec ++|/usr/bin/python$(PYTHON_VERSION) ++|/usr/lib/python$(PYTHON_VERSION)/__future__.py ++|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py ++|/usr/lib/python$(PYTHON_VERSION)/abc.py ++|/usr/lib/python$(PYTHON_VERSION)/codecs.py ++|/usr/lib/python$(PYTHON_VERSION)/compileall.py ++|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py ++|/usr/lib/python$(PYTHON_VERSION)/copy.py ++|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py ++|/usr/lib/python$(PYTHON_VERSION)/dis.py ++|/usr/lib/python$(PYTHON_VERSION)/encodings ++|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py ++|/usr/lib/python$(PYTHON_VERSION)/genericpath.py ++|/usr/lib/python$(PYTHON_VERSION)/getopt.py ++|/usr/lib/python$(PYTHON_VERSION)/glob.py ++|/usr/lib/python$(PYTHON_VERSION)/hashlib.py ++|/usr/lib/python$(PYTHON_VERSION)/inspect.py ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so ++|/usr/lib/python$(PYTHON_VERSION)/linecache.py ++|/usr/lib/python$(PYTHON_VERSION)/md5.py ++|/usr/lib/python$(PYTHON_VERSION)/new.py ++|/usr/lib/python$(PYTHON_VERSION)/opcode.py ++|/usr/lib/python$(PYTHON_VERSION)/optparse.py ++|/usr/lib/python$(PYTHON_VERSION)/os.py ++|/usr/lib/python$(PYTHON_VERSION)/pickle.py ++|/usr/lib/python$(PYTHON_VERSION)/pickle.py ++|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py ++|/usr/lib/python$(PYTHON_VERSION)/popen2.py ++|/usr/lib/python$(PYTHON_VERSION)/posixpath.py ++|/usr/lib/python$(PYTHON_VERSION)/py_compile.py ++|/usr/lib/python$(PYTHON_VERSION)/random.py ++|/usr/lib/python$(PYTHON_VERSION)/repr.py ++|/usr/lib/python$(PYTHON_VERSION)/re.py ++|/usr/lib/python$(PYTHON_VERSION)/sha.py ++|/usr/lib/python$(PYTHON_VERSION)/site.py ++|/usr/lib/python$(PYTHON_VERSION)/socket.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)/sre.py ++|/usr/lib/python$(PYTHON_VERSION)/stat.py ++|/usr/lib/python$(PYTHON_VERSION)/StringIO.py ++|/usr/lib/python$(PYTHON_VERSION)/stringprep.py ++|/usr/lib/python$(PYTHON_VERSION)/string.py ++|/usr/lib/python$(PYTHON_VERSION)/struct.py ++|/usr/lib/python$(PYTHON_VERSION)/subprocess.py ++|/usr/lib/python$(PYTHON_VERSION)/tempfile.py ++|/usr/lib/python$(PYTHON_VERSION)/textwrap.py ++|/usr/lib/python$(PYTHON_VERSION)/tokenize.py ++|/usr/lib/python$(PYTHON_VERSION)/token.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 ++|/usr/lib/python$(PYTHON_VERSION)/weakref.py ++|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py ++|/usr/lib/python$(PYTHON_VERSION)/config/Makefile ++|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py ++|/usr/lib/python$(PYTHON_VERSION)/functools.py ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so ++|/usr/lib/python$(PYTHON_VERSION)/collections.py ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so ++|/usr/lib/python$(PYTHON_VERSION)/keyword.py ++|/usr/lib/python$(PYTHON_VERSION)/heapq.py ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so ++|/usr/lib/python$(PYTHON_VERSION)/bisect.py ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so ++|/usr/include/python$(PYTHON_VERSION)/pyconfig.h +endef + +define PyPackage/python-mini/install + ln -sf python$(PYTHON_VERSION) $(1)/usr/bin/python +endef + +define PyPackage/python-doc/filespec ++|/usr/lib/python$(PYTHON_VERSION)/pydoc_data ++|/usr/lib/python$(PYTHON_VERSION)/pydoc.py +endef + +define PyPackage/python-bzip2/filespec ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so +endef + +define PyPackage/python-expat/filespec ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so +endef + +define PyPackage/python-gzip/filespec ++|/usr/lib/python$(PYTHON_VERSION)/gzip.py +endef + +define PyPackage/python-openssl/filespec ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so +endef + +define PyPackage/python-shutil/filespec ++|/usr/lib/python$(PYTHON_VERSION)/shutil.py +endef + +define PyPackage/python-sqlite3/filespec ++|/usr/lib/python$(PYTHON_VERSION)/sqlite3 ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so +endef + +define PyPackage/python-gdbm/filespec ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so +endef + +define PyPackage/python-readline/filespec ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so +endef + +define PyPackage/python-ncurses/filespec ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so +endef + +define Host/Configure + -$(MAKE) -C $(HOST_BUILD_DIR) distclean + (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0) + (cd $(HOST_BUILD_DIR); \ + rm -rf config.cache; \ + CONFIG_SITE= \ + OPT="$(HOST_CFLAGS)" \ + ./configure --without-cxx-main --with-threads --prefix=$(STAGING_DIR_HOST); \ + ) +endef + +define Host/Compile + +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + python Parser/pgen + +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + HOSTPYTHON=$(HOST_BUILD_DIR)/python \ + sharedmods +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ + $(MAKE) -C $(HOST_BUILD_DIR) \ + HOSTPYTHON=$(HOST_BUILD_DIR)/python \ + install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/ +endef + + +$(eval $(call HostBuild)) + +$(eval $(call PyPackage,python)) +$(eval $(call PyPackage,python-mini)) +$(eval $(call PyPackage,python-doc)) +$(eval $(call PyPackage,python-bzip2)) +$(eval $(call PyPackage,python-expat)) +$(eval $(call PyPackage,python-gzip)) +$(eval $(call PyPackage,python-openssl)) +$(eval $(call PyPackage,python-shutil)) +$(eval $(call PyPackage,python-sqlite3)) +$(eval $(call PyPackage,python-gdbm)) +$(eval $(call PyPackage,python-readline)) +$(eval $(call PyPackage,python-ncurses)) + +$(eval $(call BuildPackage,python)) +$(eval $(call BuildPackage,python-mini)) +$(eval $(call BuildPackage,python-doc)) +$(eval $(call BuildPackage,python-bzip2)) +$(eval $(call BuildPackage,python-expat)) +$(eval $(call BuildPackage,python-gzip)) +$(eval $(call BuildPackage,python-openssl)) +$(eval $(call BuildPackage,python-shutil)) +$(eval $(call BuildPackage,python-sqlite3)) +$(eval $(call BuildPackage,python-gdbm)) +$(eval $(call BuildPackage,python-readline)) +$(eval $(call BuildPackage,python-ncurses)) diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk new file mode 100644 index 000000000..70e630059 --- /dev/null +++ b/lang/python/files/python-package.mk @@ -0,0 +1,77 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +PYTHON_VERSION=2.7 + +PYTHON_DIR:=$(STAGING_DIR)/usr +PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin +PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION) +PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION) + +PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages + +PYTHON:=python$(PYTHON_VERSION) + +HOST_PYTHON_BIN:=$(STAGING_DIR)/usr/bin/hostpython + +define HostPython + ( export PYTHONPATH="$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)"; \ + export PYTHONOPTIMIZE=""; \ + export PYTHONDONTWRITEBYTECODE=1; \ + $(1) \ + $(HOST_PYTHON_BIN) $(2); \ + ) +endef + +define PyPackage + $(call shexport,PyPackage/$(1)/filespec) + + define Package/$(1)/install + @$(SH_FUNC) getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \ + IFS='|'; \ + while read fop fspec fperm; do \ + if [ "$$$$$$$$fop" = "+" ]; then \ + dpath=`dirname "$$$$$$$$fspec"`; \ + if [ -n "$$$$$$$$fperm" ]; then \ + dperm="-m$$$$$$$$fperm"; \ + else \ + dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \ + fi; \ + mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \ + echo "copying: '$$$$$$$$fspec'"; \ + cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \ + if [ -n "$$$$$$$$fperm" ]; then \ + chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \ + fi; \ + elif [ "$$$$$$$$fop" = "-" ]; then \ + echo "removing: '$$$$$$$$fspec'"; \ + rm -fR $$(1)$$$$$$$$fspec; \ + elif [ "$$$$$$$$fop" = "=" ]; then \ + echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \ + chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \ + fi; \ + done; \ + ) + $(call PyPackage/$(1)/install,$$(1)) + endef +endef + +# $(1) => build subdir +# $(2) => additional arguments to setup.py +# $(3) => additional variables +define Build/Compile/PyMod + $(call HostPython, \ + cd $(PKG_BUILD_DIR)/$(strip $(1)); \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(3) \ + , \ + ./setup.py $(2) \ + ) + find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f +endef diff --git a/lang/python/patches/000-cross-compile.patch b/lang/python/patches/000-cross-compile.patch new file mode 100644 index 000000000..a6f208e87 --- /dev/null +++ b/lang/python/patches/000-cross-compile.patch @@ -0,0 +1,112 @@ +--- + Makefile.pre.in | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= $(BUILDPYTHON) + + # The task to run while instrument when building the profile-opt target + PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck +@@ -214,6 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) ++HOSTPGEN= $(PGEN)$(EXE) + + POBJS= \ + Parser/acceler.o \ +@@ -384,7 +386,7 @@ build_all_generate_profile: + $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov" + + run_profile_task: +- ./$(BUILDPYTHON) $(PROFILE_TASK) ++ $(HOSTPYTHON) $(PROFILE_TASK) + + build_all_use_profile: + $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use" +@@ -402,14 +404,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA + $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + platform: $(BUILDPYTHON) +- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform ++ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform + + + # Build the shared modules + sharedmods: $(BUILDPYTHON) + @case $$MAKEFLAGS in \ +- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ +- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ ++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ ++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + esac + + # Build static library +@@ -543,7 +545,7 @@ Modules/python.o: $(srcdir)/Modules/pyth + $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp + Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) + -@$(INSTALL) -d Include +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + -touch Parser/pgen.stamp + + $(PGEN): $(PGENOBJS) +@@ -708,7 +710,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho + + TESTOPTS= -l $(EXTRATESTOPTS) + TESTPROG= $(srcdir)/Lib/test/regrtest.py +-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) ++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) + test: all platform + -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f + -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) +@@ -1062,7 +1064,7 @@ libainstall: all python-config + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods +- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ ++ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +@@ -1100,7 +1102,7 @@ frameworkinstallstructure: $(LDLIBRARY) + fi; \ + done + $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers +- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist ++ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist + $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current + $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) + $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers +@@ -1135,7 +1137,7 @@ frameworkinstallextras: + # This installs a few of the useful scripts in Tools/scripts + scriptsinstall: + SRCDIR=$(srcdir) $(RUNSHARED) \ +- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ ++ $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --root=$(DESTDIR)/ +@@ -1157,7 +1159,7 @@ config.status: $(srcdir)/configure + + # Run reindent on the library + reindent: +- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib ++ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib + + # Rerun configure with the same options as it was run last time, + # provided the config.status script exists +@@ -1260,7 +1262,7 @@ funny: + + # Perform some verification checks on any modified files. + patchcheck: +- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py ++ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py + + # Dependencies + diff --git a/lang/python/patches/020-dont-compile-python-files.patch b/lang/python/patches/020-dont-compile-python-files.patch new file mode 100644 index 000000000..57bd51d95 --- /dev/null +++ b/lang/python/patches/020-dont-compile-python-files.patch @@ -0,0 +1,33 @@ +--- + Makefile.pre.in | 16 ---------------- + 1 file changed, 16 deletions(-) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -940,26 +940,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -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) \ +- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + + # Create the PLATDIR source directory, if one wasn't distributed.. + $(srcdir)/Lib/$(PLATDIR): diff --git a/lang/python/patches/030-fixup-include-dirs.patch b/lang/python/patches/030-fixup-include-dirs.patch new file mode 100644 index 000000000..6cc6bba74 --- /dev/null +++ b/lang/python/patches/030-fixup-include-dirs.patch @@ -0,0 +1,50 @@ +--- + setup.py | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -368,11 +368,6 @@ class PyBuildExt(build_ext): + os.unlink(tmpfile) + + def detect_modules(self): +- # Ensure that /usr/local is always used +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') +- self.add_multiarch_paths() +- + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. + # We must get the values from the Makefile and not the environment +@@ -407,17 +402,6 @@ class PyBuildExt(build_ext): + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.prefix) != '/usr' \ +- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): +- # 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 +- # the one that is currently installed (issue #7473) +- add_dir_to_list(self.compiler.library_dirs, +- sysconfig.get_config_var("LIBDIR")) +- add_dir_to_list(self.compiler.include_dirs, +- sysconfig.get_config_var("INCLUDEDIR")) +- + try: + have_unicode = unicode + except NameError: +@@ -426,11 +410,8 @@ class PyBuildExt(build_ext): + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. +- lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', +- ] +- inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ lib_dirs = self.compiler.library_dirs ++ inc_dirs = self.compiler.include_dirs + exts = [] + missing = [] + diff --git a/lang/python/patches/040-dont-import-cross-compiled-modules.patch b/lang/python/patches/040-dont-import-cross-compiled-modules.patch new file mode 100644 index 000000000..1793569f9 --- /dev/null +++ b/lang/python/patches/040-dont-import-cross-compiled-modules.patch @@ -0,0 +1,43 @@ +--- + setup.py | 30 ------------------------------ + 1 file changed, 30 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -307,36 +307,6 @@ class PyBuildExt(build_ext): + ext_filename = os.path.join( + self.build_lib, + self.get_ext_filename(self.get_ext_fullname(ext.name))) +- try: +- imp.load_dynamic(ext.name, ext_filename) +- except ImportError, why: +- self.failed.append(ext.name) +- self.announce('*** WARNING: renaming "%s" since importing it' +- ' failed: %s' % (ext.name, why), level=3) +- assert not self.inplace +- basename, tail = os.path.splitext(ext_filename) +- newname = basename + "_failed" + tail +- if os.path.exists(newname): +- os.remove(newname) +- os.rename(ext_filename, newname) +- +- # XXX -- This relies on a Vile HACK in +- # distutils.command.build_ext.build_extension(). The +- # _built_objects attribute is stored there strictly for +- # use here. +- # If there is a failure, _built_objects may not be there, +- # so catch the AttributeError and move on. +- try: +- for filename in self._built_objects: +- os.remove(filename) +- except AttributeError: +- self.announce('unable to remove files (ignored)') +- except: +- exc_type, why, tb = sys.exc_info() +- self.announce('*** WARNING: importing extension "%s" ' +- 'failed with %s: %s' % (ext.name, exc_type, why), +- level=3) +- self.failed.append(ext.name) + + def get_platform(self): + # Get value of sys.platform diff --git a/lang/python/patches/070-dont-clean-ipkg-install.patch b/lang/python/patches/070-dont-clean-ipkg-install.patch new file mode 100644 index 000000000..0796c19d6 --- /dev/null +++ b/lang/python/patches/070-dont-clean-ipkg-install.patch @@ -0,0 +1,23 @@ +--- + Makefile.pre.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1169,12 +1169,12 @@ TAGS:: + # Sanitation targets -- clean leaves libraries, executables and tags + # files, which clobber removes as well + pycremoval: +- find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' ++ find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';' + + clean: pycremoval +- find . -name '*.[oa]' -exec rm -f {} ';' +- find . -name '*.s[ol]' -exec rm -f {} ';' +- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' ++ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';' ++ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';' ++ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' + find build -name 'fficonfig.h' -exec rm -f {} ';' || true + find build -name 'fficonfig.py' -exec rm -f {} ';' || true + -rm -f Lib/lib2to3/*Grammar*.pickle diff --git a/lang/python/patches/080-distutils-dont_adjust_files.patch b/lang/python/patches/080-distutils-dont_adjust_files.patch new file mode 100644 index 000000000..97d62fb3a --- /dev/null +++ b/lang/python/patches/080-distutils-dont_adjust_files.patch @@ -0,0 +1,63 @@ +--- + Lib/distutils/command/build_scripts.py | 43 +++------------------------------ + 1 file changed, 4 insertions(+), 39 deletions(-) + +--- a/Lib/distutils/command/build_scripts.py ++++ b/Lib/distutils/command/build_scripts.py +@@ -51,10 +51,7 @@ class build_scripts (Command): + + + def copy_scripts (self): +- """Copy each script listed in 'self.scripts'; if it's marked as a +- Python script in the Unix way (first line matches 'first_line_re', +- ie. starts with "\#!" and contains "python"), then adjust the first +- line to refer to the current Python interpreter as we copy. ++ """Copy each script listed in 'self.scripts' + """ + _sysconfig = __import__('sysconfig') + self.mkpath(self.build_dir) +@@ -78,41 +75,9 @@ class build_scripts (Command): + if not self.dry_run: + raise + f = None +- else: +- first_line = f.readline() +- if not first_line: +- self.warn("%s is an empty file (skipping)" % script) +- continue +- +- match = first_line_re.match(first_line) +- if match: +- adjust = 1 +- post_interp = match.group(1) or '' +- +- if adjust: +- log.info("copying and adjusting %s -> %s", script, +- self.build_dir) +- if not self.dry_run: +- outf = open(outfile, "w") +- if not _sysconfig.is_python_build(): +- outf.write("#!%s%s\n" % +- (self.executable, +- post_interp)) +- else: +- outf.write("#!%s%s\n" % +- (os.path.join( +- _sysconfig.get_config_var("BINDIR"), +- "python%s%s" % (_sysconfig.get_config_var("VERSION"), +- _sysconfig.get_config_var("EXE"))), +- post_interp)) +- outf.writelines(f.readlines()) +- outf.close() +- if f: +- f.close() +- else: +- if f: +- f.close() +- self.copy_file(script, outfile) ++ if f: ++ f.close() ++ self.copy_file(script, outfile) + + if os.name == 'posix': + for file in outfiles: diff --git a/lang/python/patches/110-enable-zlib.patch b/lang/python/patches/110-enable-zlib.patch new file mode 100644 index 000000000..cdc70733c --- /dev/null +++ b/lang/python/patches/110-enable-zlib.patch @@ -0,0 +1,15 @@ +--- + Modules/Setup.dist | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -460,7 +460,7 @@ GLHACK=-Dclear=__GLclear + # Andrew Kuchling's zlib module. + # This require zlib 1.1.3 (or later). + # See http://www.gzip.org/zlib/ +-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz ++zlib zlibmodule.c -lz + + # Interface to the Expat XML parser + # diff --git a/lang/python/patches/120-force-internal-modules-for-hashlib.patch b/lang/python/patches/120-force-internal-modules-for-hashlib.patch new file mode 100644 index 000000000..ad10a4401 --- /dev/null +++ b/lang/python/patches/120-force-internal-modules-for-hashlib.patch @@ -0,0 +1,25 @@ +--- + setup.py | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -704,8 +704,7 @@ class PyBuildExt(build_ext): + + min_openssl_ver = 0x00907000 + have_any_openssl = ssl_incs is not None and ssl_libs is not None +- have_usable_openssl = (have_any_openssl and +- openssl_ver >= min_openssl_ver) ++ have_usable_openssl = False + + if have_any_openssl: + if have_usable_openssl: +@@ -730,7 +729,7 @@ class PyBuildExt(build_ext): + depends = ['md5.h']) ) + + min_sha2_openssl_ver = 0x00908000 +- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver: ++ if True: + # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash + exts.append( Extension('_sha256', ['sha256module.c']) ) + exts.append( Extension('_sha512', ['sha512module.c']) ) diff --git a/lang/python/patches/130-readline-setup.patch b/lang/python/patches/130-readline-setup.patch new file mode 100644 index 000000000..c19dbb279 --- /dev/null +++ b/lang/python/patches/130-readline-setup.patch @@ -0,0 +1,36 @@ +--- a/setup.py ++++ b/setup.py +@@ -573,32 +573,7 @@ class PyBuildExt(build_ext): + # readline + do_readline = self.compiler.find_library_file(lib_dirs, 'readline') + readline_termcap_library = "" +- curses_library = "" +- # Determine if readline is already linked against curses or tinfo. +- if do_readline and find_executable('ldd'): +- fp = os.popen("ldd %s" % do_readline) +- ldd_output = fp.readlines() +- ret = fp.close() +- if ret is None or ret >> 8 == 0: +- for ln in ldd_output: +- if 'curses' in ln: +- readline_termcap_library = re.sub( +- r'.*lib(n?cursesw?)\.so.*', r'\1', ln +- ).rstrip() +- break +- if 'tinfo' in ln: # termcap interface split out from ncurses +- readline_termcap_library = 'tinfo' +- break +- # Issue 7384: If readline is already linked against curses, +- # 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, 'ncurses'): +- curses_library = 'ncurses' +- elif self.compiler.find_library_file(lib_dirs, 'curses'): +- curses_library = 'curses' ++ curses_library = "ncurses" + + if platform == 'darwin': + os_release = int(os.uname()[2].split('.')[0]) diff --git a/lang/python/patches/140-verbose-sharedmods.patch b/lang/python/patches/140-verbose-sharedmods.patch new file mode 100644 index 000000000..a761c344b --- /dev/null +++ b/lang/python/patches/140-verbose-sharedmods.patch @@ -0,0 +1,11 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -410,7 +410,7 @@ platform: $(BUILDPYTHON) + # Build the shared modules + sharedmods: $(BUILDPYTHON) + @case $$MAKEFLAGS in \ +- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ ++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + esac + diff --git a/lang/python/patches/150-no-sqlite-rpath.patch b/lang/python/patches/150-no-sqlite-rpath.patch new file mode 100644 index 000000000..4f0ec41b5 --- /dev/null +++ b/lang/python/patches/150-no-sqlite-rpath.patch @@ -0,0 +1,10 @@ +--- a/setup.py ++++ b/setup.py +@@ -1021,7 +1021,6 @@ class PyBuildExt(build_ext): + include_dirs=["Modules/_sqlite", + sqlite_incdir], + library_dirs=sqlite_libdir, +- runtime_library_dirs=sqlite_libdir, + extra_link_args=sqlite_extra_link_args, + libraries=["sqlite3",])) + else: From 1472a35f36d78fe2f30fe178d23e51d2e91425f8 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 24 Sep 2014 11:11:41 +0300 Subject: [PATCH 2/5] python: update copyright & maintainer Signed-off-by: Alexandru Ardelean --- lang/python/Makefile | 3 ++- lang/python/files/python-package.mk | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lang/python/Makefile b/lang/python/Makefile index 8493b5574..51e89dcef 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2012 OpenWrt.org +# Copyright (C) 2006-2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -37,6 +37,7 @@ define Package/python/Default CATEGORY:=Languages TITLE:=Python $(PYTHON_VERSION) programming language URL:=http://www.python.org/ + MAINTAINER:=Alexandru Ardelean endef define Package/python/Default/description diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index 70e630059..88ae11435 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. From da85f0770a00639f129f0befada951b878c7207b Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Thu, 25 Sep 2014 09:48:25 +0300 Subject: [PATCH 3/5] python: reorganize package Make python-mini the top-level and default Python package. Make the other packages subpackages of the top-level python package. Make old python package the python-full package. Note: at this point, this package can be split/renamed to python-legacy should anyone need Python 2. After this commit it's going to be Python 3 all the way. Signed-off-by: Alexandru Ardelean --- lang/python/Makefile | 49 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/lang/python/Makefile b/lang/python/Makefile index 51e89dcef..490dd9c3f 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -51,87 +51,86 @@ endef define Package/python $(call Package/python/Default) - TITLE+= (full) - DEPENDS:=+libpthread +zlib +libffi +python-mini + DEPENDS:=+libpthread +zlib +libffi endef define Package/python/description $(call Package/python/Default/description) - . - This package contains the full Python install. + . + This package contains only a minimal Python install. endef -define Package/python-mini +define Package/python-full $(call Package/python/Default) - TITLE+= (minimal) - DEPENDS:=+libpthread +zlib + TITLE+= (full) + DEPENDS:=@PACKAGE_python +PACKAGE_python:python endef -define Package/python-mini/description +define Package/python-full/description $(call Package/python/Default/description) - . - This package contains only a minimal Python install. + . + This package contains the full Python install. endef define Package/python-doc $(call Package/python/Default) TITLE:=Python interactive documentation - DEPENDS+=+python-mini + DEPENDS:=@PACKAGE_python +PACKAGE_python:python endef define Package/python-bzip2 $(call Package/python/Default) TITLE:=Python support for Bzip2 - DEPENDS+=+python-mini +libbz2 + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libbz2 endef define Package/python-expat $(call Package/python/Default) TITLE:=Python support for expat - DEPENDS+=+python-mini +libexpat + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libexpat endef define Package/python-gzip $(call Package/python/Default) TITLE:=Python support for gzip - DEPENDS+=+python-mini + DEPENDS:=@PACKAGE_python +PACKAGE_python:python endef define Package/python-openssl $(call Package/python/Default) TITLE:=Python support for OpenSSL - DEPENDS+=+python-mini +libopenssl + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libopenssl endef define Package/python-shutil $(call Package/python/Default) TITLE:=Python support for shutil - DEPENDS+=+python-mini + DEPENDS:=@PACKAGE_python +PACKAGE_python:python endef # Needs datetime define Package/python-sqlite3 $(call Package/python/Default) TITLE:=Python support for sqlite3 - DEPENDS+=+python +libsqlite3 + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libsqlite3 endef define Package/python-gdbm $(call Package/python/Default) TITLE:=Python support for gdbm - DEPENDS+=+python-mini +libgdbm + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libgdbm endef define Package/python-readline $(call Package/python/Default) TITLE:=Python support for readline - DEPENDS+=+python-mini +libreadline +libncurses @BROKEN + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libreadline +libncurses @BROKEN endef define Package/python-ncurses $(call Package/python/Default) TITLE:=Python support for readline - DEPENDS+=+python-mini +libncurses + DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libncurses endef MAKE_FLAGS:=\ @@ -203,7 +202,7 @@ define Build/InstallDev ln -sf python$(PYTHON_VERSION)-config python-config;) endef -define PyPackage/python/filespec +define PyPackage/python-full/filespec +|/usr/lib/python$(PYTHON_VERSION) -|/usr/lib/python$(PYTHON_VERSION)/bsddb/test -|/usr/lib/python$(PYTHON_VERSION)/config @@ -318,7 +317,7 @@ define PyPackage/python/filespec -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so endef -define PyPackage/python-mini/filespec +define PyPackage/python/filespec +|/usr/bin/python$(PYTHON_VERSION) +|/usr/lib/python$(PYTHON_VERSION)/__future__.py +|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py @@ -408,7 +407,7 @@ define PyPackage/python-mini/filespec +|/usr/include/python$(PYTHON_VERSION)/pyconfig.h endef -define PyPackage/python-mini/install +define PyPackage/python/install ln -sf python$(PYTHON_VERSION) $(1)/usr/bin/python endef @@ -486,7 +485,7 @@ endef $(eval $(call HostBuild)) $(eval $(call PyPackage,python)) -$(eval $(call PyPackage,python-mini)) +$(eval $(call PyPackage,python-full)) $(eval $(call PyPackage,python-doc)) $(eval $(call PyPackage,python-bzip2)) $(eval $(call PyPackage,python-expat)) @@ -499,7 +498,7 @@ $(eval $(call PyPackage,python-readline)) $(eval $(call PyPackage,python-ncurses)) $(eval $(call BuildPackage,python)) -$(eval $(call BuildPackage,python-mini)) +$(eval $(call BuildPackage,python-full)) $(eval $(call BuildPackage,python-doc)) $(eval $(call BuildPackage,python-bzip2)) $(eval $(call BuildPackage,python-expat)) From 7bf1ae65a89e380ce20ef5ab13b1a7276d6f7047 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Fri, 26 Sep 2014 16:50:16 +0300 Subject: [PATCH 4/5] python: upgrade to version 3.4.1 Some notes: - Python 3 (at least version 3.4) is pretty cross-compiler-friendly, so a lot of patches were thrown away. - Arguments below were moved to ./files/config.site file, and disabled ac_cv_have_chflags=no \ ac_cv_have_lchflags=no \ ac_cv_py_format_size_t=no \ ac_cv_have_long_long_format=yes \ ac_cv_buggy_getaddrinfo=no \ - --without-ensurepip added, because the build wants to ensure that it works; that's a good idea, but for now, it requires special setup, and we can do that later - --without-pymalloc added, becase in Python 3, modules are suffixed with m; e.g. so some paths are python3.4m instead of python3.4 all this is detailed here: http://legacy.python.org/dev/peps/pep-3149/ Maybe it will be a good idea to re-add this back Signed-off-by: Alexandru Ardelean --- lang/python/Makefile | 61 ++++++---- lang/python/files/config.site | 18 +++ lang/python/files/python-package.mk | 3 +- lang/python/patches/000-cross-compile.patch | 112 ------------------ .../020-dont-compile-python-files.patch | 33 ------ .../patches/030-fixup-include-dirs.patch | 50 -------- ...0-dont-import-cross-compiled-modules.patch | 43 ------- .../patches/070-dont-clean-ipkg-install.patch | 23 ---- .../080-distutils-dont_adjust_files.patch | 63 ---------- lang/python/patches/110-enable-zlib.patch | 14 ++- ...0-force-internal-modules-for-hashlib.patch | 25 ---- lang/python/patches/130-readline-setup.patch | 36 ------ .../patches/140-verbose-sharedmods.patch | 11 -- lang/python/patches/150-no-sqlite-rpath.patch | 10 -- 14 files changed, 68 insertions(+), 434 deletions(-) create mode 100644 lang/python/files/config.site delete mode 100644 lang/python/patches/000-cross-compile.patch delete mode 100644 lang/python/patches/020-dont-compile-python-files.patch delete mode 100644 lang/python/patches/030-fixup-include-dirs.patch delete mode 100644 lang/python/patches/040-dont-import-cross-compiled-modules.patch delete mode 100644 lang/python/patches/070-dont-clean-ipkg-install.patch delete mode 100644 lang/python/patches/080-distutils-dont_adjust_files.patch delete mode 100644 lang/python/patches/120-force-internal-modules-for-hashlib.patch delete mode 100644 lang/python/patches/130-readline-setup.patch delete mode 100644 lang/python/patches/140-verbose-sharedmods.patch delete mode 100644 lang/python/patches/150-no-sqlite-rpath.patch diff --git a/lang/python/Makefile b/lang/python/Makefile index 490dd9c3f..6c43b3f6d 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -7,13 +7,16 @@ include $(TOPDIR)/rules.mk +# The file included below defines PYTHON_VERSION +-include $(if $(DUMP),,./files/python-package.mk) + PKG_NAME:=python -PKG_VERSION:=2.7.3 -PKG_RELEASE:=2 +PKG_RELEASE:=1 +PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION) -PKG_MD5SUM:=62c4c1699170078c469f79ddfed21bc0 +PKG_MD5SUM:=6cafc183b4106476dd73d5738d7f616a 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 @@ -29,7 +32,6 @@ PKG_BUILD_DEPENDS:=python/host include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk --include $(if $(DUMP),,./files/python-package.mk) define Package/python/Default SUBMENU:=Python @@ -139,34 +141,47 @@ MAKE_FLAGS:=\ CROSS_COMPILE=yes \ CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \ LDFLAGS="$(TARGET_LDFLAGS)" \ - LD="$(TARGET_CC)" \ - HOSTPYTHON=./hostpython \ - HOSTPGEN=./hostpgen + LD="$(TARGET_CC)" ENABLE_IPV6:= ifeq ($(CONFIG_IPV6),y) ENABLE_IPV6 += --enable-ipv6 endif +#======================================================================= +# Notes: adding these so that I don't forget, and can track why stuff +# was did as was did +# - Arguments below were moved to ./files/config.site file, and disabled +# ac_cv_have_chflags=no \ +# ac_cv_have_lchflags=no \ +# ac_cv_py_format_size_t=no \ +# ac_cv_have_long_long_format=yes \ +# ac_cv_buggy_getaddrinfo=no \ +# - --without-ensurepip added, because the build wants to ensure that +# it works; that's a good idea, but for now, it requires special +# setup, and we can do that later +# - --without-pymalloc added, becase in Python 3, modules are suffixed +# with m; e.g. so some paths are python3.4m instead of python3.4 +# all this is detailed here: +# http://legacy.python.org/dev/peps/pep-3149/ +#======================================================================= + define Build/Configure -$(MAKE) -C $(PKG_BUILD_DIR) distclean (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0) # The python executable needs to stay in the rootdir since its location will # be used to compute the path of the config files. - $(CP) $(STAGING_DIR_HOST)/bin/pgen $(PKG_BUILD_DIR)/hostpgen - $(CP) $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) $(PKG_BUILD_DIR)/hostpython + $(CP) ./files/config.site $(PKG_BUILD_DIR) $(call Build/Configure/Default, \ --sysconfdir=/etc \ --disable-shared \ --without-cxx-main \ --with-threads \ --with-system-ffi="$(STAGING_DIR)/usr" \ + --without-ensurepip \ + --without-pymalloc \ $(ENABLE_IPV6) \ - ac_cv_have_chflags=no \ - ac_cv_have_lchflags=no \ - ac_cv_py_format_size_t=no \ - ac_cv_have_long_long_format=yes \ - ac_cv_buggy_getaddrinfo=no \ + CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \ OPT="$(TARGET_CFLAGS)" \ ) endef @@ -183,16 +198,9 @@ define Build/InstallDev $(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \ $(1)/usr/lib/ $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \ + $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \ $(1)/usr/lib/python$(PYTHON_VERSION)/ - $(CP) \ - $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) \ - $(1)/usr/bin/hostpython - (cd $(2)/bin; \ - ln -sf ../../usr/bin/hostpython python$(PYTHON_VERSION); \ - ln -sf python$(PYTHON_VERSION) python) - $(CP) \ $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \ $(2)/bin/ @@ -461,7 +469,12 @@ define Host/Configure rm -rf config.cache; \ CONFIG_SITE= \ OPT="$(HOST_CFLAGS)" \ - ./configure --without-cxx-main --with-threads --prefix=$(STAGING_DIR_HOST); \ + ./configure \ + --without-cxx-main \ + --without-ensurepip \ + --without-pymalloc \ + --with-threads \ + --prefix=$(STAGING_DIR_HOST); \ ) endef @@ -469,14 +482,12 @@ define Host/Compile +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ python Parser/pgen +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ - HOSTPYTHON=$(HOST_BUILD_DIR)/python \ sharedmods endef define Host/Install $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(MAKE) -C $(HOST_BUILD_DIR) \ - HOSTPYTHON=$(HOST_BUILD_DIR)/python \ install $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/ endef diff --git a/lang/python/files/config.site b/lang/python/files/config.site new file mode 100644 index 000000000..f4113357a --- /dev/null +++ b/lang/python/files/config.site @@ -0,0 +1,18 @@ +#! /bin/sh +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +ac_cv_file__dev_ptmx=yes +ac_cv_file__dev_ptc=no + +# FIXME: moved from Makefile here +#ac_cv_have_chflags=no \ +#ac_cv_have_lchflags=no \ +#ac_cv_py_format_size_t=no \ +#ac_cv_have_long_long_format=yes \ +#ac_cv_buggy_getaddrinfo=no \ + diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index 88ae11435..3a49bc089 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -5,7 +5,8 @@ # See /LICENSE for more information. # -PYTHON_VERSION=2.7 +PYTHON_VERSION=3.4 +PYTHON_VERSION_MICRO=1 PYTHON_DIR:=$(STAGING_DIR)/usr PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin diff --git a/lang/python/patches/000-cross-compile.patch b/lang/python/patches/000-cross-compile.patch deleted file mode 100644 index a6f208e87..000000000 --- a/lang/python/patches/000-cross-compile.patch +++ /dev/null @@ -1,112 +0,0 @@ ---- - Makefile.pre.in | 25 +++++++++++++------------ - 1 file changed, 13 insertions(+), 12 deletions(-) - ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ - - PYTHON= python$(EXE) - BUILDPYTHON= python$(BUILDEXE) -+HOSTPYTHON= $(BUILDPYTHON) - - # The task to run while instrument when building the profile-opt target - PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck -@@ -214,6 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ - ########################################################################## - # Parser - PGEN= Parser/pgen$(EXE) -+HOSTPGEN= $(PGEN)$(EXE) - - POBJS= \ - Parser/acceler.o \ -@@ -384,7 +386,7 @@ build_all_generate_profile: - $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov" - - run_profile_task: -- ./$(BUILDPYTHON) $(PROFILE_TASK) -+ $(HOSTPYTHON) $(PROFILE_TASK) - - build_all_use_profile: - $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use" -@@ -402,14 +404,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA - $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) - - platform: $(BUILDPYTHON) -- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform -+ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform - - - # Build the shared modules - sharedmods: $(BUILDPYTHON) - @case $$MAKEFLAGS in \ -- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ -- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ -+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ -+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ - esac - - # Build static library -@@ -543,7 +545,7 @@ Modules/python.o: $(srcdir)/Modules/pyth - $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp - Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) - -@$(INSTALL) -d Include -- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) - -touch Parser/pgen.stamp - - $(PGEN): $(PGENOBJS) -@@ -708,7 +710,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho - - TESTOPTS= -l $(EXTRATESTOPTS) - TESTPROG= $(srcdir)/Lib/test/regrtest.py --TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) -+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) - test: all platform - -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f - -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -@@ -1062,7 +1064,7 @@ libainstall: all python-config - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ -+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -@@ -1100,7 +1102,7 @@ frameworkinstallstructure: $(LDLIBRARY) - fi; \ - done - $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers -- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist -+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist - $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current - $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) - $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers -@@ -1135,7 +1137,7 @@ frameworkinstallextras: - # This installs a few of the useful scripts in Tools/scripts - scriptsinstall: - SRCDIR=$(srcdir) $(RUNSHARED) \ -- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ -+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --root=$(DESTDIR)/ -@@ -1157,7 +1159,7 @@ config.status: $(srcdir)/configure - - # Run reindent on the library - reindent: -- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib -+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib - - # Rerun configure with the same options as it was run last time, - # provided the config.status script exists -@@ -1260,7 +1262,7 @@ funny: - - # Perform some verification checks on any modified files. - patchcheck: -- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py -+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py - - # Dependencies - diff --git a/lang/python/patches/020-dont-compile-python-files.patch b/lang/python/patches/020-dont-compile-python-files.patch deleted file mode 100644 index 57bd51d95..000000000 --- a/lang/python/patches/020-dont-compile-python-files.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - Makefile.pre.in | 16 ---------------- - 1 file changed, 16 deletions(-) - ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -940,26 +940,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL - $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ - $(DESTDIR)$(LIBDEST)/distutils/tests ; \ - fi -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST) -f \ -- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ -- $(DESTDIR)$(LIBDEST) -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -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) \ -- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST)/site-packages -f \ -- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -- -d $(LIBDEST)/site-packages -f \ -- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" - - # Create the PLATDIR source directory, if one wasn't distributed.. - $(srcdir)/Lib/$(PLATDIR): diff --git a/lang/python/patches/030-fixup-include-dirs.patch b/lang/python/patches/030-fixup-include-dirs.patch deleted file mode 100644 index 6cc6bba74..000000000 --- a/lang/python/patches/030-fixup-include-dirs.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- - setup.py | 15 ++------------- - 1 file changed, 2 insertions(+), 13 deletions(-) - ---- a/setup.py -+++ b/setup.py -@@ -368,11 +368,6 @@ class PyBuildExt(build_ext): - os.unlink(tmpfile) - - def detect_modules(self): -- # Ensure that /usr/local is always used -- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -- self.add_multiarch_paths() -- - # Add paths specified in the environment variables LDFLAGS and - # CPPFLAGS for header and library files. - # We must get the values from the Makefile and not the environment -@@ -407,17 +402,6 @@ class PyBuildExt(build_ext): - for directory in reversed(options.dirs): - add_dir_to_list(dir_list, directory) - -- if os.path.normpath(sys.prefix) != '/usr' \ -- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): -- # 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 -- # the one that is currently installed (issue #7473) -- add_dir_to_list(self.compiler.library_dirs, -- sysconfig.get_config_var("LIBDIR")) -- add_dir_to_list(self.compiler.include_dirs, -- sysconfig.get_config_var("INCLUDEDIR")) -- - try: - have_unicode = unicode - except NameError: -@@ -426,11 +410,8 @@ class PyBuildExt(build_ext): - # lib_dirs and inc_dirs are used to search for files; - # if a file is found in one of those directories, it can - # be assumed that no additional -I,-L directives are needed. -- lib_dirs = self.compiler.library_dirs + [ -- '/lib64', '/usr/lib64', -- '/lib', '/usr/lib', -- ] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] -+ lib_dirs = self.compiler.library_dirs -+ inc_dirs = self.compiler.include_dirs - exts = [] - missing = [] - diff --git a/lang/python/patches/040-dont-import-cross-compiled-modules.patch b/lang/python/patches/040-dont-import-cross-compiled-modules.patch deleted file mode 100644 index 1793569f9..000000000 --- a/lang/python/patches/040-dont-import-cross-compiled-modules.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- - setup.py | 30 ------------------------------ - 1 file changed, 30 deletions(-) - ---- a/setup.py -+++ b/setup.py -@@ -307,36 +307,6 @@ class PyBuildExt(build_ext): - ext_filename = os.path.join( - self.build_lib, - self.get_ext_filename(self.get_ext_fullname(ext.name))) -- try: -- imp.load_dynamic(ext.name, ext_filename) -- except ImportError, why: -- self.failed.append(ext.name) -- self.announce('*** WARNING: renaming "%s" since importing it' -- ' failed: %s' % (ext.name, why), level=3) -- assert not self.inplace -- basename, tail = os.path.splitext(ext_filename) -- newname = basename + "_failed" + tail -- if os.path.exists(newname): -- os.remove(newname) -- os.rename(ext_filename, newname) -- -- # XXX -- This relies on a Vile HACK in -- # distutils.command.build_ext.build_extension(). The -- # _built_objects attribute is stored there strictly for -- # use here. -- # If there is a failure, _built_objects may not be there, -- # so catch the AttributeError and move on. -- try: -- for filename in self._built_objects: -- os.remove(filename) -- except AttributeError: -- self.announce('unable to remove files (ignored)') -- except: -- exc_type, why, tb = sys.exc_info() -- self.announce('*** WARNING: importing extension "%s" ' -- 'failed with %s: %s' % (ext.name, exc_type, why), -- level=3) -- self.failed.append(ext.name) - - def get_platform(self): - # Get value of sys.platform diff --git a/lang/python/patches/070-dont-clean-ipkg-install.patch b/lang/python/patches/070-dont-clean-ipkg-install.patch deleted file mode 100644 index 0796c19d6..000000000 --- a/lang/python/patches/070-dont-clean-ipkg-install.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- - Makefile.pre.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1169,12 +1169,12 @@ TAGS:: - # Sanitation targets -- clean leaves libraries, executables and tags - # files, which clobber removes as well - pycremoval: -- find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' -+ find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';' - - clean: pycremoval -- find . -name '*.[oa]' -exec rm -f {} ';' -- find . -name '*.s[ol]' -exec rm -f {} ';' -- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' -+ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';' -+ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';' -+ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' - find build -name 'fficonfig.h' -exec rm -f {} ';' || true - find build -name 'fficonfig.py' -exec rm -f {} ';' || true - -rm -f Lib/lib2to3/*Grammar*.pickle diff --git a/lang/python/patches/080-distutils-dont_adjust_files.patch b/lang/python/patches/080-distutils-dont_adjust_files.patch deleted file mode 100644 index 97d62fb3a..000000000 --- a/lang/python/patches/080-distutils-dont_adjust_files.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- - Lib/distutils/command/build_scripts.py | 43 +++------------------------------ - 1 file changed, 4 insertions(+), 39 deletions(-) - ---- a/Lib/distutils/command/build_scripts.py -+++ b/Lib/distutils/command/build_scripts.py -@@ -51,10 +51,7 @@ class build_scripts (Command): - - - def copy_scripts (self): -- """Copy each script listed in 'self.scripts'; if it's marked as a -- Python script in the Unix way (first line matches 'first_line_re', -- ie. starts with "\#!" and contains "python"), then adjust the first -- line to refer to the current Python interpreter as we copy. -+ """Copy each script listed in 'self.scripts' - """ - _sysconfig = __import__('sysconfig') - self.mkpath(self.build_dir) -@@ -78,41 +75,9 @@ class build_scripts (Command): - if not self.dry_run: - raise - f = None -- else: -- first_line = f.readline() -- if not first_line: -- self.warn("%s is an empty file (skipping)" % script) -- continue -- -- match = first_line_re.match(first_line) -- if match: -- adjust = 1 -- post_interp = match.group(1) or '' -- -- if adjust: -- log.info("copying and adjusting %s -> %s", script, -- self.build_dir) -- if not self.dry_run: -- outf = open(outfile, "w") -- if not _sysconfig.is_python_build(): -- outf.write("#!%s%s\n" % -- (self.executable, -- post_interp)) -- else: -- outf.write("#!%s%s\n" % -- (os.path.join( -- _sysconfig.get_config_var("BINDIR"), -- "python%s%s" % (_sysconfig.get_config_var("VERSION"), -- _sysconfig.get_config_var("EXE"))), -- post_interp)) -- outf.writelines(f.readlines()) -- outf.close() -- if f: -- f.close() -- else: -- if f: -- f.close() -- self.copy_file(script, outfile) -+ if f: -+ f.close() -+ self.copy_file(script, outfile) - - if os.name == 'posix': - for file in outfiles: diff --git a/lang/python/patches/110-enable-zlib.patch b/lang/python/patches/110-enable-zlib.patch index cdc70733c..780831e86 100644 --- a/lang/python/patches/110-enable-zlib.patch +++ b/lang/python/patches/110-enable-zlib.patch @@ -1,10 +1,17 @@ +From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001 +From: Alexandru Ardelean +Date: Thu, 25 Sep 2014 18:18:29 +0300 +Subject: [PATCH] enable zlib + --- - Modules/Setup.dist | 2 +- + Modules/Setup.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/Modules/Setup.dist b/Modules/Setup.dist +index 01fb85f..01ac492 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist -@@ -460,7 +460,7 @@ GLHACK=-Dclear=__GLclear +@@ -358,7 +358,7 @@ _symtable symtablemodule.c # Andrew Kuchling's zlib module. # This require zlib 1.1.3 (or later). # See http://www.gzip.org/zlib/ @@ -13,3 +20,6 @@ # Interface to the Expat XML parser # +-- +1.8.4.5 + diff --git a/lang/python/patches/120-force-internal-modules-for-hashlib.patch b/lang/python/patches/120-force-internal-modules-for-hashlib.patch deleted file mode 100644 index ad10a4401..000000000 --- a/lang/python/patches/120-force-internal-modules-for-hashlib.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- - setup.py | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - ---- a/setup.py -+++ b/setup.py -@@ -704,8 +704,7 @@ class PyBuildExt(build_ext): - - min_openssl_ver = 0x00907000 - have_any_openssl = ssl_incs is not None and ssl_libs is not None -- have_usable_openssl = (have_any_openssl and -- openssl_ver >= min_openssl_ver) -+ have_usable_openssl = False - - if have_any_openssl: - if have_usable_openssl: -@@ -730,7 +729,7 @@ class PyBuildExt(build_ext): - depends = ['md5.h']) ) - - min_sha2_openssl_ver = 0x00908000 -- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver: -+ if True: - # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash - exts.append( Extension('_sha256', ['sha256module.c']) ) - exts.append( Extension('_sha512', ['sha512module.c']) ) diff --git a/lang/python/patches/130-readline-setup.patch b/lang/python/patches/130-readline-setup.patch deleted file mode 100644 index c19dbb279..000000000 --- a/lang/python/patches/130-readline-setup.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -573,32 +573,7 @@ class PyBuildExt(build_ext): - # readline - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') - readline_termcap_library = "" -- curses_library = "" -- # Determine if readline is already linked against curses or tinfo. -- if do_readline and find_executable('ldd'): -- fp = os.popen("ldd %s" % do_readline) -- ldd_output = fp.readlines() -- ret = fp.close() -- if ret is None or ret >> 8 == 0: -- for ln in ldd_output: -- if 'curses' in ln: -- readline_termcap_library = re.sub( -- r'.*lib(n?cursesw?)\.so.*', r'\1', ln -- ).rstrip() -- break -- if 'tinfo' in ln: # termcap interface split out from ncurses -- readline_termcap_library = 'tinfo' -- break -- # Issue 7384: If readline is already linked against curses, -- # 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, 'ncurses'): -- curses_library = 'ncurses' -- elif self.compiler.find_library_file(lib_dirs, 'curses'): -- curses_library = 'curses' -+ curses_library = "ncurses" - - if platform == 'darwin': - os_release = int(os.uname()[2].split('.')[0]) diff --git a/lang/python/patches/140-verbose-sharedmods.patch b/lang/python/patches/140-verbose-sharedmods.patch deleted file mode 100644 index a761c344b..000000000 --- a/lang/python/patches/140-verbose-sharedmods.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -410,7 +410,7 @@ platform: $(BUILDPYTHON) - # Build the shared modules - sharedmods: $(BUILDPYTHON) - @case $$MAKEFLAGS in \ -- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ -+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ - esac - diff --git a/lang/python/patches/150-no-sqlite-rpath.patch b/lang/python/patches/150-no-sqlite-rpath.patch deleted file mode 100644 index 4f0ec41b5..000000000 --- a/lang/python/patches/150-no-sqlite-rpath.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -1021,7 +1021,6 @@ class PyBuildExt(build_ext): - include_dirs=["Modules/_sqlite", - sqlite_incdir], - library_dirs=sqlite_libdir, -- runtime_library_dirs=sqlite_libdir, - extra_link_args=sqlite_extra_link_args, - libraries=["sqlite3",])) - else: From 4ed312143a6960e37b44948c14121336ac1e01a4 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sat, 4 Oct 2014 18:02:36 +0300 Subject: [PATCH 5/5] python: reset packages and start off with minimal python Signed-off-by: Alexandru Ardelean --- lang/python/Makefile | 343 ++----------------------------------------- 1 file changed, 10 insertions(+), 333 deletions(-) diff --git a/lang/python/Makefile b/lang/python/Makefile index 6c43b3f6d..51268773f 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -59,80 +59,7 @@ endef define Package/python/description $(call Package/python/Default/description) . - This package contains only a minimal Python install. -endef - -define Package/python-full -$(call Package/python/Default) - TITLE+= (full) - DEPENDS:=@PACKAGE_python +PACKAGE_python:python -endef - -define Package/python-full/description -$(call Package/python/Default/description) - . - This package contains the full Python install. -endef - -define Package/python-doc -$(call Package/python/Default) - TITLE:=Python interactive documentation - DEPENDS:=@PACKAGE_python +PACKAGE_python:python -endef - -define Package/python-bzip2 -$(call Package/python/Default) - TITLE:=Python support for Bzip2 - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libbz2 -endef - -define Package/python-expat -$(call Package/python/Default) - TITLE:=Python support for expat - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libexpat -endef - -define Package/python-gzip -$(call Package/python/Default) - TITLE:=Python support for gzip - DEPENDS:=@PACKAGE_python +PACKAGE_python:python -endef - -define Package/python-openssl -$(call Package/python/Default) - TITLE:=Python support for OpenSSL - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libopenssl -endef - -define Package/python-shutil -$(call Package/python/Default) - TITLE:=Python support for shutil - DEPENDS:=@PACKAGE_python +PACKAGE_python:python -endef - -# Needs datetime -define Package/python-sqlite3 -$(call Package/python/Default) - TITLE:=Python support for sqlite3 - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libsqlite3 -endef - -define Package/python-gdbm -$(call Package/python/Default) - TITLE:=Python support for gdbm - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libgdbm -endef - -define Package/python-readline -$(call Package/python/Default) - TITLE:=Python support for readline - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libreadline +libncurses @BROKEN -endef - -define Package/python-ncurses -$(call Package/python/Default) - TITLE:=Python support for readline - DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libncurses + This package contains only the interpreter and the bare minimum for the interpreter to start. endef MAKE_FLAGS:=\ @@ -210,258 +137,30 @@ define Build/InstallDev ln -sf python$(PYTHON_VERSION)-config python-config;) endef -define PyPackage/python-full/filespec -+|/usr/lib/python$(PYTHON_VERSION) --|/usr/lib/python$(PYTHON_VERSION)/bsddb/test --|/usr/lib/python$(PYTHON_VERSION)/config --|/usr/lib/python$(PYTHON_VERSION)/ctypes/test --|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst-*.exe --|/usr/lib/python$(PYTHON_VERSION)/distutils/tests --|/usr/lib/python$(PYTHON_VERSION)/email/test --|/usr/lib/python$(PYTHON_VERSION)/idlelib --|/usr/lib/python$(PYTHON_VERSION)/json/tests --|/usr/lib/python$(PYTHON_VERSION)/lib-tk --|/usr/lib/python$(PYTHON_VERSION)/sqlite3 --|/usr/lib/python$(PYTHON_VERSION)/test --|/usr/lib/python$(PYTHON_VERSION)/lib2to3 --|/usr/lib/python$(PYTHON_VERSION)/lib-old --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so --|/usr/lib/python$(PYTHON_VERSION)/pydoc_data --|/usr/lib/python$(PYTHON_VERSION)/pydoc.py --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so --|/usr/lib/python$(PYTHON_VERSION)/__future__.py --|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py --|/usr/lib/python$(PYTHON_VERSION)/abc.py --|/usr/lib/python$(PYTHON_VERSION)/codecs.py --|/usr/lib/python$(PYTHON_VERSION)/compileall.py --|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py --|/usr/lib/python$(PYTHON_VERSION)/copy.py --|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py --|/usr/lib/python$(PYTHON_VERSION)/dis.py --|/usr/lib/python$(PYTHON_VERSION)/encodings --|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py --|/usr/lib/python$(PYTHON_VERSION)/genericpath.py --|/usr/lib/python$(PYTHON_VERSION)/getopt.py --|/usr/lib/python$(PYTHON_VERSION)/glob.py --|/usr/lib/python$(PYTHON_VERSION)/hashlib.py --|/usr/lib/python$(PYTHON_VERSION)/inspect.py --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so --|/usr/lib/python$(PYTHON_VERSION)/linecache.py --|/usr/lib/python$(PYTHON_VERSION)/md5.py --|/usr/lib/python$(PYTHON_VERSION)/new.py --|/usr/lib/python$(PYTHON_VERSION)/opcode.py --|/usr/lib/python$(PYTHON_VERSION)/optparse.py --|/usr/lib/python$(PYTHON_VERSION)/os.py --|/usr/lib/python$(PYTHON_VERSION)/pickle.py --|/usr/lib/python$(PYTHON_VERSION)/pickle.py --|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py --|/usr/lib/python$(PYTHON_VERSION)/popen2.py --|/usr/lib/python$(PYTHON_VERSION)/posixpath.py --|/usr/lib/python$(PYTHON_VERSION)/py_compile.py --|/usr/lib/python$(PYTHON_VERSION)/random.py --|/usr/lib/python$(PYTHON_VERSION)/repr.py --|/usr/lib/python$(PYTHON_VERSION)/re.py --|/usr/lib/python$(PYTHON_VERSION)/sha.py --|/usr/lib/python$(PYTHON_VERSION)/site.py --|/usr/lib/python$(PYTHON_VERSION)/socket.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)/sre.py --|/usr/lib/python$(PYTHON_VERSION)/stat.py --|/usr/lib/python$(PYTHON_VERSION)/StringIO.py --|/usr/lib/python$(PYTHON_VERSION)/stringprep.py --|/usr/lib/python$(PYTHON_VERSION)/string.py --|/usr/lib/python$(PYTHON_VERSION)/struct.py --|/usr/lib/python$(PYTHON_VERSION)/subprocess.py --|/usr/lib/python$(PYTHON_VERSION)/tempfile.py --|/usr/lib/python$(PYTHON_VERSION)/textwrap.py --|/usr/lib/python$(PYTHON_VERSION)/tokenize.py --|/usr/lib/python$(PYTHON_VERSION)/token.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 --|/usr/lib/python$(PYTHON_VERSION)/weakref.py --|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py --|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py --|/usr/lib/python$(PYTHON_VERSION)/functools.py --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so --|/usr/lib/python$(PYTHON_VERSION)/collections.py --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so --|/usr/lib/python$(PYTHON_VERSION)/keyword.py --|/usr/lib/python$(PYTHON_VERSION)/heapq.py --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so --|/usr/lib/python$(PYTHON_VERSION)/bisect.py --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so -endef - define PyPackage/python/filespec +|/usr/bin/python$(PYTHON_VERSION) -+|/usr/lib/python$(PYTHON_VERSION)/__future__.py -+|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py ++|/usr/lib/python$(PYTHON_VERSION)/encodings ++|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py ++|/usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.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)/codecs.py -+|/usr/lib/python$(PYTHON_VERSION)/compileall.py -+|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py -+|/usr/lib/python$(PYTHON_VERSION)/copy.py -+|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py -+|/usr/lib/python$(PYTHON_VERSION)/dis.py -+|/usr/lib/python$(PYTHON_VERSION)/encodings -+|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py +|/usr/lib/python$(PYTHON_VERSION)/genericpath.py -+|/usr/lib/python$(PYTHON_VERSION)/getopt.py -+|/usr/lib/python$(PYTHON_VERSION)/glob.py -+|/usr/lib/python$(PYTHON_VERSION)/hashlib.py -+|/usr/lib/python$(PYTHON_VERSION)/inspect.py -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so -+|/usr/lib/python$(PYTHON_VERSION)/linecache.py -+|/usr/lib/python$(PYTHON_VERSION)/md5.py -+|/usr/lib/python$(PYTHON_VERSION)/new.py -+|/usr/lib/python$(PYTHON_VERSION)/opcode.py -+|/usr/lib/python$(PYTHON_VERSION)/optparse.py ++|/usr/lib/python$(PYTHON_VERSION)/io.py +|/usr/lib/python$(PYTHON_VERSION)/os.py -+|/usr/lib/python$(PYTHON_VERSION)/pickle.py -+|/usr/lib/python$(PYTHON_VERSION)/pickle.py -+|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py -+|/usr/lib/python$(PYTHON_VERSION)/popen2.py +|/usr/lib/python$(PYTHON_VERSION)/posixpath.py -+|/usr/lib/python$(PYTHON_VERSION)/py_compile.py -+|/usr/lib/python$(PYTHON_VERSION)/random.py -+|/usr/lib/python$(PYTHON_VERSION)/repr.py -+|/usr/lib/python$(PYTHON_VERSION)/re.py -+|/usr/lib/python$(PYTHON_VERSION)/sha.py +|/usr/lib/python$(PYTHON_VERSION)/site.py -+|/usr/lib/python$(PYTHON_VERSION)/socket.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)/sre.py -+|/usr/lib/python$(PYTHON_VERSION)/stat.py -+|/usr/lib/python$(PYTHON_VERSION)/StringIO.py -+|/usr/lib/python$(PYTHON_VERSION)/stringprep.py -+|/usr/lib/python$(PYTHON_VERSION)/string.py -+|/usr/lib/python$(PYTHON_VERSION)/struct.py -+|/usr/lib/python$(PYTHON_VERSION)/subprocess.py -+|/usr/lib/python$(PYTHON_VERSION)/tempfile.py -+|/usr/lib/python$(PYTHON_VERSION)/textwrap.py -+|/usr/lib/python$(PYTHON_VERSION)/tokenize.py -+|/usr/lib/python$(PYTHON_VERSION)/token.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 -+|/usr/lib/python$(PYTHON_VERSION)/weakref.py -+|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py -+|/usr/lib/python$(PYTHON_VERSION)/config/Makefile +|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py -+|/usr/lib/python$(PYTHON_VERSION)/functools.py -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so -+|/usr/lib/python$(PYTHON_VERSION)/collections.py -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so -+|/usr/lib/python$(PYTHON_VERSION)/keyword.py -+|/usr/lib/python$(PYTHON_VERSION)/heapq.py -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so -+|/usr/lib/python$(PYTHON_VERSION)/bisect.py -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so -+|/usr/include/python$(PYTHON_VERSION)/pyconfig.h ++|/usr/lib/python$(PYTHON_VERSION)/stat.py endef define PyPackage/python/install + # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python + $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/ ln -sf python$(PYTHON_VERSION) $(1)/usr/bin/python endef -define PyPackage/python-doc/filespec -+|/usr/lib/python$(PYTHON_VERSION)/pydoc_data -+|/usr/lib/python$(PYTHON_VERSION)/pydoc.py -endef - -define PyPackage/python-bzip2/filespec -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so -endef - -define PyPackage/python-expat/filespec -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so -endef - -define PyPackage/python-gzip/filespec -+|/usr/lib/python$(PYTHON_VERSION)/gzip.py -endef - -define PyPackage/python-openssl/filespec -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so -endef - -define PyPackage/python-shutil/filespec -+|/usr/lib/python$(PYTHON_VERSION)/shutil.py -endef - -define PyPackage/python-sqlite3/filespec -+|/usr/lib/python$(PYTHON_VERSION)/sqlite3 -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so -endef - -define PyPackage/python-gdbm/filespec -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so -endef - -define PyPackage/python-readline/filespec -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so -endef - -define PyPackage/python-ncurses/filespec -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so -endef - define Host/Configure -$(MAKE) -C $(HOST_BUILD_DIR) distclean (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0) @@ -496,27 +195,5 @@ endef $(eval $(call HostBuild)) $(eval $(call PyPackage,python)) -$(eval $(call PyPackage,python-full)) -$(eval $(call PyPackage,python-doc)) -$(eval $(call PyPackage,python-bzip2)) -$(eval $(call PyPackage,python-expat)) -$(eval $(call PyPackage,python-gzip)) -$(eval $(call PyPackage,python-openssl)) -$(eval $(call PyPackage,python-shutil)) -$(eval $(call PyPackage,python-sqlite3)) -$(eval $(call PyPackage,python-gdbm)) -$(eval $(call PyPackage,python-readline)) -$(eval $(call PyPackage,python-ncurses)) $(eval $(call BuildPackage,python)) -$(eval $(call BuildPackage,python-full)) -$(eval $(call BuildPackage,python-doc)) -$(eval $(call BuildPackage,python-bzip2)) -$(eval $(call BuildPackage,python-expat)) -$(eval $(call BuildPackage,python-gzip)) -$(eval $(call BuildPackage,python-openssl)) -$(eval $(call BuildPackage,python-shutil)) -$(eval $(call BuildPackage,python-sqlite3)) -$(eval $(call BuildPackage,python-gdbm)) -$(eval $(call BuildPackage,python-readline)) -$(eval $(call BuildPackage,python-ncurses))