Import devel/flex. This is flex v2.5.35, which uses m4 to generate the

scanners and is a required dependency to update a number of ports.

Following analysis of bulk build and base build logs with this done as
an update to /usr/src/usr.bin/lex mostly over p2k9 it's clear this has
incompatibilities with existing scanners (including minor SUS breakage)
so at this time it's being imported as a port rather than updating base.

Port originally from Brad with some changes by myself (executable
file now named gflex, and use base m4 not GNU m4 - requires /usr/bin/m4
with -P support; 2009/10/14 or newer).

Discussed with and requested by many. ok ajacoutot, jasper, Brad.
This commit is contained in:
sthen 2009-10-28 23:13:56 +00:00
parent 20e7f10120
commit c36bb94a5a
5 changed files with 113 additions and 0 deletions

34
devel/flex/Makefile Normal file
View File

@ -0,0 +1,34 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/10/28 23:13:56 sthen Exp $
COMMENT= fast lexical analyzer generator
DISTNAME= flex-2.5.35
CATEGORIES= devel textproc
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=flex/}
HOMEPAGE= http://flex.sourceforge.net/
# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c m
MODULES= devel/gettext
BUILD_DEPENDS= ::devel/help2man \
::devel/bison
YACC= bison
USE_GMAKE= Yes
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --includedir=${PREFIX}/include/flex \
--libdir=${PREFIX}/lib/flex \
--program-prefix=g
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib" \
ac_cv_path_M4=/usr/bin/m4
.include <bsd.port.mk>

5
devel/flex/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (flex-2.5.35.tar.gz) = IB0/OHWNlUNsvGSQM4beCw==
RMD160 (flex-2.5.35.tar.gz) = ZIZF9HUexQKfUQcwV39cPikbel4=
SHA1 (flex-2.5.35.tar.gz) = MzyHao4krloX2Vc0WfxQG3chkws=
SHA256 (flex-2.5.35.tar.gz) = pv46yAtfiXadgz795xL5W7AlW8+QifoyRjapuKAFxxc=
SIZE (flex-2.5.35.tar.gz) = 1456620

View File

@ -0,0 +1,38 @@
$OpenBSD: patch-configure,v 1.1.1.1 2009/10/28 23:13:56 sthen Exp $
--- configure.orig Tue Feb 26 21:34:02 2008
+++ configure Tue Jun 9 20:51:58 2009
@@ -4651,6 +4651,9 @@ _ACEOF
+LIBICONV=$LTLIBICONV
+LIBINTL=$LTLIBINTL
+INTLLIBS=$LTLIBINTL
for ac_prog in 'bison -y' byacc
do
@@ -6602,15 +6605,15 @@ test -n "$M4" || M4="m4"
if test x"$M4" != x; then
echo "$as_me:$LINENO: checking for GNU m4" >&5
echo $ECHO_N "checking for GNU m4... $ECHO_C" >&6
- case `$M4 --help < /dev/null 2>&1` in
- *prefix-builtins*) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6 ;;
- *) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6 ;
- { { echo "$as_me:$LINENO: error: GNU M4 1.4 is required" >&5
-echo "$as_me: error: GNU M4 1.4 is required" >&2;}
- { (exit 1); exit 1; }; } ;;
- esac
+# case `$M4 --help < /dev/null 2>&1` in
+# *prefix-builtins*) echo "$as_me:$LINENO: result: yes" >&5
+#echo "${ECHO_T}yes" >&6 ;;
+# *) echo "$as_me:$LINENO: result: no" >&5
+#echo "${ECHO_T}no" >&6 ;
+# { { echo "$as_me:$LINENO: error: GNU M4 1.4 is required" >&5
+#echo "$as_me: error: GNU M4 1.4 is required" >&2;}
+# { (exit 1); exit 1; }; } ;;
+# esac
else
{ { echo "$as_me:$LINENO: error: GNU M4 1.4 is required" >&5
echo "$as_me: error: GNU M4 1.4 is required" >&2;}

11
devel/flex/pkg/DESCR Normal file
View File

@ -0,0 +1,11 @@
Flex is a tool for generating scanners. A scanner, sometimes called a
tokenizer, is a program which recognizes lexical patterns in text. The
flex program reads user-specified input files, or its standard input
if no file names are given, for a description of a scanner to generate.
The description is in the form of pairs of regular expressions and C
code, called rules. Flex generates a C source file named, "lex.yy.c",
which defines the function yylex(). The file "lex.yy.c" can be compiled
and linked to produce an executable. When the executable is run, it
analyzes its input for occurrences of text matching the regular
expressions for each rule. Whenever it finds a match, it executes the
corresponding C code.

25
devel/flex/pkg/PLIST Normal file
View File

@ -0,0 +1,25 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/10/28 23:13:56 sthen Exp $
@bin bin/gflex
include/flex/
include/flex/FlexLexer.h
@info info/flex.info
lib/flex/
lib/flex/libfl.a
lib/flex/libfl_pic.a
@man man/man1/gflex.1
share/locale/ca/LC_MESSAGES/flex.mo
share/locale/da/LC_MESSAGES/flex.mo
share/locale/de/LC_MESSAGES/flex.mo
share/locale/es/LC_MESSAGES/flex.mo
share/locale/fr/LC_MESSAGES/flex.mo
share/locale/ga/LC_MESSAGES/flex.mo
share/locale/ko/LC_MESSAGES/flex.mo
share/locale/nl/LC_MESSAGES/flex.mo
share/locale/pl/LC_MESSAGES/flex.mo
share/locale/pt_BR/LC_MESSAGES/flex.mo
share/locale/ro/LC_MESSAGES/flex.mo
share/locale/ru/LC_MESSAGES/flex.mo
share/locale/sv/LC_MESSAGES/flex.mo
share/locale/tr/LC_MESSAGES/flex.mo
share/locale/vi/LC_MESSAGES/flex.mo
share/locale/zh_CN/LC_MESSAGES/flex.mo