summaryrefslogtreecommitdiff
path: root/distro
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-11-22 18:22:48 +0100
committerLudovic Courtès <ludo@gnu.org>2012-11-22 18:22:48 +0100
commite2b2c46693896bfc715afa2ff6f5f34ba73158aa (patch)
tree03ecc20b932f5a345907bbd17350d16ebb9ec386 /distro
parentcf153fc4726c616f5c5608797f02bb71b573140b (diff)
distro: Add Flex.
* distro/packages/flex.scm, distro/packages/patches/flex-bison-tests.patch: New files. * Makefile.am (MODULES): Add `flex.scm'. (dist_patch_DATA): Add `flex-bison-tests.patch'.
Diffstat (limited to 'distro')
-rw-r--r--distro/packages/flex.scm58
-rw-r--r--distro/packages/patches/flex-bison-tests.patch24
2 files changed, 82 insertions, 0 deletions
diff --git a/distro/packages/flex.scm b/distro/packages/flex.scm
new file mode 100644
index 00000000000..aa4dd00ef55
--- /dev/null
+++ b/distro/packages/flex.scm
@@ -0,0 +1,58 @@
1;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of Guix.
5;;;
6;;; Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (distro packages bison)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix build-system gnu)
23 #:use-module (distro)
24 #:use-module (distro packages m4)
25 #:use-module (distro packages bison))
26
27(define-public flex
28 (package
29 (name "flex")
30 (version "2.5.37")
31 (source (origin
32 (method url-fetch)
33 (uri (string-append "mirror://sourceforge/flex/flex-"
34 version ".tar.bz2"))
35 (sha256
36 (base32
37 "0ah5mi4j62b85a9rllv1004mzjb5cd0mn4glvz13p88rpx77pahp"))))
38 (build-system gnu-build-system)
39 (arguments
40 '(#:patches (list (assoc-ref %build-inputs "patch/bison-tests"))))
41 (inputs `(("patch/bison-tests" ,(search-patch "flex-bison-tests.patch"))
42 ("bison" ,bison)))
43 (propagated-inputs `(("m4" ,m4)))
44 (home-page "http://flex.sourceforge.net/")
45 (synopsis "A fast lexical analyser generator")
46 (description
47 "Flex is a tool for generating scanners. A scanner, sometimes
48called a tokenizer, is a program which recognizes lexical patterns in
49text. The flex program reads user-specified input files, or its standard
50input if no file names are given, for a description of a scanner to
51generate. The description is in the form of pairs of regular expressions
52and C code, called rules. Flex generates a C source file named,
53\"lex.yy.c\", which defines the function yylex(). The file \"lex.yy.c\"
54can be compiled and linked to produce an executable. When the executable
55is run, it analyzes its input for occurrences of text matching the
56regular expressions for each rule. Whenever it finds a match, it
57executes the corresponding C code.")
58 (license "BSD")))
diff --git a/distro/packages/patches/flex-bison-tests.patch b/distro/packages/patches/flex-bison-tests.patch
new file mode 100644
index 00000000000..0f372f83bf3
--- /dev/null
+++ b/distro/packages/patches/flex-bison-tests.patch
@@ -0,0 +1,24 @@
1The `test-bison-yyl{loc,val}' tests fail with "conflicting types for
2'testparse'" because `YYPARSE_PARAM' is undefined; work around that.
3
4--- flex-2.5.37/tests/test-bison-yylloc/main.c 2012-11-22 18:17:01.000000000 +0100
5+++ flex-2.5.37/tests/test-bison-yylloc/main.c 2012-11-22 18:17:07.000000000 +0100
6@@ -21,6 +21,7 @@
7 * PURPOSE.
8 */
9
10+#define YYPARSE_PARAM scanner
11 #include "parser.h"
12 #include "scanner.h"
13
14
15--- flex-2.5.37/tests/test-bison-yylval/main.c 2012-11-22 18:17:42.000000000 +0100
16+++ flex-2.5.37/tests/test-bison-yylval/main.c 2012-11-22 18:17:49.000000000 +0100
17@@ -21,6 +21,7 @@
18 * PURPOSE.
19 */
20
21+#define YYPARSE_PARAM scanner
22 #include "parser.h"
23 #include "scanner.h"
24