mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
create rootf's & SDK from 2018.02.9 buildroot (#10)
--------- Co-authored-by: tiopex <tiopxyz@gmail.com> Co-authored-by: tiopex <67048640+tiopex@users.noreply.github.com>
This commit is contained in:
+31
-62
@@ -4,20 +4,19 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON3_VERSION_MAJOR = 3.10
|
||||
PYTHON3_VERSION = $(PYTHON3_VERSION_MAJOR).8
|
||||
PYTHON3_VERSION_MAJOR = 3.6
|
||||
PYTHON3_VERSION = $(PYTHON3_VERSION_MAJOR).3
|
||||
PYTHON3_SOURCE = Python-$(PYTHON3_VERSION).tar.xz
|
||||
PYTHON3_SITE = https://python.org/ftp/python/$(PYTHON3_VERSION)
|
||||
PYTHON3_LICENSE = Python-2.0, others
|
||||
PYTHON3_LICENSE_FILES = LICENSE
|
||||
PYTHON3_CPE_ID_VENDOR = python
|
||||
PYTHON3_CPE_ID_PRODUCT = python
|
||||
|
||||
# 0033-3.11-gh-98433-Fix-quadratic-time-idna-decoding.-GH-9.patch
|
||||
PYTHON3_IGNORE_CVES += CVE-2022-45061
|
||||
|
||||
# 0034-3-10-gh-98517-Fix-buffer-overflows-in-_sha3-module.patch
|
||||
PYTHON3_IGNORE_CVES += CVE-2022-37454
|
||||
# Python itself doesn't use libtool, but it includes the source code
|
||||
# of libffi, which uses libtool. Unfortunately, it uses a beta version
|
||||
# of libtool for which we don't have a matching patch. However, this
|
||||
# is not a problem, because we don't use the libffi copy included in
|
||||
# the Python sources, but instead use an external libffi library.
|
||||
PYTHON3_LIBTOOL_PATCH = NO
|
||||
|
||||
# This host Python is installed in $(HOST_DIR), as it is needed when
|
||||
# cross-compiling third-party Python modules.
|
||||
@@ -34,7 +33,8 @@ HOST_PYTHON3_CONF_OPTS += \
|
||||
--enable-unicodedata \
|
||||
--disable-test-modules \
|
||||
--disable-idle3 \
|
||||
--disable-ossaudiodev
|
||||
--disable-ossaudiodev \
|
||||
--disable-openssl
|
||||
|
||||
# Make sure that LD_LIBRARY_PATH overrides -rpath.
|
||||
# This is needed because libpython may be installed at the same time that
|
||||
@@ -47,34 +47,10 @@ HOST_PYTHON3_CONF_ENV += \
|
||||
|
||||
PYTHON3_DEPENDENCIES = host-python3 libffi
|
||||
|
||||
HOST_PYTHON3_DEPENDENCIES = host-autoconf-archive host-expat host-zlib host-libffi
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_PYTHON3_BZIP2),y)
|
||||
HOST_PYTHON3_DEPENDENCIES += host-bzip2
|
||||
else
|
||||
HOST_PYTHON3_CONF_OPTS += --disable-bzip2
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_PYTHON3_SSL),y)
|
||||
HOST_PYTHON3_DEPENDENCIES += host-openssl
|
||||
else
|
||||
HOST_PYTHON3_CONF_OPTS += --disable-openssl
|
||||
endif
|
||||
HOST_PYTHON3_DEPENDENCIES = host-expat host-zlib
|
||||
|
||||
PYTHON3_INSTALL_STAGING = YES
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_2TO3),y)
|
||||
PYTHON3_CONF_OPTS += --enable-lib2to3
|
||||
else
|
||||
PYTHON3_CONF_OPTS += --disable-lib2to3
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_BERKELEYDB),y)
|
||||
PYTHON3_DEPENDENCIES += berkeleydb
|
||||
else
|
||||
PYTHON3_CONF_OPTS += --disable-berkeleydb
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_READLINE),y)
|
||||
PYTHON3_DEPENDENCIES += readline
|
||||
else
|
||||
@@ -101,6 +77,10 @@ else
|
||||
PYTHON3_CONF_OPTS += --with-expat=none
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
|
||||
PYTHON3_CONF_OPTS += --enable-old-stdlib-cache
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_SQLITE),y)
|
||||
PYTHON3_DEPENDENCIES += sqlite
|
||||
else
|
||||
@@ -109,7 +89,6 @@ endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_SSL),y)
|
||||
PYTHON3_DEPENDENCIES += openssl
|
||||
PYTHON3_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr
|
||||
else
|
||||
PYTHON3_CONF_OPTS += --disable-openssl
|
||||
endif
|
||||
@@ -122,11 +101,6 @@ ifneq ($(BR2_PACKAGE_PYTHON3_UNICODEDATA),y)
|
||||
PYTHON3_CONF_OPTS += --disable-unicodedata
|
||||
endif
|
||||
|
||||
# Disable auto-detection of uuid.h (util-linux)
|
||||
# which would add _uuid module support, instead
|
||||
# default to the pure python implementation
|
||||
PYTHON3_CONF_OPTS += --disable-uuid
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_BZIP2),y)
|
||||
PYTHON3_DEPENDENCIES += bzip2
|
||||
else
|
||||
@@ -173,16 +147,13 @@ ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
|
||||
PYTHON3_CONF_ENV += ac_cv_func_wcsftime=no
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
|
||||
PYTHON3_DEPENDENCIES += gettext
|
||||
endif
|
||||
|
||||
PYTHON3_CONF_OPTS += \
|
||||
--without-ensurepip \
|
||||
--without-cxx-main \
|
||||
--with-system-ffi \
|
||||
--disable-pydoc \
|
||||
--disable-test-modules \
|
||||
--disable-lib2to3 \
|
||||
--disable-tk \
|
||||
--disable-nis \
|
||||
--disable-idle3 \
|
||||
@@ -238,9 +209,8 @@ define PYTHON3_REMOVE_USELESS_FILES
|
||||
rm -f $(TARGET_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR)m-config
|
||||
rm -f $(TARGET_DIR)/usr/bin/python3-config
|
||||
rm -f $(TARGET_DIR)/usr/bin/smtpd.py.3
|
||||
rm -f $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/distutils/command/wininst*.exe
|
||||
for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/config-$(PYTHON3_VERSION_MAJOR)m-*/ \
|
||||
-type f -not -name Makefile` ; do \
|
||||
for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/config-$(PYTHON3_VERSION_MAJOR)m/ \
|
||||
-type f -not -name pyconfig.h -a -not -name Makefile` ; do \
|
||||
rm -f $$i ; \
|
||||
done
|
||||
rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/__pycache__/
|
||||
@@ -261,28 +231,30 @@ endef
|
||||
PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_ENSURE_LIBPYTHON_STRIPPED
|
||||
|
||||
PYTHON3_AUTORECONF = YES
|
||||
PYTHON3_AUTORECONF_OPTS = --include=$(HOST_DIR)/share/autoconf-archive
|
||||
|
||||
define PYTHON3_INSTALL_SYMLINK
|
||||
ln -fs python3 $(TARGET_DIR)/usr/bin/python
|
||||
endef
|
||||
|
||||
ifneq ($(BR2_PACKAGE_PYTHON),y)
|
||||
PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_INSTALL_SYMLINK
|
||||
endif
|
||||
|
||||
# Some packages may have build scripts requiring python3, whatever is the
|
||||
# python version chosen for the target.
|
||||
# Only install the python symlink in the host tree if python3 is enabled
|
||||
# for the target.
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
||||
define HOST_PYTHON3_INSTALL_SYMLINK
|
||||
ln -fs python3 $(HOST_DIR)/bin/python
|
||||
ln -fs python3-config $(HOST_DIR)/bin/python-config
|
||||
endef
|
||||
|
||||
HOST_PYTHON3_POST_INSTALL_HOOKS += HOST_PYTHON3_INSTALL_SYMLINK
|
||||
endif
|
||||
|
||||
# Provided to other packages
|
||||
PYTHON3_PATH = $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/
|
||||
|
||||
# Support for socket.AF_BLUETOOTH
|
||||
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_HEADERS),y)
|
||||
PYTHON3_DEPENDENCIES += bluez5_utils-headers
|
||||
endif
|
||||
PYTHON3_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/
|
||||
|
||||
$(eval $(autotools-package))
|
||||
$(eval $(host-autotools-package))
|
||||
@@ -297,11 +269,10 @@ endif
|
||||
define PYTHON3_CREATE_PYC_FILES
|
||||
$(PYTHON3_FIX_TIME)
|
||||
PYTHONPATH="$(PYTHON3_PATH)" \
|
||||
$(HOST_DIR)/bin/python$(PYTHON3_VERSION_MAJOR) \
|
||||
cd $(TARGET_DIR) && $(HOST_DIR)/bin/python$(PYTHON3_VERSION_MAJOR) \
|
||||
$(TOPDIR)/support/scripts/pycompile.py \
|
||||
$(if $(VERBOSE),--verbose) \
|
||||
--strip-root $(TARGET_DIR) \
|
||||
$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)
|
||||
$(if $(BR2_REPRODUCIBLE),--force) \
|
||||
usr/lib/python$(PYTHON3_VERSION_MAJOR)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY)$(BR2_PACKAGE_PYTHON3_PY_PYC),y)
|
||||
@@ -310,9 +281,7 @@ endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
|
||||
define PYTHON3_REMOVE_PY_FILES
|
||||
find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' \
|
||||
$(if $(strip $(KEEP_PYTHON_PY_FILES)),-not \( $(call finddirclauses,$(TARGET_DIR),$(KEEP_PYTHON_PY_FILES)) \) ) \
|
||||
-print0 | \
|
||||
find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' -print0 | \
|
||||
xargs -0 --no-run-if-empty rm -f
|
||||
endef
|
||||
PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
|
||||
|
||||
Reference in New Issue
Block a user