mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-07-09 13:08:47 +08:00
Merge branch 'python-cross' into 'master'
Add python cross env and fix gio scanner See merge request redox-os/redox!2215
This commit is contained in:
commit
5a4fd7b707
@ -55,6 +55,12 @@ cookbook_configure
|
||||
# A same file to save 60MB
|
||||
(cd "${COOKBOOK_STAGE}/usr/lib/python3.12/config-3.12-$ARCH-$OS" && \
|
||||
rm -f libpython3.12.a && ln -s ../../libpython3.12.a)
|
||||
# monkey patching to make paths working in target system
|
||||
if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
|
||||
PYTHON_INIT
|
||||
sed -i "s/sccache //g" "$COOKBOOK_STAGE/usr/lib/$COOKBOOK_PYTHON_V/$_PYTHON_SYSCONFIGDATA_NAME.py"
|
||||
sed -i "s|${COOKBOOK_SYSROOT}|/usr|g" "$COOKBOOK_STAGE/usr/lib/$COOKBOOK_PYTHON_V/$_PYTHON_SYSCONFIGDATA_NAME.py"
|
||||
fi
|
||||
"""
|
||||
|
||||
[[optional-packages]]
|
||||
|
||||
@ -8,6 +8,7 @@ template = "python"
|
||||
dev-dependencies = [
|
||||
"host:python312",
|
||||
"host:python3-setuptools",
|
||||
"python312",
|
||||
]
|
||||
|
||||
[package]
|
||||
|
||||
@ -7,6 +7,7 @@ shallow_clone = true
|
||||
template = "python"
|
||||
dev-dependencies = [
|
||||
"host:python312",
|
||||
"python312",
|
||||
]
|
||||
|
||||
[package]
|
||||
|
||||
@ -9,6 +9,7 @@ dev-dependencies = [
|
||||
"host:python312",
|
||||
"host:python3-setuptools",
|
||||
"host:python3-cython",
|
||||
"python312",
|
||||
]
|
||||
|
||||
[package]
|
||||
|
||||
@ -16,13 +16,16 @@ dev-dependencies = [
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cookbook_meson -Dpython="python3.12" \
|
||||
PYTHON_INIT
|
||||
cookbook_meson -Dpython="${COOKBOOK_PYTHON_V}" \
|
||||
-Dbuild_introspection_data=false
|
||||
sed -i "s|${COOKBOOK_TOOLCHAIN}||g" ${COOKBOOK_STAGE}/usr/bin/g-ir-annotation-tool
|
||||
sed -i "s|${COOKBOOK_TOOLCHAIN}||g" ${COOKBOOK_STAGE}/usr/bin/g-ir-scanner
|
||||
sed -i "s|${COOKBOOK_TOOLCHAIN}||g" "${COOKBOOK_STAGE}"/usr/bin/g-ir-annotation-tool
|
||||
sed -i "s|${COOKBOOK_TOOLCHAIN}||g" "${COOKBOOK_STAGE}"/usr/bin/g-ir-scanner
|
||||
mv "${COOKBOOK_STAGE}"/usr/lib/gobject-introspection "${COOKBOOK_STAGE}"/usr/lib/${COOKBOOK_PYTHON_V}
|
||||
"""
|
||||
|
||||
[package]
|
||||
dependencies = [
|
||||
"python312",
|
||||
"python3-setuptools",
|
||||
]
|
||||
|
||||
@ -349,10 +349,17 @@ function cookbook_meson {
|
||||
DESTDIR="${COOKBOOK_STAGE}" "${COOKBOOK_NINJA}" install -j"${COOKBOOK_MAKE_JOBS}"
|
||||
}
|
||||
COOKBOOK_PYTHON="${COOKBOOK_TOOLCHAIN}/bin/python3"
|
||||
function cookbook_python {
|
||||
COOKBOOK_PYTHON_V="python3.12"
|
||||
function PYTHON_INIT {
|
||||
ARCH="${TARGET%%-*}"
|
||||
OS=$(echo "${TARGET}" | cut -d - -f3-4)
|
||||
SYSTEM=$(echo "${TARGET}" | cut -d - -f3)
|
||||
export PYTHONPYCACHEPREFIX="${COOKBOOK_BUILD}" _PYTHON_HOST_PLATFORM="$OS-$ARCH"
|
||||
export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}${COOKBOOK_SYSROOT}/usr/lib/${COOKBOOK_PYTHON_V}"
|
||||
export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata__${SYSTEM}_${ARCH}-${OS}"
|
||||
}
|
||||
function cookbook_python {
|
||||
PYTHON_INIT
|
||||
"${COOKBOOK_PYTHON}" -m pip install --prefix="${COOKBOOK_STAGE}/usr" "${COOKBOOK_SOURCE}" \
|
||||
--ignore-installed --no-index "$@"
|
||||
rsync -av "${COOKBOOK_BUILD}/${COOKBOOK_STAGE}/usr/" "${COOKBOOK_STAGE}/usr"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user