diff options
author | jlam <jlam@pkgsrc.org> | 2004-01-21 04:28:06 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-01-21 04:28:06 +0000 |
commit | 94c47fcab3e19794f07c3806bfa100c64188a0c3 (patch) | |
tree | 2aec33caf94d35ebba958a25c95e334fe3db9cb7 /devel | |
parent | 4152ee431a931129721884c6be324be45e992521 (diff) | |
download | pkgsrc-94c47fcab3e19794f07c3806bfa100c64188a0c3.tar.gz |
* Fix stupid bug where this file worked for NetBSD and broke for all
other platforms (a YES should have been a NO, plus it was in the wrong
place!). This should fix PR 24129.
* Add more sophisticated ncurses version detection for platforms that
actually have real ncurses in the base system. This should be a win
for FreeBSD systems.
* Downgrade the required ncurses to 5.0. The previous bump done in
revision 1.8 wasn't necessary since ncurses never had a dependency on
libiconv.
Diffstat (limited to 'devel')
-rw-r--r-- | devel/ncurses/buildlink3.mk | 68 |
1 files changed, 51 insertions, 17 deletions
diff --git a/devel/ncurses/buildlink3.mk b/devel/ncurses/buildlink3.mk index 4f7374afc48..4ebebd9bcd2 100644 --- a/devel/ncurses/buildlink3.mk +++ b/devel/ncurses/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.8 2004/01/19 10:34:26 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.9 2004/01/21 04:28:06 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ NCURSES_BUILDLINK3_MK:= ${NCURSES_BUILDLINK3_MK}+ @@ -7,7 +7,7 @@ NCURSES_BUILDLINK3_MK:= ${NCURSES_BUILDLINK3_MK}+ .if !empty(NCURSES_BUILDLINK3_MK:M+) BUILDLINK_PACKAGES+= ncurses -BUILDLINK_DEPENDS.ncurses?= ncurses>=5.3nb1 +BUILDLINK_DEPENDS.ncurses?= ncurses>=5.0 BUILDLINK_PKGSRCDIR.ncurses?= ../../devel/ncurses .endif # NCURSES_BUILDLINK3_MK @@ -23,11 +23,21 @@ _BLNK_LIBNCURSES_FOUND!= \ MAKEFLAGS+= _BLNK_LIBNCURSES_FOUND="${_BLNK_LIBNCURSES_FOUND}" .endif +_NCURSES_H= /usr/include/curses.h + .if !defined(BUILDLINK_IS_BUILTIN.ncurses) BUILDLINK_IS_BUILTIN.ncurses= NO . if ${_BLNK_LIBNCURSES_FOUND} == "YES" BUILDLINK_IS_BUILTIN.ncurses= YES +. elif exists(${_NCURSES_H}) +BUILDLINK_IS_BUILTIN.ncurses!= \ + if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi . endif +MAKEFLAGS+= BUILDLINK_IS_BUILTIN.ncurses="${BUILDLINK_IS_BUILTIN.ncurses}" .endif .if defined(USE_NCURSES) @@ -40,28 +50,52 @@ BUILDLINK_USE_BUILTIN.ncurses= YES .if !defined(BUILDLINK_USE_BUILTIN.ncurses) . if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[nN][oO]) +BUILDLINK_USE_BUILTIN.ncurses= NO +# +# XXX By default, assume that the builtin curses on NetBSD systems +# XXX supports ncurses. +# +. if ${OPSYS} == "NetBSD" BUILDLINK_USE_BUILTIN.ncurses= YES -. else # -# These versions of NetBSD didn't have a curses library that was capable of -# replacing ncurses. +# These versions of NetBSD didn't have a curses library that was +# capable of replacing ncurses. +# +# XXX In reality, no version of NetBSD has a curses library that can +# XXX completely replace ncurses; however, some version implement +# XXX enough of ncurses that some packages are happy. # _INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-* _INCOMPAT_CURSES+= NetBSD-1.4.*-* NetBSD-1.4[A-X]-* +. for _pattern_ in ${_INCOMPAT_CURSES} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +BUILDLINK_USE_BUILTIN.ncurses= NO +. endif +. endfor +. endif +. else +BUILDLINK_USE_BUILTIN.ncurses= YES # -# These catch-alls are probably too broad, but better to err on the safe -# side. We can narrow down the match when we have better information. +# Create an appropriate name for the built-in package distributed +# with the system. This package name can be used to check against +# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc +# version or if the built-in one is sufficient. # -_INCOMPAT_CURSES+= SunOS-*-* -_INCOMPAT_CURSES+= IRIX-*-* -_INCOMPAT_CURSES+= Darwin-*-* - -INCOMPAT_CURSES?= # empty -. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) -BUILDLINK_USE_BUILTIN.ncurses= NO -. endif -. endfor +_NCURSES_VERSION!= \ + ${AWK} '/\#define[ ]*NCURSES_VERSION[ ]/ { \ + vers = $$3; \ + gsub("\"", "", vers); \ + print vers; \ + } \ + ' ${_NCURSES_H} +_NCURSES_PKG= ncurses-${_NCURSES_VERSION} +_NCURSES_DEPENDS= ${BUILDLINK_DEPENDS.ncurses} +BUILDLINK_USE_BUILTIN.ncurses!= \ + if ${PKG_ADMIN} pmatch '${_NCURSES_DEPENDS}' ${_NCURSES_PKG}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi . endif MAKEFLAGS+= \ BUILDLINK_USE_BUILTIN.ncurses="${BUILDLINK_USE_BUILTIN.ncurses}" |