mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 21:56:42 +00:00
Merge pull request #8016 from heitbaum/python
Python cross-compile changes and qemu
This commit is contained in:
commit
5993c71a0e
@ -120,7 +120,7 @@ addon() {
|
||||
|
||||
# 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/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.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
|
||||
|
@ -42,7 +42,7 @@ PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false
|
||||
--with-doc-strings
|
||||
--with-system-ffi
|
||||
--without-pymalloc
|
||||
--without-ensurepip
|
||||
--with-ensurepip=no
|
||||
"
|
||||
|
||||
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_LIB="${HOST_LIBDIR}"
|
||||
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() {
|
||||
@ -99,8 +103,9 @@ post_make_host() {
|
||||
post_makeinstall_host() {
|
||||
ln -sf ${PKG_PYTHON_VERSION} ${TOOLCHAIN}/bin/python
|
||||
|
||||
${TOOLCHAIN}/bin/python -m ensurepip --altinstall
|
||||
|
||||
rm -f ${TOOLCHAIN}/bin/smtpd.py*
|
||||
rm -f ${TOOLCHAIN}/bin/pyvenv
|
||||
rm -f ${TOOLCHAIN}/bin/pydoc*
|
||||
|
||||
rm -fr ${PKG_BUILD}/.${HOST_NAME}/build/temp.*
|
||||
|
@ -19,16 +19,17 @@ generates legacy bytecode.
|
||||
|
||||
https://www.python.org/dev/peps/pep-3147/#case-4-legacy-pyc-files-and-source-less-imports
|
||||
---
|
||||
Lib/py_compile.py | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
Lib/py_compile.py | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/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
|
||||
it was previously.
|
||||
"""
|
||||
+
|
||||
+ if os.environ.get('DONT_BUILD_LEGACY_PYC') is None:
|
||||
+ if cfile:
|
||||
+ cfile = file + 'c'
|
||||
+
|
||||
|
@ -7,10 +7,11 @@ PKG_SHA256="31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
|
||||
PKG_LICENSE="BSD"
|
||||
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_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_TOOLCHAIN="manual"
|
||||
|
||||
makeinstall_host() {
|
||||
export DONT_BUILD_LEGACY_PYC=1
|
||||
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
|
||||
}
|
||||
|
@ -8,10 +8,11 @@ PKG_SHA256="d60a3903dc3bb01a18ad6a89cdbe2e4eadc69c0bc8ef1e3773ba53d44c3f7a34"
|
||||
PKG_LICENSE="GPL"
|
||||
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_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_TOOLCHAIN="manual"
|
||||
|
||||
makeinstall_host() {
|
||||
export DONT_BUILD_LEGACY_PYC=1
|
||||
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
|
||||
}
|
||||
|
@ -8,10 +8,11 @@ PKG_SHA256="af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"
|
||||
PKG_LICENSE="GPL"
|
||||
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_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_TOOLCHAIN="manual"
|
||||
|
||||
makeinstall_host() {
|
||||
export DONT_BUILD_LEGACY_PYC=1
|
||||
exec_thread_safe python3 setup.py install --prefix=${TOOLCHAIN}
|
||||
}
|
||||
|
@ -8,10 +8,11 @@ PKG_SHA256="4ed3fb427708c8a3ed5fe9c599532480f581078a1e0aec0e50f40eb58e9f0015"
|
||||
PKG_LICENSE="GPL"
|
||||
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_DEPENDS_HOST="Python3:host setuptools:host"
|
||||
PKG_DEPENDS_HOST="Python3:host"
|
||||
PKG_LONGDESC="distutilscross enhances distutils to support Cross Compile of Python extensions"
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
makeinstall_host() {
|
||||
export DONT_BUILD_LEGACY_PYC=1
|
||||
exec_thread_safe python setup.py install --prefix=${TOOLCHAIN}
|
||||
}
|
||||
|
@ -7,11 +7,12 @@ PKG_SHA256="b1db3a153087549497ee52b1c938d2134e0338214fe14f7efd16fecd57b639f5"
|
||||
PKG_LICENSE="Apache"
|
||||
PKG_SITE="http://mesonbuild.com"
|
||||
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_TOOLCHAIN="manual"
|
||||
|
||||
make_host() {
|
||||
makeinstall_host() {
|
||||
export DONT_BUILD_LEGACY_PYC=1
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
|
@ -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}
|
||||
}
|
@ -18,7 +18,7 @@ pre_make_target() {
|
||||
}
|
||||
|
||||
make_target() {
|
||||
python3 setup.py build --cross-compile
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
|
@ -20,7 +20,7 @@ pre_configure_target() {
|
||||
}
|
||||
|
||||
make_target() {
|
||||
python3 setup.py build --cross-compile
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
|
@ -17,7 +17,7 @@ pre_make_target() {
|
||||
}
|
||||
|
||||
make_target() {
|
||||
python3 setup.py build --cross-compile
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
|
@ -2,8 +2,8 @@
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="qemu"
|
||||
PKG_VERSION="8.0.3"
|
||||
PKG_SHA256="ecf4d32cbef9d397bfc8cc50e4d1e92a1b30253bf32e8ee73c7a8dcf9a232b09"
|
||||
PKG_VERSION="8.1.0"
|
||||
PKG_SHA256="710c101198e334d4762eef65f649bc43fa8a5dd75303554b8acfec3eb25f0e55"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://www.qemu.org"
|
||||
PKG_URL="https://download.qemu.org/qemu-${PKG_VERSION}.tar.xz"
|
||||
|
11
packages/tools/qemu/patches/python.patch
Normal file
11
packages/tools/qemu/patches/python.patch
Normal 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" \
|
Loading…
x
Reference in New Issue
Block a user