app-editors/curses-hexedit: look up ncurses details via pkg-config
authorMike Frysinger <vapier@gentoo.org>
Fri, 14 Aug 2015 04:05:15 +0000 (00:05 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 14 Aug 2015 04:05:36 +0000 (00:05 -0400)
app-editors/curses-hexedit/curses-hexedit-0.9.7.ebuild
app-editors/curses-hexedit/files/curses-hexedit-0.9.7-ncurses-pkg-config.patch [new file with mode: 0644]

index 0d5772286225e951c64cad71afa11874cefd2280..5627f0a24f5cc6adf5c9fb32f1dadcabf5db568a 100644 (file)
@@ -6,7 +6,7 @@
 
 EAPI="5"
 
-inherit toolchain-funcs
+inherit toolchain-funcs eutils autotools
 
 MY_P=${P/curses-}
 DESCRIPTION="full screen curses hex editor (with insert/delete support)"
@@ -23,9 +23,11 @@ DEPEND="${RDEPEND}"
 
 S=${WORKDIR}/${MY_P}
 
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-ncurses-pkg-config.patch
+       eautoreconf
+}
+
 src_configure() {
-       # Package has an old configure script.
-       CONFIG_SHELL="/bin/bash"
-       tc-export CC
        econf --program-prefix=curses-
 }
diff --git a/app-editors/curses-hexedit/files/curses-hexedit-0.9.7-ncurses-pkg-config.patch b/app-editors/curses-hexedit/files/curses-hexedit-0.9.7-ncurses-pkg-config.patch
new file mode 100644 (file)
index 0000000..94d6263
--- /dev/null
@@ -0,0 +1,34 @@
+use pkg-config to locate ncurses rather than a library search
+
+--- a/configure.in
++++ b/configure.in
+@@ -19,14 +19,9 @@
+ AC_HEADER_STDC
+ AC_PROG_GCC_TRADITIONAL
+-AC_CHECK_HEADERS(ncurses.h)
+-if test "$ac_cv_header_ncurses_h" = "no"; then
+-  AC_CHECK_HEADERS(curses.h)
+-  if test "$ac_cv_header_curses_h" = "no"; then
+-    echo "*** Cannot find Curses headers, probably not installed"
+-    echo "*** Hexedit will not run without the curses library"
+-  fi
+-fi
++PKG_CHECK_MODULES(NCURSES, ncurses)
++CFLAGS="$CFLAGS $NCURSES_CFLAGS -DHAVE_NCURSES_H=1"
++LIBS="$LIBS $NCURSES_LIBS"
+ AC_CHECK_HEADERS(fcntl.h getopt.h limits.h sys/ioctl.h unistd.h)
+ AC_HEADER_DIRENT
+@@ -96,11 +91,4 @@ else
+   fi
+ fi
+-AC_CHECK_LIB(ncurses, newwin, ,
+-    AC_CHECK_LIB(curses, newwin), ,
+-    echo "Hexedit requires the curses library"
+-    echo "Ncurses is freely available: ftp://ftp.gnu.org/pub/gnu/"
+-    exit 1)
+-
+-
+ AC_OUTPUT(Makefile docs/Makefile gnu/Makefile src/Makefile)