Subject: pkg/20453: new pkgsrc/mk/curses.buildlink2.mk file
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 02/21/2003 00:23:10
>Number:         20453
>Category:       pkg
>Synopsis:       new pkgsrc/mk/curses.buildlink2.mk file
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 21 00:24:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6
>Organization:
http://bsd.reedmedia.net/
>Environment:
	
	
System: NetBSD rainier.reedmedia.net 1.6 NetBSD 1.6 (JCR-20020927) #3: Sat Sep 28 13:40:20 PDT 2002 reed@rainier.reedmedia.net:/usr/src/sys/arch/i386/compile/JCR-20020927 i386
Architecture: i386
Machine: i386
>Description:
Some packages are built using some curses (which may not be included
with the system) but still not registered as a DEPENDS.

This is discussed on tech-pkg.
>How-To-Repeat:
Build pkgsrc for:

shells/bash2 -- but on some systems uses libtermcap instead
misc/less
net/lukemftp
editors/pico
mail/pine
net/lftp
math/sc
devel/smpeg
games/defendguin (I packaged that!)
devel/gtexinfo
databases/openldap
(and probably many others).

and they may depend on ncurses, but ncurses is not registered as
a DEPENDS (so when transfering package to another system
it may not work).
>Fix:
Here is a pkgsrc/mk/curses.buildlink2.mk file and below is
a patch for misc/less. This less build was tested under NetBSD
and my Linux. Under NetBSD it didn't register the ncurses
(which is fine) unless USE_NCURSES was defined.

# $NetBSD$
#
# This Makefile fragment is included by packages that use a curses.
# If USE_NCURSES is defined or missing system curses header, then it
# will always depend on devel/ncurses.

if !defined(CURSES_BUILDLINK2_MK)
CURSES_BUILDLINK2_MK= # defined

include "../../mk/bsd.prefs.mk"

if defined(USE_NCURSES)
  include "../../devel/ncurses/buildlink2.mk"
elif !exists(/usr/include/curses.h)
   USE_NCURSES=    yes
  include "../../devel/ncurses/buildlink2.mk"
endif

endif  # CURSES_BUILDLINK2_MK


And the patch for misc/less ...

RCS file: /cvsroot/pkgsrc/misc/less/Makefile,v
retrieving revision 1.7
diff -b -u -r1.7 Makefile
--- less/Makefile	2003/02/17 12:54:25	1.7
+++ less/Makefile	2003/02/21 08:15:28
@@ -13,4 +13,5 @@
 GNU_CONFIGURE=  	yes
 USE_BUILDLINK2=		yes
 
+.include "../../mk/curses.buildlink2.mk"
 .include "../../mk/bsd.pkg.mk"
>Release-Note:
>Audit-Trail:
>Unformatted: