From d36c5152ef30b6182d1c661ffb538e9e974e1a03 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 8 Aug 2016 17:14:41 +0200 Subject: [PATCH] ncurses: change handling of PKG_CONFIG_LIBDIR When PKG_CONFIG_LIBDIR was unset in the environment, the configure script was deducing the PKG_CONFIG_LIBDIR from the location of the pkg-config binary, which doesn't make a lot of sense, and isn't done by other autotools based packages. Patch imported from the Buildroot project: https://github.com/buildroot/buildroot/blob/master/package/ncurses/0001-fixup-pkg-config-handling.patch Also refresh patches while we're at. Signed-off-by: Jo-Philipp Wich --- package/libs/ncurses/Makefile | 2 +- .../patches/102-ncurses-5.9-gcc-5.patch | 4 +- .../103-fixup-pkg-config-handling.patch | 85 +++++++++++++++++++ .../patches/200-fix_missing_include.patch | 2 +- package/libs/ncurses/patches/500-cross.patch | 6 +- .../libs/ncurses/patches/900-terminfo.patch | 2 +- 6 files changed, 92 insertions(+), 9 deletions(-) create mode 100644 package/libs/ncurses/patches/103-fixup-pkg-config-handling.patch diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 2eee88fd3337..3d869ea18a84 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ncurses PKG_VERSION:=5.9 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch b/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch index 2448229b88e1..5e33492bf539 100644 --- a/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch +++ b/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch @@ -13,11 +13,9 @@ Subject: [PATCH] ncurses 5.9 - patch 20141206 https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html (reports by Marcus Shawcroft, Maohui Lei). -diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh -index d8cc3c9..b91398c 100755 --- a/ncurses/base/MKlib_gen.sh +++ b/ncurses/base/MKlib_gen.sh -@@ -474,11 +474,22 @@ sed -n -f $ED1 \ +@@ -437,11 +437,22 @@ sed -n -f $ED1 \ -e 's/gen_$//' \ -e 's/ / /g' >>$TMP diff --git a/package/libs/ncurses/patches/103-fixup-pkg-config-handling.patch b/package/libs/ncurses/patches/103-fixup-pkg-config-handling.patch new file mode 100644 index 000000000000..85b2296ce4b6 --- /dev/null +++ b/package/libs/ncurses/patches/103-fixup-pkg-config-handling.patch @@ -0,0 +1,85 @@ +Change handling of PKG_CONFIG_LIBDIR + +When PKG_CONFIG_LIBDIR was unset in the environment, the configure +script was deducing the PKG_CONFIG_LIBDIR from the location of the +pkg-config binary, which doesn't make a lot of sense, and isn't done +by other autotools based packages. + +Also, the configure script was checking that the directory really +exists. This forced to create the directory *and* provide an absolute +path in PKG_CONFIG_LIBDIR, which didn't play well with the fact that +at installation time, PKG_CONFIG_LIBDIR is suffixed to DESTDIR, which +means that we got two times the staging directory location. + +This patch fixes both of those issues. Also, since ncurses uses a fork +of autoconf 2.13, we can't simply use _AUTORECONF=YES, so we also fix +the configure script in this patch. + +Signed-off-by: Thomas Petazzoni + +--- a/configure ++++ b/configure +@@ -3623,27 +3623,20 @@ echo $ECHO_N "checking if we should inst + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then +- PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig ++ PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig" + fi ++ + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` +- if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + +-# Check whether --enable-pc-files or --disable-pc-files was given. +-if test "${enable_pc_files+set}" = set; then +- enableval="$enable_pc_files" +- enable_pc_files=$enableval +-else +- enable_pc_files=no +-fi; +- echo "$as_me:3638: result: $enable_pc_files" >&5 +-echo "${ECHO_T}$enable_pc_files" >&6 ++ # Check whether --enable-pc-files or --disable-pc-files was given. ++ if test "${enable_pc_files+set}" = set; then ++ enableval="$enable_pc_files" ++ enable_pc_files=$enableval + else +- echo "$as_me:3641: result: no" >&5 +-echo "${ECHO_T}no" >&6 +- { echo "$as_me:3643: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 +-echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} +- enable_pc_files=no +- fi ++ enable_pc_files=no ++ fi; ++ echo "$as_me:3638: result: $enable_pc_files" >&5 ++ echo "${ECHO_T}$enable_pc_files" >&6 + fi + + echo "$as_me:3649: checking if we should assume mixed-case filenames" >&5 +--- a/configure.in ++++ b/configure.in +@@ -174,20 +174,14 @@ if test "$PKG_CONFIG" != no ; then + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then +- PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig ++ PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig" + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` +- if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then +- AC_ARG_ENABLE(pc-files, ++ AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) +- AC_MSG_RESULT($enable_pc_files) +- else +- AC_MSG_RESULT(no) +- AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR) +- enable_pc_files=no +- fi ++ AC_MSG_RESULT($enable_pc_files) + fi + AC_SUBST(PKG_CONFIG_LIBDIR) + diff --git a/package/libs/ncurses/patches/200-fix_missing_include.patch b/package/libs/ncurses/patches/200-fix_missing_include.patch index c5d48d4ddc2c..4616c4fb7026 100644 --- a/package/libs/ncurses/patches/200-fix_missing_include.patch +++ b/package/libs/ncurses/patches/200-fix_missing_include.patch @@ -1,6 +1,6 @@ --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h -@@ -54,6 +54,11 @@ extern "C" { +@@ -55,6 +55,11 @@ extern "C" { #include diff --git a/package/libs/ncurses/patches/500-cross.patch b/package/libs/ncurses/patches/500-cross.patch index ace6252fe605..976a3cba2a17 100644 --- a/package/libs/ncurses/patches/500-cross.patch +++ b/package/libs/ncurses/patches/500-cross.patch @@ -1,11 +1,11 @@ --- a/aclocal.m4 +++ b/aclocal.m4 -@@ -4298,7 +4298,7 @@ CF_EOF - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" +@@ -5137,7 +5137,7 @@ CF_EOF + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_shared_soname',-stats,$(LDFLAGS) -lc -o $[@]' ;; - openbsd[[2-9]].*) + openbsd[[2-9]].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then diff --git a/package/libs/ncurses/patches/900-terminfo.patch b/package/libs/ncurses/patches/900-terminfo.patch index 7aab3dbca701..487a341ba9ef 100644 --- a/package/libs/ncurses/patches/900-terminfo.patch +++ b/package/libs/ncurses/patches/900-terminfo.patch @@ -1,6 +1,6 @@ --- a/misc/terminfo.src +++ b/misc/terminfo.src -@@ -3707,12 +3707,11 @@ konsole-xf3x|KDE console window with key +@@ -3947,12 +3947,11 @@ konsole-xf3x|KDE console window with key # The value for kbs reflects local customization rather than the settings used # for XFree86 xterm. konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm, -- 2.30.2