Merge pull request #8016 from heitbaum/python

Python cross-compile changes and qemu
This commit is contained in:
CvH 2023-09-03 19:33:01 +02:00 committed by GitHub
commit 5993c71a0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 41 additions and 40 deletions

View File

@ -120,7 +120,7 @@ addon() {
# i2c-tools # i2c-tools
cp -P $(get_install_dir i2c-tools)/usr/sbin/{i2cdetect,i2cdump,i2cget,i2cset} ${ADDON_BUILD}/${PKG_ADDON_ID}/bin cp -P $(get_install_dir i2c-tools)/usr/sbin/{i2cdetect,i2cdump,i2cget,i2cset} ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -P $(get_install_dir i2c-tools)/usr/lib/${PKG_PYTHON_VERSION}/site-packages/smbus.so ${ADDON_BUILD}/${PKG_ADDON_ID}/lib cp -P $(get_install_dir i2c-tools)/usr/lib/${PKG_PYTHON_VERSION}/site-packages/smbus-*.egg ${ADDON_BUILD}/${PKG_ADDON_ID}/lib
cp -P $(get_install_dir i2c-tools)/usr/lib/libi2c.so.0.1.1 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/libi2c.so cp -P $(get_install_dir i2c-tools)/usr/lib/libi2c.so.0.1.1 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/libi2c.so
cp -P $(get_install_dir i2c-tools)/usr/lib/libi2c.so.0.1.1 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/libi2c.so.0 cp -P $(get_install_dir i2c-tools)/usr/lib/libi2c.so.0.1.1 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/libi2c.so.0
cp -P $(get_install_dir i2c-tools)/usr/lib/libi2c.so.0.1.1 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/libi2c.so.0.1.1 cp -P $(get_install_dir i2c-tools)/usr/lib/libi2c.so.0.1.1 ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/libi2c.so.0.1.1

View File

@ -42,7 +42,7 @@ PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false
--with-doc-strings --with-doc-strings
--with-system-ffi --with-system-ffi
--without-pymalloc --without-pymalloc
--without-ensurepip --with-ensurepip=no
" "
PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false
@ -89,6 +89,10 @@ pre_configure_host() {
export PYTHON_MODULES_INCLUDE="${HOST_INCDIR}" export PYTHON_MODULES_INCLUDE="${HOST_INCDIR}"
export PYTHON_MODULES_LIB="${HOST_LIBDIR}" export PYTHON_MODULES_LIB="${HOST_LIBDIR}"
export DISABLED_EXTENSIONS="readline _curses _curses_panel ${PKG_PY_DISABLED_MODULES}" export DISABLED_EXTENSIONS="readline _curses _curses_panel ${PKG_PY_DISABLED_MODULES}"
# control patch Python3-0300-generate-legacy-pyc-bytecode
# this needs to be set when building host based py file
# do not set this for py compiles being done for target use
export DONT_BUILD_LEGACY_PYC=1
} }
post_make_host() { post_make_host() {
@ -99,8 +103,9 @@ post_make_host() {
post_makeinstall_host() { post_makeinstall_host() {
ln -sf ${PKG_PYTHON_VERSION} ${TOOLCHAIN}/bin/python ln -sf ${PKG_PYTHON_VERSION} ${TOOLCHAIN}/bin/python
${TOOLCHAIN}/bin/python -m ensurepip --altinstall
rm -f ${TOOLCHAIN}/bin/smtpd.py* rm -f ${TOOLCHAIN}/bin/smtpd.py*
rm -f ${TOOLCHAIN}/bin/pyvenv
rm -f ${TOOLCHAIN}/bin/pydoc* rm -f ${TOOLCHAIN}/bin/pydoc*
rm -fr ${PKG_BUILD}/.${HOST_NAME}/build/temp.* rm -fr ${PKG_BUILD}/.${HOST_NAME}/build/temp.*

View File

@ -19,18 +19,19 @@ generates legacy bytecode.
https://www.python.org/dev/peps/pep-3147/#case-4-legacy-pyc-files-and-source-less-imports https://www.python.org/dev/peps/pep-3147/#case-4-legacy-pyc-files-and-source-less-imports
--- ---
Lib/py_compile.py | 4 ++++ Lib/py_compile.py | 5 +++++
1 file changed, 4 insertions(+) 1 file changed, 5 insertions(+)
--- a/Lib/py_compile.py --- a/Lib/py_compile.py
+++ b/Lib/py_compile.py +++ b/Lib/py_compile.py
@@ -121,6 +121,10 @@ def compile(file, cfile=None, dfile=None @@ -121,6 +121,11 @@ def compile(file, cfile=None, dfile=None
the resulting file would be regular and thus not the same type of file as the resulting file would be regular and thus not the same type of file as
it was previously. it was previously.
""" """
+ +
+ if cfile: + if os.environ.get('DONT_BUILD_LEGACY_PYC') is None:
+ cfile = file + 'c' + if cfile:
+ cfile = file + 'c'
+ +
if invalidation_mode is None: if invalidation_mode is None:
invalidation_mode = _get_default_invalidation_mode() invalidation_mode = _get_default_invalidation_mode()

View File

@ -7,10 +7,11 @@ PKG_SHA256="31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
PKG_LICENSE="BSD" PKG_LICENSE="BSD"
PKG_SITE="https://pypi.org/project/Jinja2/" PKG_SITE="https://pypi.org/project/Jinja2/"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz" PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="Python3:host setuptools:host MarkupSafe:host" PKG_DEPENDS_HOST="Python3:host MarkupSafe:host"
PKG_LONGDESC="Jinja is a fast, expressive, extensible templating engine." PKG_LONGDESC="Jinja is a fast, expressive, extensible templating engine."
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
makeinstall_host() { makeinstall_host() {
export DONT_BUILD_LEGACY_PYC=1
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN} exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
} }

View File

@ -8,10 +8,11 @@ PKG_SHA256="d60a3903dc3bb01a18ad6a89cdbe2e4eadc69c0bc8ef1e3773ba53d44c3f7a34"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="https://pypi.org/project/Mako" PKG_SITE="https://pypi.org/project/Mako"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz" PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="Python3:host setuptools:host MarkupSafe:host" PKG_DEPENDS_HOST="Python3:host MarkupSafe:host"
PKG_LONGDESC="Mako is a super-fast templating language that borrows the best ideas from the existing templating languages." PKG_LONGDESC="Mako is a super-fast templating language that borrows the best ideas from the existing templating languages."
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
makeinstall_host() { makeinstall_host() {
export DONT_BUILD_LEGACY_PYC=1
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN} exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
} }

View File

@ -8,10 +8,11 @@ PKG_SHA256="af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="https://pypi.org/project/MarkupSafe/" PKG_SITE="https://pypi.org/project/MarkupSafe/"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz" PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="Python3:host setuptools:host" PKG_DEPENDS_HOST="Python3:host"
PKG_LONGDESC="MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python" PKG_LONGDESC="MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python"
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
makeinstall_host() { makeinstall_host() {
export DONT_BUILD_LEGACY_PYC=1
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN} exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
} }

View File

@ -8,10 +8,11 @@ PKG_SHA256="4ed3fb427708c8a3ed5fe9c599532480f581078a1e0aec0e50f40eb58e9f0015"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="https://pypi.org/project/distutilscross/" PKG_SITE="https://pypi.org/project/distutilscross/"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz" PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="Python3:host setuptools:host" PKG_DEPENDS_HOST="Python3:host"
PKG_LONGDESC="distutilscross enhances distutils to support Cross Compile of Python extensions" PKG_LONGDESC="distutilscross enhances distutils to support Cross Compile of Python extensions"
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
makeinstall_host() { makeinstall_host() {
export DONT_BUILD_LEGACY_PYC=1
exec_thread_safe python setup.py install --prefix=${TOOLCHAIN} exec_thread_safe python setup.py install --prefix=${TOOLCHAIN}
} }

View File

@ -7,11 +7,12 @@ PKG_SHA256="b1db3a153087549497ee52b1c938d2134e0338214fe14f7efd16fecd57b639f5"
PKG_LICENSE="Apache" PKG_LICENSE="Apache"
PKG_SITE="http://mesonbuild.com" PKG_SITE="http://mesonbuild.com"
PKG_URL="https://github.com/mesonbuild/meson/releases/download/${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.gz" PKG_URL="https://github.com/mesonbuild/meson/releases/download/${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="Python3:host setuptools:host" PKG_DEPENDS_HOST="Python3:host"
PKG_LONGDESC="High productivity build system" PKG_LONGDESC="High productivity build system"
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
make_host() { makeinstall_host() {
export DONT_BUILD_LEGACY_PYC=1
python3 setup.py build python3 setup.py build
} }

View File

@ -1,21 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="setuptools"
PKG_VERSION="52.0.0"
PKG_SHA256="ff0c74d1b905a224d647f99c6135eacbec2620219992186b81aa20012bc7f882"
PKG_LICENSE="OSS"
PKG_SITE="https://pypi.org/project/setuptools"
PKG_URL="https://github.com/pypa/setuptools/archive/v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="Python3:host"
PKG_LONGDESC="Replaces Setuptools as the standard method for working with Python module distributions."
PKG_TOOLCHAIN="manual"
make_host() {
python3 bootstrap.py
}
makeinstall_host() {
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
}

View File

@ -18,7 +18,7 @@ pre_make_target() {
} }
make_target() { make_target() {
python3 setup.py build --cross-compile python3 setup.py build
} }
makeinstall_target() { makeinstall_target() {

View File

@ -20,7 +20,7 @@ pre_configure_target() {
} }
make_target() { make_target() {
python3 setup.py build --cross-compile python3 setup.py build
} }
makeinstall_target() { makeinstall_target() {

View File

@ -17,7 +17,7 @@ pre_make_target() {
} }
make_target() { make_target() {
python3 setup.py build --cross-compile python3 setup.py build
} }
makeinstall_target() { makeinstall_target() {

View File

@ -2,8 +2,8 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="qemu" PKG_NAME="qemu"
PKG_VERSION="8.0.3" PKG_VERSION="8.1.0"
PKG_SHA256="ecf4d32cbef9d397bfc8cc50e4d1e92a1b30253bf32e8ee73c7a8dcf9a232b09" PKG_SHA256="710c101198e334d4762eef65f649bc43fa8a5dd75303554b8acfec3eb25f0e55"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="https://www.qemu.org" PKG_SITE="https://www.qemu.org"
PKG_URL="https://download.qemu.org/qemu-${PKG_VERSION}.tar.xz" PKG_URL="https://download.qemu.org/qemu-${PKG_VERSION}.tar.xz"

View File

@ -0,0 +1,11 @@
--- a/configure 2023-07-27 09:58:05.337334830 +0000
+++ b/configure 2023-07-27 09:57:58.300630393 +0000
@@ -950,6 +950,8 @@
mkvenv_flags="--online"
fi
+ln -s ${source_path}/../../toolchain/bin/meson pyvenv/bin/meson
+
if ! $mkvenv ensure \
$mkvenv_flags \
--dir "${source_path}/python/wheels" \