2014-09-24 10:08:37 +02:00
|
|
|
#
|
2016-04-14 10:41:48 +02:00
|
|
|
# Copyright (C) 2006-2016 OpenWrt.org
|
2014-09-24 10:08:37 +02:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2020-04-17 17:47:25 +02:00
|
|
|
# The file included below defines PYTHON3_VERSION
|
2018-01-10 08:29:41 +01:00
|
|
|
include ../python3-version.mk
|
2014-09-26 15:50:16 +02:00
|
|
|
|
2014-10-13 12:21:16 +02:00
|
|
|
PKG_NAME:=python3
|
2023-06-12 08:10:01 +02:00
|
|
|
PKG_RELEASE:=1
|
2020-04-17 17:47:25 +02:00
|
|
|
PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO)
|
2014-09-24 10:08:37 +02:00
|
|
|
|
|
|
|
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
|
2015-06-11 18:37:39 +02:00
|
|
|
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
|
2023-06-12 08:10:01 +02:00
|
|
|
PKG_HASH:=2f0e409df2ab57aa9fc4cbddfb976af44e4e55bf6f619eee6bc5c2297264a7f6
|
2014-09-24 10:08:37 +02:00
|
|
|
|
2021-11-23 12:14:42 +01:00
|
|
|
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
|
2021-12-28 10:11:24 +01:00
|
|
|
PKG_LICENSE:=PSF-2.0
|
2019-05-20 23:20:43 +02:00
|
|
|
PKG_LICENSE_FILES:=LICENSE Doc/copyright.rst Doc/license.rst Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi_osx/LICENSE Modules/expat/COPYING
|
2019-03-09 21:04:00 +01:00
|
|
|
PKG_CPE_ID:=cpe:/a:python:python
|
2014-09-24 10:08:37 +02:00
|
|
|
|
2017-01-04 10:27:36 +01:00
|
|
|
# This file provides the necsessary host build variables
|
2018-01-10 08:29:41 +01:00
|
|
|
include ../python3-host.mk
|
2017-01-04 10:27:36 +01:00
|
|
|
|
|
|
|
# For Py3Package
|
2020-04-17 17:47:25 +02:00
|
|
|
PYTHON3_PKG_BUILD:=0
|
2018-01-10 08:29:41 +01:00
|
|
|
include ../python3-package.mk
|
2016-12-16 08:07:41 +01:00
|
|
|
|
2017-11-06 17:05:14 +01:00
|
|
|
PKG_FIXUP:=autoreconf
|
2014-09-24 10:08:37 +02:00
|
|
|
PKG_INSTALL:=1
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
HOST_BUILD_PARALLEL:=1
|
2023-01-30 18:02:32 +01:00
|
|
|
# LTO is handled here individually, see --with-lto below
|
|
|
|
# "no-lto" prevents CONFIG_USE_LTO to add additional and interfering flags
|
|
|
|
PKG_BUILD_FLAGS:=no-lto
|
2014-09-24 10:08:37 +02:00
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
|
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
|
|
|
|
|
2023-02-17 18:13:22 +01:00
|
|
|
PKG_BUILD_DEPENDS:=bluez python3/host python-build/host python-installer/host python-wheel/host
|
2021-10-19 01:10:33 +02:00
|
|
|
HOST_BUILD_DEPENDS:=bzip2/host libffi/host
|
2014-09-24 10:08:37 +02:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2014-10-13 12:21:16 +02:00
|
|
|
define Package/python3/Default
|
2014-09-24 10:08:37 +02:00
|
|
|
SUBMENU:=Python
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
2023-07-13 07:39:35 +02:00
|
|
|
TITLE:=Python $(PYTHON3_VERSION)
|
2015-06-11 18:37:39 +02:00
|
|
|
URL:=https://www.python.org/
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2014-10-13 12:21:16 +02:00
|
|
|
define Package/python3/Default/description
|
2023-07-13 07:39:35 +02:00
|
|
|
Python is an interpreted, interactive, object-oriented programming
|
|
|
|
language. It incorporates modules, exceptions, dynamic typing, very high
|
|
|
|
level dynamic data types, and classes. It supports multiple programming
|
|
|
|
paradigms beyond object-oriented programming, such as procedural and
|
|
|
|
functional programming. Python combines remarkable power with very clear
|
|
|
|
syntax. It has interfaces to many system calls and libraries, as well as
|
|
|
|
to various window systems, and is extensible in C or C++. It is also
|
|
|
|
usable as an extension language for applications that need a
|
|
|
|
programmable interface. Finally, Python is portable: it runs on many
|
|
|
|
Unix variants including Linux and macOS, and on Windows.
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2020-12-15 10:07:21 +01:00
|
|
|
define Package/libpython3
|
|
|
|
$(call Package/python3/Default)
|
2023-07-13 07:39:35 +02:00
|
|
|
TITLE+= core library
|
2023-05-05 11:23:49 +02:00
|
|
|
DEPENDS:=+libpthread
|
2020-12-15 10:07:21 +01:00
|
|
|
ABI_VERSION:=$(PYTHON3_VERSION)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/libpython3/description
|
2023-07-13 07:39:35 +02:00
|
|
|
$(call Package/python3/Default/description)
|
|
|
|
|
|
|
|
This package contains only core Python library.
|
2020-12-15 10:07:21 +01:00
|
|
|
endef
|
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
define Package/python3-base
|
2014-10-13 12:21:16 +02:00
|
|
|
$(call Package/python3/Default)
|
2023-07-13 07:39:35 +02:00
|
|
|
TITLE+= base interpreter
|
2023-05-05 11:23:49 +02:00
|
|
|
DEPENDS:=+libpython3
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
define Package/python3-base/description
|
2023-07-13 07:39:35 +02:00
|
|
|
$(call Package/python3/Default/description)
|
|
|
|
|
|
|
|
This package contains only the interpreter and the bare minimum for the
|
|
|
|
interpreter to start.
|
2014-11-27 22:47:28 +01:00
|
|
|
endef
|
|
|
|
|
2015-03-12 19:01:20 +01:00
|
|
|
define Package/python3-light
|
|
|
|
$(call Package/python3/Default)
|
2023-07-13 07:39:35 +02:00
|
|
|
TITLE+= light installation
|
2023-05-05 11:23:49 +02:00
|
|
|
DEPENDS:=+python3-base +libbz2 +zlib
|
2017-11-30 15:44:48 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/python3-light/config
|
|
|
|
source "$(SOURCE)/Config-python3-light.in"
|
2015-03-12 19:01:20 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/python3-light/description
|
2023-07-13 07:39:35 +02:00
|
|
|
$(call Package/python3/Default/description)
|
|
|
|
|
|
|
|
This package installs the base interpreter package and contains the most
|
|
|
|
commonly used parts of the standard library.
|
2015-03-12 19:01:20 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
PYTHON3_LIB_FILES_DEL:=
|
|
|
|
PYTHON3_PACKAGES:=
|
2015-09-14 21:16:15 +02:00
|
|
|
PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
|
2017-01-04 10:27:36 +01:00
|
|
|
PYTHON3_PACKAGES_DEPENDS:=
|
2015-03-12 19:01:20 +01:00
|
|
|
define Py3BasePackage
|
|
|
|
PYTHON3_PACKAGES+=$(1)
|
2017-01-04 10:27:36 +01:00
|
|
|
ifeq ($(3),)
|
|
|
|
PYTHON3_PACKAGES_DEPENDS+=$(1)
|
|
|
|
endif
|
2015-03-12 19:01:20 +01:00
|
|
|
PYTHON3_LIB_FILES_DEL+=$(2)
|
2023-06-29 09:27:40 +02:00
|
|
|
ifeq ($(2),)
|
|
|
|
Py3Package/$(1)/filespec=
|
|
|
|
else
|
|
|
|
define Py3Package/$(1)/filespec
|
|
|
|
$(foreach lib_file,$(2),
|
|
|
|
+|$(lib_file)
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
endif
|
2019-02-20 12:51:05 +01:00
|
|
|
Py3Package/$(1)/install?=:
|
2015-03-12 19:01:20 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
include ./files/python3-package-*.mk
|
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
define Package/python3
|
|
|
|
$(call Package/python3/Default)
|
2023-07-13 07:39:35 +02:00
|
|
|
TITLE+= programming language
|
2017-01-04 10:27:36 +01:00
|
|
|
DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES_DEPENDS),+$(package))
|
2014-11-27 22:47:28 +01:00
|
|
|
endef
|
|
|
|
|
2014-10-13 12:21:16 +02:00
|
|
|
define Package/python3/description
|
2023-07-13 07:39:35 +02:00
|
|
|
$(call Package/python3/Default/description)
|
|
|
|
|
|
|
|
This package installs almost all parts of the standard Python
|
|
|
|
installation.
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2023-05-18 11:42:12 +02:00
|
|
|
# Set READELF here so that the exact same readelf program name can be
|
|
|
|
# replaced in _sysconfigdata.py (in Py3Package/python3-base/install)
|
|
|
|
TARGET_CONFIGURE_OPTS+= \
|
|
|
|
READELF="$(TARGET_CROSS)readelf"
|
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
EXTRA_LDFLAGS+= \
|
2020-11-29 07:02:53 +01:00
|
|
|
-L$(PKG_BUILD_DIR) \
|
|
|
|
-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
|
2014-09-24 10:08:37 +02:00
|
|
|
|
2023-05-05 11:23:49 +02:00
|
|
|
# Bypass configure tests for cross compilation
|
|
|
|
CONFIGURE_VARS += \
|
|
|
|
ac_cv_buggy_getaddrinfo=no \
|
|
|
|
ac_cv_file__dev_ptc=no \
|
|
|
|
ac_cv_file__dev_ptmx=yes
|
|
|
|
|
2023-05-25 06:01:17 +02:00
|
|
|
# Do not link with libbsd for flock
|
|
|
|
# https://github.com/openwrt/packages/issues/21161
|
|
|
|
CONFIGURE_VARS += \
|
|
|
|
ac_cv_lib_bsd_flock=no
|
|
|
|
|
2023-05-05 11:23:49 +02:00
|
|
|
# Disable stdlib modules
|
|
|
|
# Check for a better way in the future: https://github.com/python/cpython/issues/98558
|
|
|
|
CONFIGURE_VARS += \
|
|
|
|
py_cv_module__tkinter=n/a \
|
|
|
|
py_cv_module_nis=n/a
|
|
|
|
|
2021-12-28 10:11:24 +01:00
|
|
|
# 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
|
|
|
|
|
2021-10-27 11:10:02 +02:00
|
|
|
MAKE_VARS += \
|
|
|
|
PYTHONSTRICTEXTENSIONBUILD=1
|
|
|
|
|
2023-05-05 11:23:49 +02:00
|
|
|
CONFIGURE_ARGS += \
|
2020-05-18 09:01:17 +02:00
|
|
|
--enable-optimizations \
|
2014-11-27 22:47:28 +01:00
|
|
|
--enable-shared \
|
2023-05-05 11:23:49 +02:00
|
|
|
--disable-test-modules \
|
|
|
|
--with-build-python \
|
2017-01-01 00:53:14 +01:00
|
|
|
--with-system-ffi \
|
2020-05-18 09:01:17 +02:00
|
|
|
--without-cxx-main \
|
|
|
|
--without-ensurepip \
|
|
|
|
$(if $(CONFIG_IPV6),--enable-ipv6) \
|
2023-05-05 11:23:49 +02:00
|
|
|
$(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto)
|
2014-09-24 10:08:37 +02:00
|
|
|
|
|
|
|
define Build/InstallDev
|
2019-03-26 20:33:16 +01:00
|
|
|
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
|
2019-06-09 08:05:55 +02:00
|
|
|
$(INSTALL_DIR) $(2)/bin
|
2014-09-24 10:08:37 +02:00
|
|
|
$(CP) \
|
2020-04-17 17:47:25 +02:00
|
|
|
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON3_VERSION) \
|
2014-09-24 10:08:37 +02:00
|
|
|
$(1)/usr/include/
|
|
|
|
$(CP) \
|
2020-04-17 17:47:25 +02:00
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* \
|
2014-09-24 10:08:37 +02:00
|
|
|
$(1)/usr/lib/
|
2020-07-08 10:02:49 +02:00
|
|
|
grep \
|
|
|
|
'^_PYTHON_HOST_PLATFORM=' \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/Makefile > \
|
|
|
|
$(1)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/Makefile-vars
|
2019-01-02 07:18:46 +01:00
|
|
|
$(CP) \
|
2019-03-26 20:33:16 +01:00
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/python*.pc \
|
2019-01-02 07:18:46 +01:00
|
|
|
$(1)/usr/lib/pkgconfig
|
2019-03-27 20:39:39 +01:00
|
|
|
$(INSTALL_BIN) \
|
2020-04-17 17:47:25 +02:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config \
|
2019-06-09 08:05:55 +02:00
|
|
|
$(2)/bin/
|
|
|
|
$(SED) \
|
|
|
|
's|^prefix_real=.*$$$$|prefix_real="$(PYTHON3_DIR)"|' \
|
2020-04-17 17:47:25 +02:00
|
|
|
$(2)/bin/python$(PYTHON3_VERSION)-config
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2015-03-12 19:01:20 +01:00
|
|
|
PYTHON3_BASE_LIB_FILES:= \
|
2020-04-17 17:47:25 +02:00
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/encodings \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/_collections_abc.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/_sitebuiltins.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/_weakrefset.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/abc.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/codecs.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/genericpath.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/io.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/os.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/posixpath.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/site.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/sysconfig.py \
|
|
|
|
/usr/lib/python$(PYTHON3_VERSION)/stat.py
|
2015-03-12 19:01:20 +01:00
|
|
|
|
|
|
|
PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
|
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
define Py3Package/python3-base/filespec
|
2020-04-17 17:47:25 +02:00
|
|
|
+|/usr/bin/python$(PYTHON3_VERSION)
|
2023-06-29 09:27:40 +02:00
|
|
|
$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),
|
|
|
|
+|$(lib_file)
|
|
|
|
)
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2015-03-12 19:01:20 +01:00
|
|
|
define Py3Package/python3-light/filespec
|
2020-04-17 17:47:25 +02:00
|
|
|
+|/usr/lib/python$(PYTHON3_VERSION)
|
|
|
|
-|/usr/lib/python$(PYTHON3_VERSION)/distutils/cygwinccompiler.py
|
|
|
|
-|/usr/lib/python$(PYTHON3_VERSION)/idlelib
|
|
|
|
-|/usr/lib/python$(PYTHON3_VERSION)/tkinter
|
|
|
|
-|/usr/lib/python$(PYTHON3_VERSION)/turtledemo
|
|
|
|
-|/usr/lib/python$(PYTHON3_VERSION)/webbrowser.py
|
|
|
|
-|/usr/lib/python$(PYTHON3_VERSION)/_osx_support.py
|
2023-06-29 09:27:40 +02:00
|
|
|
$(foreach lib_file,$(filter /usr/lib/python$(PYTHON3_VERSION)/%,$(PYTHON3_LIB_FILES_DEL)),
|
|
|
|
-|$(lib_file)
|
|
|
|
)
|
2014-11-27 22:47:28 +01:00
|
|
|
endef
|
|
|
|
|
2020-12-15 10:07:21 +01:00
|
|
|
define Package/libpython3/install
|
2014-10-04 17:02:36 +02:00
|
|
|
# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
|
2020-04-17 17:47:25 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/
|
2020-12-15 10:07:21 +01:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* $(1)/usr/lib/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Py3Package/python3-base/install
|
2014-10-24 16:24:21 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2020-04-17 17:47:25 +02:00
|
|
|
$(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python3
|
|
|
|
$(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python
|
python3: Fix host build tool names recorded in target files
Python will record the values of CC, CXX, AR, and READELF (and other
configure options) used during compilation. pip will use these programs
when asked to compile extension modules on the target device.
* If ccache is used during build, CC and CXX will be ccache_cc and
ccache_cxx, respectively, which are not available on-device (#11912).
* If an external toolchain is used during build, the values of these
variables will contain the external toolchain prefix, which may not be
available on target.
* If the normal toolchain is used during build, AR and READELF will
contain the toolchain prefix, but the names of ar and readelf
on-device do not contain the prefix; they are named "ar" and
"readelf".
This changes the values of these variables in Python's files to match
the names available on-device, and without any toolchain prefix.
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-27 08:10:53 +02:00
|
|
|
# This depends on being called before filespec is processed
|
|
|
|
$(SED) 's|$(TARGET_AR)|ar|g;s|$(TARGET_CROSS)readelf|readelf|g;s|$(TARGET_CC)|gcc|g;s|$(TARGET_CXX)|g++|g' \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
2019-02-20 12:51:05 +01:00
|
|
|
Py3Package/python3-light/install:=:
|
2023-07-03 16:34:48 +02:00
|
|
|
Package/python3/install:=:
|
2015-03-12 19:01:20 +01:00
|
|
|
|
2023-05-23 13:12:27 +02:00
|
|
|
# libuuid is provided by e2fsprogs and uuid/uuid.h is moved into
|
|
|
|
# $(STAGING_DIR_HOST)/include/e2fsprogs
|
|
|
|
HOST_CFLAGS += \
|
|
|
|
-I$(STAGING_DIR_HOST)/include/e2fsprogs
|
|
|
|
HOST_CPPFLAGS += \
|
|
|
|
-I$(STAGING_DIR_HOST)/include/e2fsprogs
|
|
|
|
|
2017-01-06 16:05:27 +01:00
|
|
|
HOST_LDFLAGS += \
|
2019-08-16 22:45:58 +02:00
|
|
|
-Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib
|
2017-01-06 16:05:27 +01:00
|
|
|
|
2018-03-14 15:18:27 +01:00
|
|
|
ifeq ($(HOST_OS),Linux)
|
|
|
|
HOST_LDFLAGS += \
|
|
|
|
-Wl,--no-as-needed -lrt
|
|
|
|
endif
|
|
|
|
|
2021-10-27 11:10:02 +02:00
|
|
|
# Would be nice to be able to do this, but hosts are very fiddly
|
|
|
|
# HOST_MAKE_VARS += \
|
|
|
|
# PYTHONSTRICTEXTENSIONBUILD=1
|
|
|
|
|
2023-05-05 11:23:49 +02:00
|
|
|
# Bypass configure test
|
|
|
|
HOST_CONFIGURE_VARS += \
|
|
|
|
ac_cv_working_openssl_hashlib=yes
|
|
|
|
|
2019-08-16 22:45:58 +02:00
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
HOST_CONFIGURE_VARS += \
|
|
|
|
ac_cv_header_libintl_h=no
|
2021-02-16 15:23:50 +01:00
|
|
|
HOST_MAKE_VARS += \
|
|
|
|
USE_PYTHON_CONFIG_PY=1
|
2019-08-16 22:45:58 +02:00
|
|
|
endif
|
|
|
|
|
2023-05-05 11:23:49 +02:00
|
|
|
HOST_CONFIGURE_ARGS += \
|
2020-05-18 09:01:17 +02:00
|
|
|
--enable-optimizations \
|
2023-05-05 11:23:49 +02:00
|
|
|
--disable-test-modules \
|
2020-05-18 09:01:17 +02:00
|
|
|
--with-ensurepip=upgrade \
|
2021-10-27 11:10:02 +02:00
|
|
|
--with-ssl-default-suites=openssl \
|
2023-05-05 11:23:49 +02:00
|
|
|
--with-system-expat \
|
|
|
|
--without-cxx-main
|
2014-09-24 10:08:37 +02:00
|
|
|
|
2019-05-29 16:03:18 +02:00
|
|
|
define Host/Configure
|
|
|
|
$(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py
|
|
|
|
$(call Host/Configure/Default)
|
2023-05-18 14:38:09 +02:00
|
|
|
ls $(HOST_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl
|
2023-05-18 07:36:24 +02:00
|
|
|
ls $(HOST_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl
|
2019-05-29 16:03:18 +02:00
|
|
|
endef
|
|
|
|
|
2014-09-24 10:08:37 +02:00
|
|
|
define Host/Install
|
2019-05-31 21:52:23 +02:00
|
|
|
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),,
|
|
|
|
rm -rf \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/pkg_resources \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/setuptools \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/setuptools-* \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/.setuptools-patched* \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_*
|
|
|
|
)
|
|
|
|
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),,
|
|
|
|
rm -rf \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/pip \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/pip-* \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/.pip-patched* \
|
|
|
|
$(HOST_PYTHON3_PKG_DIR)/.pip_installed_*
|
|
|
|
)
|
2021-02-16 15:23:50 +01:00
|
|
|
$(call Host/Install/Default)
|
2019-05-31 21:52:23 +02:00
|
|
|
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),,
|
2023-05-18 14:38:09 +02:00
|
|
|
$(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-setuptools,)
|
2019-05-31 21:52:23 +02:00
|
|
|
touch $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)
|
2019-05-29 19:48:29 +02:00
|
|
|
)
|
2019-05-31 21:52:23 +02:00
|
|
|
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),,
|
2023-05-18 07:36:24 +02:00
|
|
|
$(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-pip,)
|
2019-05-31 21:52:23 +02:00
|
|
|
touch $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)
|
2019-05-29 19:48:29 +02:00
|
|
|
)
|
2014-09-24 10:08:37 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call HostBuild))
|
|
|
|
|
2015-03-12 19:01:20 +01:00
|
|
|
$(foreach package, $(PYTHON3_PACKAGES), \
|
|
|
|
$(eval $(call Py3Package,$(package))) \
|
|
|
|
$(eval $(call BuildPackage,$(package))) \
|
2017-03-02 17:02:14 +01:00
|
|
|
$(eval $(call BuildPackage,$(package)-src)) \
|
2015-03-12 19:01:20 +01:00
|
|
|
)
|
|
|
|
|
2020-12-15 10:07:21 +01:00
|
|
|
$(eval $(call BuildPackage,libpython3))
|
2023-07-03 16:34:48 +02:00
|
|
|
$(eval $(call BuildPackage,python3))
|
2020-12-15 10:07:21 +01:00
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
$(eval $(call Py3Package,python3-base))
|
2015-03-12 19:01:20 +01:00
|
|
|
$(eval $(call Py3Package,python3-light))
|
2014-09-24 10:08:37 +02:00
|
|
|
|
2014-11-27 22:47:28 +01:00
|
|
|
$(eval $(call BuildPackage,python3-base))
|
2015-03-12 19:01:20 +01:00
|
|
|
$(eval $(call BuildPackage,python3-light))
|
2017-03-02 17:02:14 +01:00
|
|
|
|
|
|
|
$(eval $(call BuildPackage,python3-base-src))
|
|
|
|
$(eval $(call BuildPackage,python3-light-src))
|