gnu: Add teensy-loader-cli.
[jackhill/guix/guix.git] / gnu / packages / flex.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages flex)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages m4)
27 #:use-module (gnu packages bison)
28 #:use-module (gnu packages indent)
29 #:use-module (srfi srfi-1)
30 #:export (flex))
31
32 (define flex
33 (package
34 (name "flex")
35 (version "2.6.0")
36 (source (origin
37 (method url-fetch)
38 (uri (string-append "mirror://sourceforge/flex/flex-"
39 version ".tar.bz2"))
40 (sha256
41 (base32
42 "1sdqx63yadindzafrq1w31ajblf9gl1c301g068s20s7bbpi3ri4"))))
43 (build-system gnu-build-system)
44 (inputs
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)
49 (version "2.7.1")
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "mirror://gnu/bison/bison-"
53 version ".tar.xz"))
54 (sha256
55 (base32
56 "1yx7isx67sdmyijvihgyra1f59fwdz7sqriginvavfj5yb5ss2dl"))))
57
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)
62 ("indent" ,indent))))
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")
68 (description
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."))))
82