From 5b8f009e7d7e633ba2717b9ecca531855232d1a1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 16 Feb 2025 13:24:36 +0000 Subject: [PATCH] ncurses: Fix linking without libtinfo This patch will automatically add libtinfo to everywhere we are linking against any of the other libraries. It will also provide an easy way to link against libtermcap. Finally, this patch enabled symbol versioning. Signed-off-by: Michael Tremer --- ncurses/ncurses.nm | 10 ++-- ncurses/patches/ncurses-6.3-libs.patch | 58 +++++++++++++++++++++ ncurses/patches/ncurses-6.3-pkgconfig.patch | 24 +++++++++ 3 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 ncurses/patches/ncurses-6.3-libs.patch create mode 100644 ncurses/patches/ncurses-6.3-pkgconfig.patch diff --git a/ncurses/ncurses.nm b/ncurses/ncurses.nm index 691c3137c..a57591bb7 100644 --- a/ncurses/ncurses.nm +++ b/ncurses/ncurses.nm @@ -5,7 +5,7 @@ name = ncurses version = 6.5 -release = 1 +release = 2 thisapp = %{name}-%{version} groups = System/Base @@ -29,6 +29,7 @@ build configure_options += \ --with-shared \ + --with-versioned-syms \ --without-debug \ --without-ada \ --with-terminfo-dirs=%{sysconfdir}/terminfo:%{datadir}/terminfo \ @@ -50,14 +51,17 @@ build mkdir -pv %{BUILDROOT}/etc/terminfo # Some packages are looking for -lcurses instead of -lncurses - printf "INPUT(-lncursesw)\n" > "%{BUILDROOT}%{libdir}/libcursesw.so" + printf "INPUT(-lncursesw -ltinfo)\n" > "%{BUILDROOT}%{libdir}/libcursesw.so" ln -svf "libncurses.so" "%{BUILDROOT}%{libdir}/libcurses.so" # Have packages linking against libncurses use libncursesw instead for lib in ncurses ncurses++ form panel menu; do - printf "INPUT(-l%sw)\n" "${lib}" > "%{BUILDROOT}%{libdir}/lib${lib}.so" + printf "INPUT(-l%sw -ltinfo)\n" "${lib}" > "%{BUILDROOT}%{libdir}/lib${lib}.so" ln -svf "${lib}w.pc" "%{BULDROOT}%{libdir}/pkgconfig/${lib}.pc" done + + # libterminfo compatibility + printf "INPUT(-ltinfo)\n" > "%{BUILDROOT}%{libdir}/libtermcap.so" end end diff --git a/ncurses/patches/ncurses-6.3-libs.patch b/ncurses/patches/ncurses-6.3-libs.patch new file mode 100644 index 000000000..1933a541e --- /dev/null +++ b/ncurses/patches/ncurses-6.3-libs.patch @@ -0,0 +1,58 @@ +diff -ruN a/c++/Makefile.in b/c++/Makefile.in +--- a/c++/Makefile.in 2021-07-03 20:53:57.000000000 +0200 ++++ b/c++/Makefile.in 2021-11-03 10:58:04.147647447 +0100 +@@ -118,7 +118,7 @@ + -l@FORM_NAME@@USE_LIB_SUFFIX@ \ + -l@MENU_NAME@@USE_LIB_SUFFIX@ \ + -l@PANEL_NAME@@USE_LIB_SUFFIX@ \ +- -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@ ++ -lncurses@USE_LIB_SUFFIX@ + + LIBROOT = ncurses++ + +@@ -157,8 +157,7 @@ + LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@) + + # flags for library built by this makefile +-LDFLAGS = $(TEST_ARGS) @LDFLAGS@ \ +- @LD_MODEL@ $(TEST_LIBS) @LIBS@ $(CXXLIBS) ++LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ $(CXXLIBS) + + AUTO_SRC = \ + etip.h +diff -ruN a/form/Makefile.in b/form/Makefile.in +--- a/form/Makefile.in 2021-07-03 17:45:33.000000000 +0200 ++++ b/form/Makefile.in 2021-11-03 10:58:45.301114373 +0100 +@@ -110,7 +110,7 @@ + LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + + SHLIB_DIRS = -L../lib +-SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@ ++SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ + + RPATH_LIST = @RPATH_LIST@ + RESULTING_SYMS = @RESULTING_SYMS@ +diff -ruN a/menu/Makefile.in b/menu/Makefile.in +--- a/menu/Makefile.in 2021-07-03 17:45:33.000000000 +0200 ++++ b/menu/Makefile.in 2021-11-03 10:58:59.461160284 +0100 +@@ -110,7 +110,7 @@ + LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + + SHLIB_DIRS = -L../lib +-SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@ ++SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ + + RPATH_LIST = @RPATH_LIST@ + RESULTING_SYMS = @RESULTING_SYMS@ +diff -ruN a/panel/Makefile.in b/panel/Makefile.in +--- a/panel/Makefile.in 2021-07-03 17:45:33.000000000 +0200 ++++ b/panel/Makefile.in 2021-11-03 10:59:33.957938691 +0100 +@@ -112,7 +112,7 @@ + LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + + SHLIB_DIRS = -L../lib +-SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@ ++SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ + + RPATH_LIST = @RPATH_LIST@ + RESULTING_SYMS = @RESULTING_SYMS@ diff --git a/ncurses/patches/ncurses-6.3-pkgconfig.patch b/ncurses/patches/ncurses-6.3-pkgconfig.patch new file mode 100644 index 000000000..e3b5d4650 --- /dev/null +++ b/ncurses/patches/ncurses-6.3-pkgconfig.patch @@ -0,0 +1,24 @@ +diff -ruN a/misc/gen-pkgconfig.in b/misc/gen-pkgconfig.in +--- a/misc/gen-pkgconfig.in 2021-08-07 23:36:33.000000000 +0200 ++++ b/misc/gen-pkgconfig.in 2021-11-03 11:12:51.127160950 +0100 +@@ -83,7 +83,7 @@ + fi + + lib_flags= +-for opt in -L$libdir @EXTRA_PKG_LDFLAGS@ @LIBS@ ++for opt in -L$libdir @LIBS@ + do + case $opt in + -l*) # LIBS is handled specially below +diff -ruN a/misc/ncurses-config.in b/misc/ncurses-config.in +--- a/misc/ncurses-config.in 2021-08-07 23:36:14.000000000 +0200 ++++ b/misc/ncurses-config.in 2021-11-03 11:26:12.393533954 +0100 +@@ -101,7 +101,7 @@ + # There is no portable way to find the list of standard library directories. + # Require a POSIX shell anyway, to keep this simple. + lib_flags= +-for opt in -L$libdir @EXTRA_PKG_LDFLAGS@ $LIBS ++for opt in -L$libdir $LIBS + do + case $opt in + -specs*) # ignore linker specs-files which were used to build library -- 2.47.3