diff --git a/lang/python/Makefile b/lang/python/Makefile new file mode 100644 index 000000000..490dd9c3f --- /dev/null +++ b/lang/python/Makefile @@ -0,0 +1,511 @@ +# +# Copyright (C) 2006-2014 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/ + MAINTAINER:=Alexandru Ardelean +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) + DEPENDS:=+libpthread +zlib +libffi +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 +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-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)/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/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-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)) diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk new file mode 100644 index 000000000..88ae11435 --- /dev/null +++ b/lang/python/files/python-package.mk @@ -0,0 +1,77 @@ +# +# Copyright (C) 2007-2014 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: