Fix ncursesw, readline and bzip2 for python build

This commit is contained in:
Wildan M 2026-03-10 10:37:44 +07:00
parent 18707198ea
commit 6581cf2163
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
9 changed files with 32 additions and 85 deletions

View File

@ -10,7 +10,6 @@ template = "custom"
dependencies = [
"target:bzip2",
"target:libffi",
"target:libuuid",
"target:openssl3",
"target:ncursesw",
"target:readline",
@ -38,6 +37,7 @@ if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
--with-build-python="${COOKBOOK_TOOLCHAIN}/usr/bin/python3.12"
--with-ensurepip=install
--disable-test-modules
--with-ssl-default-suites=openssl
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
)

View File

@ -120,58 +120,6 @@ diff -ruwN source/Modules/_cryptmodule.c source-new/Modules/_cryptmodule.c
if (crypt_result == NULL) {
return PyErr_SetFromErrno(PyExc_OSError);
}
diff -ruwN source/Modules/posixmodule.c source-new/Modules/posixmodule.c
--- source/Modules/posixmodule.c 2025-10-09 18:07:00.000000000 +0700
+++ source-new/Modules/posixmodule.c 2025-12-09 22:14:30.781035339 +0700
@@ -2695,8 +2695,7 @@
#ifdef HAVE_FSTATAT
if ((dir_fd != DEFAULT_DIR_FD) || !follow_symlinks) {
if (HAVE_FSTATAT_RUNTIME) {
- result = fstatat(dir_fd, path->narrow, &st,
- follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ result = fstatat(dir_fd, path->narrow, &st, 0);
} else {
fstatat_unavailable = 1;
@@ -3186,8 +3185,6 @@
if (HAVE_FACCESSAT_RUNTIME) {
int flags = 0;
- if (!follow_symlinks)
- flags |= AT_SYMLINK_NOFOLLOW;
if (effective_ids)
flags |= AT_EACCESS;
result = faccessat(dir_fd, path->narrow, mode, flags);
@@ -3472,8 +3469,7 @@
* support dir_fd and follow_symlinks=False. (Hopefully.)
* Until then, we need to be careful what exception we raise.
*/
- result = fchmodat(dir_fd, path->narrow, mode,
- follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ result = fchmodat(dir_fd, path->narrow, mode, 0);
/*
* But wait! We can't throw the exception without allowing threads,
* and we can't do that in this nested scope. (Macro trickery, sigh.)
@@ -3850,8 +3846,7 @@
#ifdef HAVE_FCHOWNAT
if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) {
if (HAVE_FCHOWNAT_RUNTIME) {
- result = fchownat(dir_fd, path->narrow, uid, gid,
- follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ result = fchownat(dir_fd, path->narrow, uid, gid, 0);
} else {
fchownat_unsupported = 1;
}
@@ -14727,8 +14722,7 @@
#ifdef HAVE_FSTATAT
if (HAVE_FSTATAT_RUNTIME) {
Py_BEGIN_ALLOW_THREADS
- result = fstatat(self->dir_fd, path, &st,
- follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ result = fstatat(self->dir_fd, path, &st, 0);
Py_END_ALLOW_THREADS
} else
diff -ruwN source/Modules/resource.c source-new/Modules/resource.c
--- source/Modules/resource.c 2025-10-09 18:07:00.000000000 +0700
+++ source-new/Modules/resource.c 2025-12-09 22:14:30.781035339 +0700

View File

@ -1,5 +1,5 @@
[source]
tar = "https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz"
tar = "https://ftp.gnu.org/gnu/ncurses/ncurses-6.6.tar.gz"
blake3 = "0d1c9fdf53c0ca4bd66ba707d49a079d2dd6f5a960cdec74a56e29952c4ffe73"
patches = [
"redox.patch"
@ -15,6 +15,9 @@ COOKBOOK_CONFIGURE_FLAGS+=(
--without-ada
--without-manpages
--without-tests
--enable-pc-files
--with-terminfo-dirs=/usr/share/terminfo
--with-pkg-config-libdir=/usr/lib/pkgconfig
cf_cv_func_mkstemp=yes
)
if [ "${COOKBOOK_DYNAMIC}" == "1" ]

View File

@ -13,10 +13,16 @@ COOKBOOK_CONFIGURE_FLAGS+=(
--without-ada
--without-manpages
--without-tests
--with-shared
--enable-pc-files
--with-terminfo-dirs=/usr/share/terminfo
--with-pkg-config-libdir=/usr/lib/pkgconfig
cf_cv_func_mkstemp=yes
cf_cv_wint_t=yes
)
if [ "${COOKBOOK_DYNAMIC}" == "1" ]
then
COOKBOOK_CONFIGURE_FLAGS+=(--with-shared)
fi
cookbook_configure
"""

View File

@ -1,9 +1,6 @@
[source]
tar = "https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz"
blake3 = "962483e201f36f05a5ccb507bb7330b4d4e4989fd52f41eb15ba65582ad02703"
patches = [
"redox.patch"
]
tar = "https://ftp.gnu.org/gnu/readline/readline-8.3.tar.gz"
blake3 = "7109f094062bda387a0c16b4875375b96e36437bebbbd8d8f91bb27ba01d687f"
[build]
template = "custom"
@ -15,7 +12,8 @@ DYNAMIC_INIT
cookbook_configure
OS=$(echo "${TARGET}" | cut -d - -f3)
if [ "${OS}" = "redox" ]; then
ln -s "libhistory.so.7" "${COOKBOOK_STAGE}"/usr/lib/libhistory.so
ln -s "libreadline.so.7" "${COOKBOOK_STAGE}"/usr/lib/libreadline.so
ln -s "libhistory.so.8" "${COOKBOOK_STAGE}"/usr/lib/libhistory.so
ln -s "libreadline.so.8" "${COOKBOOK_STAGE}"/usr/lib/libreadline.so
patchelf --add-needed libncursesw.so "${COOKBOOK_STAGE}/usr/lib/libreadline.so.8"
fi
"""

View File

@ -1,21 +0,0 @@
diff -ru source/support/config.sub source-new/support/config.sub
--- source/support/config.sub 2013-12-17 16:49:47.000000000 +0100
+++ source-new/support/config.sub 2017-08-14 09:09:20.158401733 +0200
@@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2013-10-01'
+timestamp='2017-08-14'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -1351,7 +1351,7 @@
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* | -redox* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \

View File

@ -0,0 +1,10 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: bzip2
Description: A file compression library
Version: 1.0.8
Libs: -L${libdir} -lbz2
Cflags: -I${includedir}

View File

@ -32,4 +32,7 @@ rsync -av --delete "${COOKBOOK_SOURCE}/" ./
cp -av libbz2.so* "${COOKBOOK_STAGE}/lib"
ln -sr "${COOKBOOK_STAGE}/lib/libbz2.so.1.0" "${COOKBOOK_STAGE}/lib/libbz2.so.1"
ln -sr "${COOKBOOK_STAGE}/lib/libbz2.so.1.0" "${COOKBOOK_STAGE}/lib/libbz2.so"
mkdir -p "${COOKBOOK_STAGE}/lib/pkgconfig"
cp "${COOKBOOK_RECIPE}/pkgconfig" "${COOKBOOK_STAGE}/lib/pkgconfig/bzip2.pc"
"""

View File

@ -136,7 +136,7 @@ fn auto_deps_from_dynamic_linking(
if verbose {
log_to_pty!(logger, "DEBUG: {} provides {}", dep, child_name);
}
deps.insert(dep.clone());
deps.insert(dep.with_prefix(pkg::PackagePrefix::Any));
missing.remove(child_name);
}
}
@ -555,7 +555,7 @@ fn build_deps_dir(
&tags_dir,
&dep_pkgars
.iter()
.map(|(name, _)| name.without_host())
.map(|(name, _)| name.without_prefix())
.collect(),
)?
{