aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2011-04-11 08:34:17 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2011-04-11 08:34:17 +0000
commit8d27ddb9bd993385ce5d7a9b17e2fe231ec8c69f (patch)
tree82565381028ebd8b5a674bafdecce3a45c5c2e6d
parent0a59b351f616abe849539bc2afbc8eba4abe8004 (diff)
downloadports-8d27ddb9bd993385ce5d7a9b17e2fe231ec8c69f.tar.gz
ports-8d27ddb9bd993385ce5d7a9b17e2fe231ec8c69f.zip
Add a new macro to deal with conflict between ncurses from base and ncurses from ports.
If a ports is linked against ncurses from base or from the ports, it should then add: USE_NCURSES=yes it is also possible to specify the hard dependency on the ports ncurses or one the base one adding the following macros: WITH_NCURSES_PORT=yes or WITH_NCURSES_BASE=yes PR: ports/155269 Submitted by: me Reviwed by: pav@ Approved by: portmgr (pav@) Exp-run by: portmgr (pav@)
Notes
Notes: svn path=/head/; revision=272515
-rw-r--r--Mk/bsd.ncurses.mk98
-rw-r--r--Mk/bsd.port.mk6
-rw-r--r--audio/cmus/Makefile5
-rw-r--r--audio/ncmpcpp/Makefile5
-rw-r--r--audio/ocp/Makefile17
-rw-r--r--audio/pytone/Makefile5
-rw-r--r--deskutils/wyrd/Makefile12
-rw-r--r--devel/cdk/Makefile13
-rw-r--r--devel/stfl/Makefile8
-rw-r--r--games/latrine/Makefile10
-rw-r--r--games/mangband/Makefile2
-rw-r--r--mail/cone/Makefile21
-rw-r--r--mail/mixmaster/Makefile5
-rw-r--r--mail/mutt-devel/Makefile12
-rw-r--r--mail/mutt/Makefile8
-rw-r--r--mail/mutt14/Makefile8
-rw-r--r--net-im/mcabber/Makefile5
-rw-r--r--net-im/tmsnc/Makefile11
-rw-r--r--security/metasploit/Makefile5
-rw-r--r--shells/zsh/Makefile1
-rw-r--r--sysutils/htop/Makefile5
-rw-r--r--www/newsbeuter/Makefile6
22 files changed, 148 insertions, 120 deletions
diff --git a/Mk/bsd.ncurses.mk b/Mk/bsd.ncurses.mk
new file mode 100644
index 000000000000..4e8388193516
--- /dev/null
+++ b/Mk/bsd.ncurses.mk
@@ -0,0 +1,98 @@
+# the user/port can now set this options in the makefiles.
+#
+# WITH_NCURSES_BASE=yes - Use the version in the base system.
+# WITH_NCURSES_PORT=yes - Use the port, even if base is up to date
+#
+# USE_NCURSES_RPATH=yes - Pass RFLAGS options in CFLAGS,
+# needed for ports who don't use LDFLAGS
+#
+# Overrideable defaults:
+#
+# NCURSES_SHLIBVER= 5
+# NCURSES_PORT= devel/ncurses
+#
+# The makefile sets this variables:
+# NCURSESBASE - "/usr" or ${LOCALBASE}
+# NCURSESLIB - path to the libs
+# NCURSESINC - path to the matching includes
+# NCURSESRPATH - rpath for dynamic linker
+#
+# MAKE_ENV - extended with the variables above
+# CONFIGURE_ENV - extended with LDFLAGS
+# BUILD_DEPENDS - are added if needed
+# RUN_DEPENDS - are added if needed
+
+# if no preference was set, check for an installed base version
+# but give an installed port preference over it.
+.if !defined(WITH_NCURSES_BASE) && \
+ !defined(WITH_NCURSES_PORT) && \
+ !exists(${DESTDIR}/${LOCALBASE}/lib/libncurses.so) && \
+ exists(${DESTDIR}/usr/include/ncurses.h)
+WITH_NCURSES_BASE=yes
+.endif
+
+.if defined(WITH_NCURSES_BASE)
+NCURSESBASE= /usr
+NCURSESINC= ${NCURSESBASE}/include
+
+.if exists(${LOCALBASE}/lib/libncurses.so)
+check-depends::
+ @${ECHO_CMD} "Dependency error: this port wants the ncurses library from the FreeBSD"
+ @${ECHO_CMD} "base system. You can't build against it, while a newer"
+ @${ECHO_CMD} "version is installed by a port."
+ @${ECHO_CMD} "Please deinstall the port or undefine WITH_NCURSES_BASE."
+ @${FALSE}
+.endif
+
+NCURSESRPATH= /usr/lib:${LOCALBASE}/lib
+
+.else
+
+NCURSESBASE= ${LOCALBASE}
+NCURSESINC= ${NCURSESBASE}/include/ncurses
+.if !defined(NCURSES_PORT) && \
+ exists(${DESTDIR}/${LOCALBASE}/lib/libncurses.so)
+# find installed port and use it for dependency
+PKG_DBDIR?= ${DESTDIR}/var/db/pkg
+.if !defined(NCURSES_INSTALLED)
+NCURSES_INSTALLED!= find "${PKG_DBDIR}/" -type f -name "+CONTENTS" -print0 | \
+ xargs -0 grep -l "^lib/libncurses.so." | \
+ while read contents; do \
+ ncursesprefix=`grep "^@cwd " "$${contents}" | ${HEAD} -n 1`; \
+ if test "$${ncursesprefix}" = "@cwd ${LOCALBASE}" ; then \
+ echo "$${contents}"; break; fi; done
+.endif
+.if defined(NCURSES_INSTALLED) && ${NCURSES_INSTALLED} != ""
+NCURSES_PORT!= grep "^@comment ORIGIN:" "${NCURSES_INSTALLED}" | ${CUT} -d : -f 2
+NCURSES_SHLIBFILE!= grep -m 1 "^lib/libncurses.so." "${NCURSES_INSTALLED}"
+NCURSES_SHLIBVER?= ${NCURSES_SHLIBFILE:E}
+.else
+# PKG_DBDIR was not found, default
+NCURSES_PORT?= devel/ncurses
+NCURSES_SHLIBVER?= 5
+.endif
+.endif
+NCURSES_PORT?= devel/ncurses
+NCURSES_SHLIBVER?= 5
+
+BUILD_DEPENDS+= ${LOCALBASE}/lib/libncurses.so.${NCURSES_SHLIBVER}:${PORTSDIR}/${NCURSES_PORT}
+RUN_DEPENDS+= ${LOCALBASE}/lib/libncurses.so.${NCURSES_SHLIBVER}:${PORTSDIR}/${NCURSES_PORT}
+NCURSESRPATH= ${LOCALBASE}/lib
+
+.endif
+
+NCURSESLIB= ${NCURSESBASE}/lib
+
+.if defined(USE_NCURSES_RPATH)
+CFLAGS+= -Wl,-rpath,${NCURSESRPATH}
+.endif
+NCURSES_LDFLAGS+= -rpath=${NCURSESRPATH}
+
+.if defined(LDFLAGS)
+LDFLAGS+=${NCURSES_LDFLAGS}
+.else
+LDFLAGS=${NCURSES_LDFLAGS}
+.endif
+
+CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
+MAKE_ENV+= LDFLAGS="${LDFLAGS}"
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 3a22ec2a1755..cfd6c1fd64bd 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -542,6 +542,8 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
#
# USE_CDRTOOLS - If set, this port depends on sysutils/cdrtools.
#
+# USE_NCURSES - If set, this port relies on the ncurses package.
+#
# Conflict checking. Use if your port cannot be installed at the same time as
# another package.
#
@@ -1582,6 +1584,10 @@ PERL= ${LOCALBASE}/bin/perl
.include "${PORTSDIR}/Mk/bsd.kde4.mk"
.endif
+.if defined(USE_NCURSES)
+.include "${PORTSDIR}/Mk/bsd.ncurses.mk"
+.endif
+
# You can force skipping these test by defining IGNORE_PATH_CHECKS
.if !defined(IGNORE_PATH_CHECKS)
.if (${PREFIX:C,(^.).*,\1,} != "/")
diff --git a/audio/cmus/Makefile b/audio/cmus/Makefile
index 2c297e89b184..3900e393a988 100644
--- a/audio/cmus/Makefile
+++ b/audio/cmus/Makefile
@@ -18,6 +18,7 @@ COMMENT= Console-based music player with really cool features
USE_BZIP2= yes
USE_GMAKE= yes
USE_ICONV= yes
+USE_NCURSES= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS+=prefix=${PREFIX} mandir=${MANPREFIX}/man \
exampledir=${EXAMPLESDIR} \
@@ -40,10 +41,6 @@ OPTIONS= FLAC "FLAC (Free Lossless Audio Codec) support" Off \
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
.if defined(WITH_FLAC)
LIB_DEPENDS+= FLAC:${PORTSDIR}/audio/flac
CONFIGURE_ARGS+=CONFIG_FLAC=y
diff --git a/audio/ncmpcpp/Makefile b/audio/ncmpcpp/Makefile
index 47697444564c..56134b6763e7 100644
--- a/audio/ncmpcpp/Makefile
+++ b/audio/ncmpcpp/Makefile
@@ -21,6 +21,7 @@ LIB_DEPENDS= mpdclient:${PORTSDIR}/audio/libmpdclient \
USE_BZIP2= yes
GNU_CONFIGURE= yes
USE_ICONV= yes
+USE_NCURSES= yes
USE_GNOME= glib20
USE_AUTOTOOLS= automake aclocal libtool
ACLOCAL_ARGS= --acdir=${ACLOCAL_DIR} -I ${LOCALBASE}/share/aclocal
@@ -43,9 +44,7 @@ OPTIONS= CURL "Enable fetching lyrics from the Internet" on \
BROKEN=>>Does not compile on FreeBSD 6.X
.endif
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.else
+.if defined(WITH_NCURSES_BASE)
# no need to use ncurses-config if we use ncurses from the base system
CONFIGURE_ARGS+= NCURSES_CONFIG=/usr/bin/true
.endif
diff --git a/audio/ocp/Makefile b/audio/ocp/Makefile
index 1e5817972649..4bbd86026d16 100644
--- a/audio/ocp/Makefile
+++ b/audio/ocp/Makefile
@@ -25,6 +25,7 @@ ONLY_FOR_ARCHS= i386 amd64
GNU_CONFIGURE= yes
USE_GMAKE= yes
+USE_NCURSES= yes
USE_LDCONFIG= yes
INSTALLS_ICONS= yes
MAKE_JOBS_UNSAFE= yes
@@ -42,7 +43,7 @@ CONFIGURE_ENV= CFLAGS="${CFLAGS} ${CPPFLAGS}" \
CONFIGURE_ARGS= --with-dir-suffix="" \
--without-alsa \
- --libdir=${LOCALBASE}/lib
+ --libdir=${PREFIX}/lib
LICENSE= GPLv2
INFO= ocp
@@ -119,10 +120,6 @@ CONFIGURE_ARGS+= --without-flac
MAKE_ENV+= DOCS="\#"
.endif
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
post-patch:
@${REINPLACE_CMD} -e 's|/etc/.*\.cfg|${TIMIDITY_CFG}|' \
${WRKSRC}/playgmi/gmitimidity.c
@@ -131,14 +128,4 @@ post-patch:
${WRKSRC}/filesel/adb.c \
${WRKSRC}/filesel/pfilesel.c
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-# use ncursesw from ports
- @${REINPLACE_CMD} -e 's|-l\(curses\)|-ln\1w|' ${WRKSRC}/stuff/Makefile
-.for f in ${PFILES}
- @${REINPLACE_CMD} -e \
- 's|#include.*<curses\.h.*|#include <ncurses/ncurses.h>|' \
- ${WRKSRC}/${f}
-.endfor
-.endif
-
.include <bsd.port.post.mk>
diff --git a/audio/pytone/Makefile b/audio/pytone/Makefile
index 03719c7c908b..a524038de774 100644
--- a/audio/pytone/Makefile
+++ b/audio/pytone/Makefile
@@ -21,6 +21,7 @@ RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pysqlite2/_sqlite.so:${PORTSDIR}/databases/py-
${PYTHON_SITELIBDIR}/mutagen/__init__.py:${PORTSDIR}/audio/py-mutagen
USE_PYTHON= yes
+USE_NCURSES= yes
USE_PYDISTUTILS= yes
PYDISTUTILS_PKGNAME= PyTone
@@ -35,10 +36,6 @@ OPTIONS= MAD "MPEG Audio Decoder (libmad) support" On \
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
.if !defined(WITHOUT_MAD)
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/madmodule.so:${PORTSDIR}/audio/py-mad
.endif
diff --git a/deskutils/wyrd/Makefile b/deskutils/wyrd/Makefile
index 4d5521d46a3c..53653d62fbac 100644
--- a/deskutils/wyrd/Makefile
+++ b/deskutils/wyrd/Makefile
@@ -22,29 +22,19 @@ OPTIONS= UTF8 "Enable UTF-8 support" off
GNU_CONFIGURE= yes
USE_GMAKE= yes
+USE_NCURSES= yes
MAN1= wyrd.1
MAN5= wyrdrc.5
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-WITH_NCURSES_PORT=yes
-.endif
-
.if defined(WITH_UTF8)
CONFIGURE_ARGS+=--enable-utf8
-.if defined(WITH_NCURSES_PORT)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-NCURSES_INC= ncurses/
-.endif
.else
CONFIGURE_ARGS+=--disable-utf8
.endif
-post-patch:
- @${REINPLACE_CMD} -e 's|ncursesw/|${NCURSES_INC}|' ${WRKSRC}/configure
-
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/wyrd.opt ${PREFIX}/bin/wyrd
${INSTALL_DATA} ${WRKSRC}/wyrdrc ${PREFIX}/etc/wyrdrc
diff --git a/devel/cdk/Makefile b/devel/cdk/Makefile
index 9fb7caea1cc2..c5c0412cf291 100644
--- a/devel/cdk/Makefile
+++ b/devel/cdk/Makefile
@@ -20,24 +20,13 @@ COMMENT= Curses Development Kit for speedy development of full screen programs
LICENSE= BSD
LICENSE_FILE= ${WRKSRC}/COPYING
USE_GMAKE= yes
+USE_NCURSES= yes
GNU_CONFIGURE= yes
PORTDOCS= COPYING EXPANDING INSTALL NOTES README TODO
MAKE_JOBS_UNSAFE= yes
.include <bsd.port.pre.mk>
-.if exists(${LOCALBASE}/include/ncurses/ncurses.h)
-TERMINFO= ${LOCALBASE}/share/misc/terminfo
-CPPFLAGS= -I${LOCALBASE}/include -I${LOCALBASE}/include/ncurses
-LIBS+= -L${LOCALBASE}/lib -lncurses
-LDFLAGS+= -Wl,-rpath,${LOCALBASE}/lib
-CONFIGURE_ENV+= TERMINFO="${TERMINFO}"\
- CPPFLAGS="${CPPFLAGS}"\
- LIBS="${LIBS}"\
- LDFLAGS="${LDFLAGS}"
-LIB_DEPENDS+= ncurses.5:${PORTSDIR}/devel/ncurses
-.endif # exists(${LOCALBASE}/include/ncurses/ncurses.h)
-
CONFIGURE_ARGS+=--with-ncurses
ALL_TARGET= default examples demos cli cdkshlib
INSTALL_TARGET= install installCDKSHLibrary
diff --git a/devel/stfl/Makefile b/devel/stfl/Makefile
index f4a7c22ac077..03b6b8c7138e 100644
--- a/devel/stfl/Makefile
+++ b/devel/stfl/Makefile
@@ -20,6 +20,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING
USE_LDCONFIG= yes
USE_GMAKE= yes
USE_ICONV= yes
+USE_NCURSES= yes
MAKE_JOBS_SAFE= yes
ALL_TARGET= libstfl.so
PLIST_FILES= lib/libstfl.so.1 lib/libstfl.so include/stfl.h \
@@ -30,18 +31,13 @@ MAKE_ENV= LDLIBS="${LDLIBS}"
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-NCURSES_INC= ncurses/
-.endif
-
post-patch:
@${REINPLACE_CMD} -e 's|\.a|.so|g;/ranlib/d;\
s|ar qc|$${CC} $${CFLAGS} ${PTHREAD_LIBS} $${LDLIBS} -shared -fPIC -o|;\
s|sed -r|sed -E|;s|-Os||;/gcc/d;/-MM/s|-I.|$${CFLAGS}|'\
${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's|alloca.h|stdlib.h|' ${WRKSRC}/widgets/*.c
- @${REINPLACE_CMD} -e 's|ncursesw/|${NCURSES_INC}|'\
+ @${REINPLACE_CMD} -e 's|ncursesw/|${NCURSESINC}/|'\
${WRKSRC}/stfl_internals.h
@${ECHO_CMD} 'prefix = ${PREFIX}' > ${WRKSRC}/Makefile.cfg
diff --git a/games/latrine/Makefile b/games/latrine/Makefile
index 4021a95be645..c6c631353c69 100644
--- a/games/latrine/Makefile
+++ b/games/latrine/Makefile
@@ -18,22 +18,14 @@ GNU_CONFIGURE= yes
CONFIGURE_ARGS= "CFLAGS=-I${LOCALBASE}/include -I${WRKDIR} -D_XOPEN_SOURCE_EXTENDED" LDFLAGS=-L${LOCALBASE}/lib
USE_GMAKE= yes
USE_GETTEXT= yes
+USE_NCURSES= yes
WRKSRC= ${WRKDIR}/${DISTNAME}/src
MAN1= latrine.1
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
post-patch:
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
- ${MKDIR} ${WRKDIR}/ncursesw
- ${LN} -s ${LOCALBASE}/include/ncurses/ncurses.h ${WRKDIR}/ncursesw/ncurses.h
-.else
@${REINPLACE_CMD} -e 's,ncursesw/ncurses.h,ncurses.h,' \
${WRKSRC}/charset.h ${WRKSRC}/screen.c
-.endif
.include <bsd.port.post.mk>
diff --git a/games/mangband/Makefile b/games/mangband/Makefile
index 5cf0d1269c3c..e43ac7ea8e78 100644
--- a/games/mangband/Makefile
+++ b/games/mangband/Makefile
@@ -17,6 +17,7 @@ ALL_TARGET= mangclient mangband
WRKSRC= ${WRKDIR}/${DISTNAME}/src
GNU_CONFIGURE= yes
USE_GMAKE= yes
+USE_NCURSES= yes
MAKE_ARGS= "DATADIR=${DATADIR}"
@@ -27,7 +28,6 @@ OPTIONS= GCU "Display module GCU" On \
.include <bsd.port.pre.mk>
.if defined(WITH_GCU)
-#LIB_DEPENDS+= ncurses:${PORTSDIR}/devel/ncurses
CONFIGURE_ARGS+= --with-gcu
.else
CONFIGURE_ARGS+= --without-gcu
diff --git a/mail/cone/Makefile b/mail/cone/Makefile
index 715c89784b13..0952fd85ab4c 100644
--- a/mail/cone/Makefile
+++ b/mail/cone/Makefile
@@ -30,37 +30,24 @@ USE_GNOME= libxml2
USE_BZIP2= yes
USE_PERL5= yes
USE_GMAKE= yes
-CPPFLAGS= -I${LOCALBASE}/include
+USE_NCURSES= yes
+CPPFLAGS+= -I${LOCALBASE}/include
GNU_CONFIGURE= yes
CONFIGURE_ARGS= -C --without-db --with-certdb=${PREFIX}/share/cone/rootcerts --prefix=${PREFIX} --exec-prefix=${PREFIX}
-CONFIGURE_ENV= REHASH="${PERL} ${SCRIPTDIR}/c_rehash" LDFLAGS=-L${LOCALBASE}/lib \
- CPPFLAGS="${CPPFLAGS}"
+LDFLAGS+= -L${LOCALBASE}/lib
+CONFIGURE_ENV= REHASH="${PERL} ${SCRIPTDIR}/c_rehash"
MAN1= cone.1 leaf.1 mailtool.1
INSTALL_TARGET= install-strip
.include <bsd.port.pre.mk>
-.if ${OSVERSION} > 700032 || (${OSVERSION} < 700000 && ${OSVERSION} > 602106)
CPPFLAGS+= -D_XOPEN_SOURCE_EXTENDED
-.elif exists(${LOCALBASE}/include/ncurses/ncurses.h) || defined(WITH_NCURSESW)
CPPFLAGS+= -I${WRKDIR} -D_XOPEN_SOURCE_EXTENDED
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
post-extract:
${MKDIR} ${WRKDIR}/ncursesw
${LN} -s ${LOCALBASE}/include/ncurses/ncurses.h ${WRKDIR}/ncursesw/curses.h
-.else
-
-CONFIGURE_ARGS+= --disable-unicode
-
-pre-everything::
- @${ECHO_CMD} ""
- @${ECHO_CMD} "to use multilanguage ( unicode ) MUA, please set WITH_NCURSESW"
- @${ECHO_CMD} "or install devel/ncurses first"
- @${ECHO_CMD} ""
-
-.endif
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/sysconftool ${PREFIX}/sbin/cone-sysconftool
diff --git a/mail/mixmaster/Makefile b/mail/mixmaster/Makefile
index 0e17f5cd5482..289d279e704a 100644
--- a/mail/mixmaster/Makefile
+++ b/mail/mixmaster/Makefile
@@ -21,6 +21,7 @@ COMMENT= A cryptographically secure anonymous remailer
LIB_DEPENDS= pcre:${PORTSDIR}/devel/pcre
USE_PERL5= yes
+USR_NCURSES= yes
USE_OPENSSL= yes
.if !exists(/usr/include/openssl/idea.h)
WITH_OPENSSL_PORT= yes
@@ -38,10 +39,6 @@ MIXMASTER_SCRIPTS= ${WRKDIR}/mixmaster-update.pl
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncurses:${PORTSDIR}/devel/ncurses
-.endif
-
post-patch:
${CP} ${FILESDIR}/Makefile.in ${WRKSRC}/Makefile
@${RM} ${WRKSRC}/../conf/mix.cfg.orig
diff --git a/mail/mutt-devel/Makefile b/mail/mutt-devel/Makefile
index a14f73891a73..7bac1dc53893 100644
--- a/mail/mutt-devel/Makefile
+++ b/mail/mutt-devel/Makefile
@@ -171,6 +171,8 @@ CONFIGURE_ARGS+= ${MUTT_CONFIGURE_ARGS}
USE_AUTOTOOLS= automake autoconf
USE_OPENSSL= yes
+USE_NCURSES= yes
+USE_NCURSES_RPATH= yes
.if !defined (MUTT_LITE)
OPTIONS= MUTT_ASPELL "Enable aspell support" off \
@@ -307,14 +309,14 @@ USE_ICONV= yes
.if defined(NOPORTDOCS)
XML_USED= no
.endif
-.if defined(WITH_MUTT_NCURSES_PORT) || exists(${LOCALBASE}/lib/libncurses.a)
+.if defined(WITH_MUTT_NCURSES_PORT)
.if !defined(MUTT_USES_SLANG)
MUTT_USES_NCURSES_PORT= yes
.endif
.endif
.if defined(MUTT_USES_NCURSES_PORT)
-LIB_DEPENDS+= ncurses.5:${PORTSDIR}/devel/ncurses
-CFLAGS+= -I${LOCALBASE}/include/ncurses -I${LOCALBASE}/include
+WITH_NCURSES_PORT= yes
+CFLAGS+= -I${NCURSESINC}
.elif defined(MUTT_USES_SLANG)
LIB_DEPENDS+= slang.2:${PORTSDIR}/devel/libslang2
.endif
@@ -373,9 +375,11 @@ CONFIGURE_ARGS+= --enable-flock
CONFIGURE_ARGS+= --enable-locales-fix
.endif
.if defined(MUTT_USES_NCURSES_PORT)
-CONFIGURE_ARGS+= --with-curses=${LOCALBASE}
+CONFIGURE_ARGS+= --with-curses=${NCURSESBASE}
.elif defined(MUTT_USES_SLANG)
CONFIGURE_ARGS+= --with-slang=${LOCALBASE}
+.else
+CONFIGURE_ARGS+= --with-curses=${NCURSESBASE}
.endif
.if defined(WITH_MUTT_CYRUS_SASL2)
CONFIGURE_ARGS+= --with-sasl=${LOCALBASE}
diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile
index d3c5fd63be4d..0fd835f19459 100644
--- a/mail/mutt/Makefile
+++ b/mail/mutt/Makefile
@@ -52,6 +52,8 @@ BUILD_DEPENDS= ispell:${PORTSDIR}/textproc/ispell
RUN_DEPENDS+= ispell:${PORTSDIR}/textproc/ispell \
urlview:${PORTSDIR}/textproc/urlview
USE_GMAKE= yes
+USE_NCURSES= yes
+
.endif
.if defined (MUTT_LITE)
PKGNAMESUFFIX= -lite
@@ -75,7 +77,7 @@ USE_ICONV= yes
.if defined(WITH_SLANG)
LIB_DEPENDS+= slang.2:${PORTSDIR}/devel/libslang2
.elif defined(WITH_NCURSES)
-LIB_DEPENDS+= ncurses.5:${PORTSDIR}/devel/ncurses
+WITH_NCURSES_PORT= yes
.endif
.if !defined (MUTT_LITE)
.if defined(WITH_MUTT_CYRUS_SASL)
@@ -126,8 +128,8 @@ CONFIGURE_ARGS+= --with-libiconv-prefix=${PREFIX}
.if defined(WITH_SLANG)
CONFIGURE_ARGS+= --with-slang=${PREFIX}
.elif defined(WITH_NCURSES)
-CONFIGURE_ARGS+= --with-curses=${PREFIX}
-CFLAGS+= -I${PREFIX}/include/ncurses -I${PREFIX}/include
+CONFIGURE_ARGS+= --with-curses=${NCURSESBASE}
+CFLAGS+= -I${NCURSESINC}
.endif
.if !defined(WITHOUT_GSSAPI)
.if exists(${LOCALBASE}/bin/gss-client)
diff --git a/mail/mutt14/Makefile b/mail/mutt14/Makefile
index d3c5fd63be4d..0fd835f19459 100644
--- a/mail/mutt14/Makefile
+++ b/mail/mutt14/Makefile
@@ -52,6 +52,8 @@ BUILD_DEPENDS= ispell:${PORTSDIR}/textproc/ispell
RUN_DEPENDS+= ispell:${PORTSDIR}/textproc/ispell \
urlview:${PORTSDIR}/textproc/urlview
USE_GMAKE= yes
+USE_NCURSES= yes
+
.endif
.if defined (MUTT_LITE)
PKGNAMESUFFIX= -lite
@@ -75,7 +77,7 @@ USE_ICONV= yes
.if defined(WITH_SLANG)
LIB_DEPENDS+= slang.2:${PORTSDIR}/devel/libslang2
.elif defined(WITH_NCURSES)
-LIB_DEPENDS+= ncurses.5:${PORTSDIR}/devel/ncurses
+WITH_NCURSES_PORT= yes
.endif
.if !defined (MUTT_LITE)
.if defined(WITH_MUTT_CYRUS_SASL)
@@ -126,8 +128,8 @@ CONFIGURE_ARGS+= --with-libiconv-prefix=${PREFIX}
.if defined(WITH_SLANG)
CONFIGURE_ARGS+= --with-slang=${PREFIX}
.elif defined(WITH_NCURSES)
-CONFIGURE_ARGS+= --with-curses=${PREFIX}
-CFLAGS+= -I${PREFIX}/include/ncurses -I${PREFIX}/include
+CONFIGURE_ARGS+= --with-curses=${NCURSESBASE}
+CFLAGS+= -I${NCURSESINC}
.endif
.if !defined(WITHOUT_GSSAPI)
.if exists(${LOCALBASE}/bin/gss-client)
diff --git a/net-im/mcabber/Makefile b/net-im/mcabber/Makefile
index 87781a6682d0..fd8e946a67b8 100644
--- a/net-im/mcabber/Makefile
+++ b/net-im/mcabber/Makefile
@@ -25,6 +25,7 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
USE_ICONV= yes
USE_GETTEXT= yes
USE_LDCONFIG= yes
+USE_NCURSES= yes
USE_GNOME= glib20
MAN1= mcabber.1
@@ -36,10 +37,6 @@ OPTIONS= GPGME "Use security/gpgme for PGP support" off \
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
.if defined(WITH_GPGME)
LIB_DEPENDS+= gpgme.18:${PORTSDIR}/security/gpgme
CONFIGURE_ARGS+=--enable-gpgme
diff --git a/net-im/tmsnc/Makefile b/net-im/tmsnc/Makefile
index ac068ebc5f50..41b3920e936b 100644
--- a/net-im/tmsnc/Makefile
+++ b/net-im/tmsnc/Makefile
@@ -14,17 +14,10 @@ MAINTAINER= snowfly@yuntech.edu.tw
COMMENT= A textbased (console) MSN client
GNU_CONFIGURE= yes
+USE_NCURSES= yes
PLIST_FILES= bin/tmsnc
MAN1= tmsnc.1
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-# this port needs ncurses 5.4+
-BUILD_DEPENDS+= ${LOCALBASE}/include/ncurses/ncurses.h:${PORTSDIR}/devel/ncurses
-RUN_DEPENDS+= ${LOCALBASE}/include/ncurses/ncurses.h:${PORTSDIR}/devel/ncurses
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/security/metasploit/Makefile b/security/metasploit/Makefile
index 0cdd06b351a1..80ab57ccbda0 100644
--- a/security/metasploit/Makefile
+++ b/security/metasploit/Makefile
@@ -15,8 +15,7 @@ DISTNAME= framework-${DISTVERSION}
MAINTAINER= onatan@gmail.com
COMMENT= Exploit-Framework for Penetration-Testing
-RUN_DEPENDS= infocmp:${PORTSDIR}/devel/ncurses \
- nasm:${PORTSDIR}/devel/nasm \
+RUN_DEPENDS= nasm:${PORTSDIR}/devel/nasm \
nmap:${PORTSDIR}/security/nmap
WRKSRC= ${WRKDIR}/msf3
@@ -26,6 +25,8 @@ SCRIPTS= msfcli msfconsole msfd msfelfscan msfencode msfmachscan \
NO_BUILD= yes
USE_RUBY= yes
USE_BZIP2= yes
+USE_NCURSES= yes
+WITH_NCURSES_PORT= yes
.include <bsd.port.pre.mk>
diff --git a/shells/zsh/Makefile b/shells/zsh/Makefile
index 6e51ea1a089e..35993c8c0463 100644
--- a/shells/zsh/Makefile
+++ b/shells/zsh/Makefile
@@ -25,6 +25,7 @@ USE_BZIP2= yes
USE_ICONV= yes
USE_AUTOTOOLS= autoconf autoheader
GNU_CONFIGURE= yes
+USE_NCURSES= yes
.if !defined(WITH_ZSH_STATIC)
USE_LDCONFIG= ${PREFIX}/lib/${PORTNAME}
.endif
diff --git a/sysutils/htop/Makefile b/sysutils/htop/Makefile
index 1ff82978db0c..62a3e56559bd 100644
--- a/sysutils/htop/Makefile
+++ b/sysutils/htop/Makefile
@@ -21,6 +21,7 @@ NOT_FOR_ARCHS= sparc64
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-proc=/compat/linux/proc --enable-unicode
USE_AUTOTOOLS= autoconf aclocal automake libtool
+USE_NCURSES= yes
ACLOCAL_ARGS= -I ${ACLOCAL_DIR}
USE_PYTHON_BUILD= yes
@@ -29,10 +30,6 @@ MAN1= htop.1
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107 || (${OSVERSION} > 700000 && ${OSVERSION} < 700033)
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
.if !defined(WITHOUT_LSOF)
RUN_DEPENDS+= lsof:${PORTSDIR}/sysutils/lsof
.endif
diff --git a/www/newsbeuter/Makefile b/www/newsbeuter/Makefile
index 36112b0cbeb4..f259aabd9b30 100644
--- a/www/newsbeuter/Makefile
+++ b/www/newsbeuter/Makefile
@@ -22,17 +22,13 @@ USE_GMAKE= yes
USE_GETTEXT= yes
USE_PERL5_BUILD=yes
USE_SQLITE= yes
-USE_GCC= 4.2+
USE_GNOME= libxml2
+USE_NCURSES= yes
MAN1= newsbeuter.1 podbeuter.1
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 602107
-LIB_DEPENDS+= ncursesw.5:${PORTSDIR}/devel/ncurses
-.endif
-
post-patch:
${REINPLACE_CMD} -e "s,share/man,man,; \
/^prefix/s|=.*|=${PREFIX}|; /^CXX=/d; \