Subject: pkg/20772: devel/flex needs a yacc to build
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 03/17/2003 13:10:27
>Number:         20772
>Category:       pkg
>Synopsis:       devel/flex needs a yacc to build
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 17 13:11: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:
pkgsrc/devel/flex configure script uses the predefined pkgsrc YACC setting
instead of autodetecting a yacc (or bison).

It will fail even if bison is installed, because the YACC is defined.
Defining YACC as bison doesn't work because it needs a -y switch.
>How-To-Repeat:
Move /usr/bin/yacc and attempt to build pkgsrc/devel/flex
>Fix:
Here is a fix and the patch-aa is also below.
Note that this gets rid of the PLATFORM restrictions (because
it should work and it doesn't matter if a system has it installed in different
places).

? devel/flex/README.html
? devel/flex/patches
Index: devel/flex/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/flex/Makefile,v
retrieving revision 1.6
diff -b -u -r1.6 Makefile
--- devel/flex/Makefile	2002/12/22 16:33:16	1.6
+++ devel/flex/Makefile	2003/03/17 21:04:18
@@ -5,13 +5,19 @@
 MASTER_SITES=   	${MASTER_SITE_GNU:=non-gnu/flex/}
 
 MAINTAINER=		packages@netbsd.org
+HOMEPAGE=		http://www.gnu.org/software/flex/
 COMMENT=		fast clone of lex(1), the lexical scanner generator
 
-ONLY_FOR_PLATFORM=	SunOS-*-*	# in NetBSD base system
-ONLY_FOR_PLATFORM+=	Linux-*-*
-
 GNU_CONFIGURE=		YES
 
 WRKSRC=			${WRKDIR}/flex-2.5.4
+
+.if !exists(/usr/bin/yacc)
+BUILD_DEPENDS+=		bison-[0-9]*:../../devel/bison
+# XXX  This doesn't set YACC because needs -y switch.
+# XXX  A patch changes the configure script to not use YACC setting
+# XXX  and it auto-detects correctly.
+#YACC=			${LOCALBASE}/bin/bison
+.endif
 
 .include "../../mk/bsd.pkg.mk"
Index: devel/flex/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/flex/distinfo,v
retrieving revision 1.2
diff -b -u -r1.2 distinfo
--- devel/flex/distinfo	2001/04/21 00:44:17	1.2
+++ devel/flex/distinfo	2003/03/17 21:04:18
@@ -2,3 +2,4 @@
 
 SHA1 (flex-2.5.4a.tar.gz) = 38a5e15c348d2ca7dce94d71de2b51484d23e2ef
 Size (flex-2.5.4a.tar.gz) = 380995 bytes
+SHA1 (patch-aa) = 0408c715a36ef9224cecd84aa8c6267bd5d9349f

Then this is the patch-aa:

--- configure.orig	Thu Apr 20 13:10:14 1995
+++ configure	Mon Mar 17 12:55:42 2003
@@ -427,9 +427,6 @@
 if eval "test \"`echo '${'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&4
 else
-  if test -n "$YACC"; then
-  ac_cv_prog_YACC="$YACC" # Let the user override the test.
-else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
@@ -439,7 +436,6 @@
     fi
   done
   IFS="$ac_save_ifs"
-fi
 fi
 YACC="$ac_cv_prog_YACC"
 if test -n "$YACC"; then
>Release-Note:
>Audit-Trail:
>Unformatted: