Files
RedBear-OS/recipes/dev/python312/recipe.toml
T
vasilito 07049508cf Fix python312 + icu cross-compilation blockers
python312: Added --disable-test-modules to host build configure flags.
The host build (needed as dev-dependency for cross-compile) was
trying to compile test modules (_testmultiphase, xxlimited, etc.)
which fail on this system. The cross-compile already had this flag.

icu: Added --disable-tools to cross-compile configure flags. The ICU
data tools (genrb, derb) try to link against cross-compiled static
libraries, causing C++ vtable linker errors (undefined reference
to vtable for UTF16CollationIterator). Tools are built in the host
step; cross-compile only needs the libraries.

Combined with zsh --srcdir, base staging mkdir, and netstack fix,
these unblock the redbear-mini build.
2026-07-09 01:54:41 +03:00

72 lines
1.7 KiB
TOML

[source]
tar = "https://www.python.org/ftp/python/3.12.12/Python-3.12.12.tar.xz"
blake3 = "29636fdae3e0ee8d0fe585e528c9376fe43876f5f3f0f7892140567946fd907b"
patches = [
"redox.patch"
]
[build]
template = "custom"
dependencies = [
"target:bzip2",
"target:libffi",
"target:openssl3",
"target:ncursesw",
"target:readline",
"target:sqlite3",
"target:zlib",
"target:xz",
"target:zstd",
]
dev-dependencies = [
"host:python312"
]
script = """
DYNAMIC_INIT
export PYTHONDONTWRITEBYTECODE=1
ARCH="${TARGET%%-*}"
OS=$(echo "${TARGET}" | cut -d - -f3-4)
if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
BUILD_PYTHON="${COOKBOOK_TOOLCHAIN}/bin/python3.12"
if [ ! -x "${BUILD_PYTHON}" ]; then
echo "ERROR: host python312 dev-dependency not staged at ${BUILD_PYTHON}" >&2
exit 1
fi
COOKBOOK_CONFIGURE_FLAGS=(
--prefix=/usr
--disable-ipv6
--host=${GNU_TARGET}
--build="$ARCH"
--with-build-python="${BUILD_PYTHON}"
--with-ensurepip=install
--disable-test-modules
--with-ssl-default-suites=openssl
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
ac_cv_exeext=""
)
else
COOKBOOK_CONFIGURE_FLAGS=(--prefix=/usr --disable-test-modules)
fi
if [ "${COOKBOOK_DYNAMIC}" != "1" ]; then
export MODULE_BUILDTYPE=static
COOKBOOK_CONFIGURE_FLAGS+=( --enable-shared )
fi
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)
"""
[[optional-packages]]
name = "dev"
files = [
"usr/lib/python3.12/config-*/**",
"usr/lib/libpython*.a"
]