Merge pull request #19372 from cotequeiroz/libgd
[feed/packages.git] / lang / python / python3 / Makefile
index 121a2905435676c2c479d3b0a162577262e43495..003653cc17c8b21674c01c4eb55480d2b698d074 100644 (file)
@@ -16,10 +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)
-PKG_HASH:=0c5a140665436ec3dbfbb79e2dfb6d192655f26ef4a29aeffcb6d1820d716d83
+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
 
@@ -40,11 +40,10 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_python3-pkg-resources \
-       CONFIG_PACKAGE_python3-setuptools CONFIG_PACKAGE_python3-pip \
-       CONFIG_PYTHON3_BLUETOOTH_SUPPORT
+       CONFIG_PACKAGE_python3-setuptools CONFIG_PACKAGE_python3-pip
 
-PKG_BUILD_DEPENDS:=python3/host
-HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host
+PKG_BUILD_DEPENDS:=bluez python3/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 +PYTHON3_BLUETOOTH_SUPPORT:bluez-libs +libuuid
+  DEPENDS:=+python3-base +libffi +libbz2
 endef
 
 define Package/python3-light/config
@@ -136,21 +135,21 @@ 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
 
-DISABLE_BLUETOOTH:= \
-       ac_cv_header_bluetooth_bluetooth_h=no \
-       ac_cv_header_bluetooth_h=no
+# 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 \
@@ -159,11 +158,11 @@ 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" \
-       OPT="$(TARGET_CFLAGS)" \
-       $(if $(CONFIG_PYTHON3_BLUETOOTH_SUPPORT),,$(DISABLE_BLUETOOTH))
+       OPT="$(TARGET_CFLAGS)"
 
 define Build/Prepare
        $(call Build/Prepare/Default)
@@ -190,6 +189,10 @@ define Build/Compile/python3-setuptools
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl
        $(call PatchDir,$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-setuptools,)
 endef
+else
+define Build/Compile/python3-setuptools
+       ls $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl
+endef
 endif # CONFIG_PACKAGE_python3-setuptools
 
 ifdef CONFIG_PACKAGE_python3-pip
@@ -204,6 +207,10 @@ define Build/Compile/python3-pip
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl
        $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-pip,)
 endef
+else
+define Build/Compile/python3-pip
+       ls $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl
+endef
 endif # CONFIG_PACKAGE_python3-pip
 
 define Build/Compile
@@ -309,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
@@ -319,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