diff mbox series

[meta-perl,1/5] libcurses-perl: link Curses.so against ncurses

Message ID 20261201021139.2312947-2-tim.orling@konsulko.com
State New
Headers show
Series perl recipes: fix modules that fail to load | expand

Commit Message

Tim Orling Dec. 1, 2026, 2:11 a.m. UTC
LIBS=-L${STAGING_LIBDIR} in EXTRA_CPANFLAGS replaces the libraries that
Makefile.PL picks, so Curses.so is not linked against ncurses and fails
to load on target:

  Curses.so: undefined symbol: curscr

Makefile.PL also picks the library by looking at the host's
/usr/include. Set CURSES_LIBTYPE, CURSES_CFLAGS and CURSES_LDFLAGS
instead, which Makefile.PL reads, using ncursesw unless ENABLE_WIDEC is
disabled, as the musl CFLAGS already do.

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb b/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb
index e2cc901d5e..315e1a6e49 100644
--- a/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb
+++ b/meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb
@@ -17,7 +17,14 @@  SRC_URI[sha256sum] = "9631d6e3e2859c85913d8b8724f61fbebb9e932e9e50aa0493a4e02766
 
 S = "${UNPACKDIR}/Curses-${PV}"
 
-EXTRA_CPANFLAGS = "INC=-I${STAGING_INCDIR} LIBS=-L${STAGING_LIBDIR} TEST_SYMS_OPTS=-v"
+EXTRA_CPANFLAGS = "TEST_SYMS_OPTS=-v"
+
+# Tell Makefile.PL which library to link, instead of letting it look in
+# the host /usr/include
+CURSES_LIBTYPE = "${@'ncursesw' if bb.utils.to_boolean((d.getVar('ENABLE_WIDEC') or 'True')) else 'ncurses'}"
+export CURSES_LIBTYPE
+export CURSES_CFLAGS = "-I${STAGING_INCDIR}"
+export CURSES_LDFLAGS = "-L${STAGING_LIBDIR} -l${CURSES_LIBTYPE}"
 
 # enable NCURSES_WIDECHAR=1 only if ENABLE_WIDEC has not been explicitly disabled (e.g. by the distro config).
 # When compiling against the ncurses library, NCURSES_WIDECHAR needs to explicitly set to 0 in this case.