ncurses: change handling of PKG_CONFIG_LIBDIR
authorJo-Philipp Wich <jo@mein.io>
Mon, 8 Aug 2016 15:14:41 +0000 (17:14 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 15 Aug 2016 11:34:17 +0000 (13:34 +0200)
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 <jo@mein.io>
package/libs/ncurses/Makefile
package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch
package/libs/ncurses/patches/103-fixup-pkg-config-handling.patch [new file with mode: 0644]
package/libs/ncurses/patches/200-fix_missing_include.patch
package/libs/ncurses/patches/500-cross.patch
package/libs/ncurses/patches/900-terminfo.patch

index 2eee88fd3337a9643e708f49ac3b139774941326..3d869ea18a84b93e744d80a92cb1bd443ff96839 100644 (file)
@@ -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
index 2448229b88e16311e6a51d94f6e83a2479097ec7..5e33492bf53917551c07da3bc88c95dffb2c94a5 100644 (file)
@@ -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 (file)
index 0000000..85b2296
--- /dev/null
@@ -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 <thomas.petazzoni@free-electrons.com>
+
+--- 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)
index c5d48d4ddc2c8d8ed475080964ac92fd10302daf..4616c4fb7026205b2f7c7dad8f16f33888d535bb 100644 (file)
@@ -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 <ncurses_cfg.h>
  
index ace6252fe605fa68419e3b5a820c53a6455a3a52..976a3cba2a177869001bed0d4cdbb9951473d846 100644 (file)
@@ -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
index 7aab3dbca701606cc519be9ead9cd06e0c909f6b..487a341ba9ef8a27018a1f441ba34649bd44090a 100644 (file)
@@ -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,