Merge pull request #19372 from cotequeiroz/libgd
[feed/packages.git] / lang / python / python3 / Makefile
index 93a1c335ec18906191f9a5ba2453c552fa6d4c29..003653cc17c8b21674c01c4eb55480d2b698d074 100644 (file)
@@ -16,11 +16,10 @@ PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-# FIXME: if updating, get rid of [1] & [2] asap
-PKG_HASH:=f8145616e68c00041d1a6399b76387390388f8359581abc24432bb969b5e3c57
+PKG_HASH:=8437efd5b106ef0a75aabfbf23d880625120a73a86a22ade4d2e2e68d7b74486
 
-PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>, Jeffery To <jeffery.to@gmail.com>
-PKG_LICENSE:=Python/2.0
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_LICENSE:=PSF-2.0
 PKG_LICENSE_FILES:=LICENSE Doc/copyright.rst Doc/license.rst Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi_osx/LICENSE Modules/expat/COPYING
 PKG_CPE_ID:=cpe:/a:python:python
 
@@ -44,7 +43,7 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_python3-setuptools CONFIG_PACKAGE_python3-pip
 
 PKG_BUILD_DEPENDS:=bluez python3/host
-HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host
+HOST_BUILD_DEPENDS:=bzip2/host libffi/host
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -91,7 +90,7 @@ endef
 define Package/python3-light
 $(call Package/python3/Default)
   TITLE:=Python $(PYTHON3_VERSION) light installation
-  DEPENDS:=+python3-base +libffi +libbz2 +libuuid
+  DEPENDS:=+python3-base +libffi +libbz2
 endef
 
 define Package/python3-light/config
@@ -136,18 +135,22 @@ define Package/python3/description
   It's python3-light + all other packages.
 endef
 
-TARGET_CONFIGURE_OPTS+= \
-       READELF="$(TARGET_CROSS)readelf"
-
-MAKE_FLAGS+=\
-       LD="$(TARGET_CC)"
-
-EXTRA_CFLAGS+= \
-       -DNDEBUG -fno-inline
 EXTRA_LDFLAGS+= \
        -L$(PKG_BUILD_DIR) \
        -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
 
+# Workaround for hardfloat mips
+# https://bugs.python.org/issue46265
+ifneq ($(findstring mips,$(CONFIG_ARCH)),)
+ifeq ($(CONFIG_HAS_FPU),y)
+CONFIGURE_VARS += \
+       ax_cv_check_cflags___fno_semantic_interposition=no
+endif
+endif
+
+MAKE_VARS += \
+       PYTHONSTRICTEXTENSIONBUILD=1
+
 CONFIGURE_ARGS+= \
        --enable-optimizations \
        --enable-shared \
@@ -155,6 +158,7 @@ CONFIGURE_ARGS+= \
        --without-cxx-main \
        --without-ensurepip \
        --without-pymalloc \
+       --disable-test-modules \
        $(if $(CONFIG_IPV6),--enable-ipv6) \
        $(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) \
        CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
@@ -201,14 +205,6 @@ define Build/Compile/python3-pip
                --root=$(PKG_BUILD_DIR)/install-pip \
                --prefix=/usr \
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl
-       # FIXME: [1] get rid of this asap; 'patch' doesn't like Windows endings, and this file is full of them...
-       #        I actually tried this in a number of ways and the only way to fix this is to implement
-       #        a poor-man's dos2unix using sed.
-       #        The issue is with the pip package; it seems that it throws in some Windows line-endings
-       #        and 'patch' won't handle them. So, we do a "dos2unix" and then patch.
-       #        We can get rid of this once this is solved upstream and in pip:
-       #            https://github.com/pypa/pep517/pull/130
-       sed 's/\r//' -i $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip/_vendor/pep517/in_process/__init__.py
        $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-pip,)
 endef
 else
@@ -320,6 +316,10 @@ HOST_LDFLAGS += \
        -Wl,--no-as-needed -lrt
 endif
 
+# Would be nice to be able to do this, but hosts are very fiddly
+# HOST_MAKE_VARS += \
+#      PYTHONSTRICTEXTENSIONBUILD=1
+
 ifeq ($(HOST_OS),Darwin)
 HOST_CONFIGURE_VARS += \
        ac_cv_header_libintl_h=no
@@ -330,9 +330,11 @@ endif
 HOST_CONFIGURE_ARGS+= \
        --enable-optimizations \
        --with-ensurepip=upgrade \
-       --with-system-expat=$(STAGING_DIR_HOSTPKG) \
+       --with-system-expat=$(STAGING_DIR_HOST) \
+       --with-ssl-default-suites=openssl \
        --without-cxx-main \
        --without-pymalloc \
+       --disable-test-modules \
        CONFIG_SITE=
 
 define Host/Configure
@@ -367,8 +369,6 @@ define Host/Install
                touch $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)
        )
        $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),,
-               # FIXME: [2] get rid of this asap; same as [1]
-               sed 's/\r//' -i $(HOST_PYTHON3_PKG_DIR)/pip/_vendor/pep517/in_process/__init__.py
                $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-pip,)
                touch $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)
        )