Subject: pkg/20772: devel/flex needs a yacc to build
To: None <>
From: None <>
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
>Release:        NetBSD 1.6
System: NetBSD 1.6 NetBSD 1.6 (JCR-20020927) #3: Sat Sep 28 13:40:20 PDT 2002 i386
Architecture: i386
Machine: i386
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.
Move /usr/bin/yacc and attempt to build pkgsrc/devel/flex
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

? 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/}
 COMMENT=		fast clone of lex(1), the lexical scanner generator
-ONLY_FOR_PLATFORM=	SunOS-*-*	# in NetBSD base system
 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
 .include "../../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
-  if test -n "$YACC"; then
-  ac_cv_prog_YACC="$YACC" # Let the user override the test.
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
@@ -439,7 +436,6 @@
 if test -n "$YACC"; then