1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU 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.
11 ;;; GNU 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.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages flex)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages m4)
26 #:use-module (gnu packages bison)
27 #:use-module (gnu packages indent)
28 #:use-module (srfi srfi-1)
37 (uri (string-append "mirror://sourceforge/flex/flex-"
41 "0ah5mi4j62b85a9rllv1004mzjb5cd0mn4glvz13p88rpx77pahp"))
42 (patches (list (search-patch "flex-bison-tests.patch")))))
43 (build-system gnu-build-system)
45 (let ((bison-for-tests
46 ;; Work around an incompatibility with Bison 3.0:
47 ;; <http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00014.html>.
48 (package (inherit bison)
52 (uri (string-append "mirror://gnu/bison/bison-"
56 "1yx7isx67sdmyijvihgyra1f59fwdz7sqriginvavfj5yb5ss2dl"))))
58 ;; Unlike Bison 3.0, this version did not need Flex for its
59 ;; tests, so it allows us to break the cycle.
60 (inputs (alist-delete "flex" (package-inputs bison))))))
61 `(("bison" ,bison-for-tests)
63 ;; m4 is not present in PATH when cross-building
64 (native-inputs `(("m4" ,m4)))
65 (propagated-inputs `(("m4" ,m4)))
66 (home-page "http://flex.sourceforge.net/")
67 (synopsis "Fast lexical analyser generator")
69 "Flex is a tool for generating scanners. A scanner, sometimes
70 called a tokenizer, is a program which recognizes lexical patterns in
71 text. The flex program reads user-specified input files, or its standard
72 input if no file names are given, for a description of a scanner to
73 generate. The description is in the form of pairs of regular expressions
74 and C code, called rules. Flex generates a C source file named,
75 \"lex.yy.c\", which defines the function yylex(). The file \"lex.yy.c\"
76 can be compiled and linked to produce an executable. When the executable
77 is run, it analyzes its input for occurrences of text matching the
78 regular expressions for each rule. Whenever it finds a match, it
79 executes the corresponding C code.")
80 (license (non-copyleft "file://COPYING"
81 "See COPYING in the distribution."))))