From 942eaf1a63b449405e80955107933eca25f4d9d8 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 12 Jul 2025 17:19:34 +0300 Subject: [PATCH] Add patches for readline 8.3 --- pkg.info | 1 + source-files/8.3.0-display-null-prompt.patch | 15 +++++++++ source-files/8.3.0-event-hook.patch | 33 ++++++++++++++++++++ source.sh | 6 ++++ 4 files changed, 55 insertions(+) create mode 100644 source-files/8.3.0-display-null-prompt.patch create mode 100644 source-files/8.3.0-event-hook.patch diff --git a/pkg.info b/pkg.info index f9b37cf..a890fb6 100644 --- a/pkg.info +++ b/pkg.info @@ -1,6 +1,7 @@ name: readline description: GNU readline library version: 8.3 +revision: 2 url: https://tiswww.case.edu/php/chet/readline/rltop.html license: GPL3-only architecture: any diff --git a/source-files/8.3.0-display-null-prompt.patch b/source-files/8.3.0-display-null-prompt.patch new file mode 100644 index 0000000..6566539 --- /dev/null +++ b/source-files/8.3.0-display-null-prompt.patch @@ -0,0 +1,15 @@ +*** ../readline-8.3/display.c Fri May 2 09:20:32 2025 +--- display.c Sun Jul 6 17:16:28 2025 +*************** +*** 784,788 **** + /* Useful shorthand used by rl_redisplay, update_line, rl_move_cursor_relative */ + #define INVIS_FIRST() (local_prompt_invis_chars[0]) +! #define WRAP_OFFSET(line, offset) ((line <= prompt_last_screen_line) ? local_prompt_invis_chars[line] : 0) + + #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) +--- 784,788 ---- + /* Useful shorthand used by rl_redisplay, update_line, rl_move_cursor_relative */ + #define INVIS_FIRST() (local_prompt_invis_chars[0]) +! #define WRAP_OFFSET(line, offset) ((line <= prompt_last_screen_line && local_prompt_invis_chars) ? local_prompt_invis_chars[line] : 0) + + #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) diff --git a/source-files/8.3.0-event-hook.patch b/source-files/8.3.0-event-hook.patch new file mode 100644 index 0000000..25e60a3 --- /dev/null +++ b/source-files/8.3.0-event-hook.patch @@ -0,0 +1,33 @@ +*** ../readline-8.3/input.c Fri May 2 09:29:05 2025 +--- input.c Tue Jul 8 15:37:13 2025 +*************** +*** 262,266 **** + tty = fileno (rl_instream); + +! /* Move this up here to give it first shot, but it can't set chars_avail */ + /* XXX - need rl_chars_available_hook? */ + if (rl_input_available_hook) +--- 262,267 ---- + tty = fileno (rl_instream); + +! /* Move this up here to give it first shot, but it can't set chars_avail, +! so we assume a single character is available. */ + /* XXX - need rl_chars_available_hook? */ + if (rl_input_available_hook) +*************** +*** 269,272 **** +--- 270,275 ---- + if (result == 0) + result = -1; ++ else ++ chars_avail = 1; + } + +*************** +*** 286,289 **** +--- 289,293 ---- + if (result <= 0) + return 0; /* Nothing to read. */ ++ result = -1; /* there is something, so check how many chars below */ + } + #endif diff --git a/source.sh b/source.sh index f8bf038..a6c9847 100644 --- a/source.sh +++ b/source.sh @@ -10,6 +10,12 @@ FILENAME="${DOWNLOAD##*/}" prepare() { wget "$DOWNLOAD" tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + # Apply patches + cd "$BPM_SOURCE" + patch -Np2 < "$BPM_WORKDIR"/8.3.0-display-null-prompt.patch + patch -Np2 < "$BPM_WORKDIR"/8.3.0-event-hook.patch + autoconf -fiv } # The build function is executed in the source directory