From 278084c7913ef062b867f8c1a1fc3d0c41f4bfb5 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Thu, 10 Sep 2026 01:47:05 +0200 Subject: [PATCH] Properly patch readline --- recipes/libs/readline/recipe.toml | 11 +++----- recipes/libs/readline/redox.patch | 45 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 recipes/libs/readline/redox.patch diff --git a/recipes/libs/readline/recipe.toml b/recipes/libs/readline/recipe.toml index 208e17e69..3f5cf559f 100644 --- a/recipes/libs/readline/recipe.toml +++ b/recipes/libs/readline/recipe.toml @@ -1,6 +1,9 @@ [source] tar = "https://ftp.gnu.org/gnu/readline/readline-8.3.tar.gz" blake3 = "7109f094062bda387a0c16b4875375b96e36437bebbbd8d8f91bb27ba01d687f" +patches = [ + "redox.patch" +] [build] template = "custom" @@ -9,13 +12,7 @@ dependencies = [ ] script = """ DYNAMIC_INIT +COOKBOOK_MAKE_FLAGS=(SHLIB_LIBS="-lncursesw") cookbook_configure OS=$(echo "${TARGET}" | cut -d - -f3) -if [ "${OS}" = "redox" ]; then -if [ "${COOKBOOK_DYNAMIC}" = "1" ]; then - 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 -fi """ diff --git a/recipes/libs/readline/redox.patch b/recipes/libs/readline/redox.patch new file mode 100644 index 000000000..02c60c236 --- /dev/null +++ b/recipes/libs/readline/redox.patch @@ -0,0 +1,45 @@ +diff -ruwN source/support/config.rpath source-new/support/config.rpath +--- source/support/config.rpath 2024-12-13 15:06:05.000000000 +0100 ++++ source-new/support/config.rpath 2026-09-10 01:30:24.508062009 +0200 +@@ -132,7 +132,7 @@ + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; +- linux* | k*bsd*-gnu | kopensolaris*-gnu) ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | redox*) + case $cc_basename in + ecc*) + wl='-Wl,' +diff -ruwN source/support/shlib-install source-new/support/shlib-install +--- source/support/shlib-install 2019-12-13 15:46:13.000000000 +0100 ++++ source-new/support/shlib-install 2026-09-10 01:32:00.337579502 +0200 +@@ -71,7 +71,7 @@ + # Cygwin installs both a dll (which must go in $BINDIR) and an implicit + # link library (in $libdir) + case "$host_os" in +-hpux*|darwin*|macosx*|linux*|solaris2*) ++hpux*|darwin*|macosx*|linux*|solaris2*|redox*) + if [ -z "$uninstall" ]; then + chmod 755 ${INSTALLDIR}/${LIBNAME} + fi ;; +@@ -118,7 +118,7 @@ + # Create symlinks to the installed library. This section is incomplete. + # + case "$host_os-$host_vendor" in +-*linux*|freebsd*|dragonfly*) ++*linux*|freebsd*|dragonfly*|redox*) + # libname.so.M -> libname.so.M.N + ${echo} ${RM} ${INSTALLDIR}/$LINK2 + if [ -z "$uninstall" ]; then +diff -ruwN source/support/shobj-conf source-new/support/shobj-conf +--- source/support/shobj-conf 2024-02-14 16:42:57.000000000 +0100 ++++ source-new/support/shobj-conf 2026-09-02 12:52:53.682084689 +0200 +@@ -123,7 +123,7 @@ + ;; + + # All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd. +-linux*-*|gnu*-*|k*bsd*-gnu-*|midnightbsd*|freebsd*|dragonfly*) ++linux*-*|gnu*-*|k*bsd*-gnu-*|midnightbsd*|freebsd*|dragonfly*|redox*) + SHOBJ_CFLAGS=-fPIC + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'