Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
9e771e3b | 2 | ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> |
e2b2c466 | 3 | ;;; |
233e7676 | 4 | ;;; This file is part of GNU Guix. |
e2b2c466 | 5 | ;;; |
233e7676 | 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
e2b2c466 LC |
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 | ;;; | |
233e7676 | 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
e2b2c466 LC |
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 | |
233e7676 | 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
e2b2c466 | 18 | |
1ffa7090 | 19 | (define-module (gnu packages flex) |
4a44e743 | 20 | #:use-module (guix licenses) |
e2b2c466 LC |
21 | #:use-module (guix packages) |
22 | #:use-module (guix download) | |
23 | #:use-module (guix build-system gnu) | |
59a43334 | 24 | #:use-module (gnu packages) |
1ffa7090 LC |
25 | #:use-module (gnu packages m4) |
26 | #:use-module (gnu packages bison) | |
55f03366 | 27 | #:use-module (gnu packages indent) |
2aa76ee1 | 28 | #:use-module (srfi srfi-1) |
55f03366 | 29 | #:export (flex)) |
e2b2c466 | 30 | |
55f03366 | 31 | (define flex |
e2b2c466 LC |
32 | (package |
33 | (name "flex") | |
34 | (version "2.5.37") | |
35 | (source (origin | |
36 | (method url-fetch) | |
37 | (uri (string-append "mirror://sourceforge/flex/flex-" | |
38 | version ".tar.bz2")) | |
39 | (sha256 | |
40 | (base32 | |
01eafd38 LC |
41 | "0ah5mi4j62b85a9rllv1004mzjb5cd0mn4glvz13p88rpx77pahp")) |
42 | (patches (list (search-patch "flex-bison-tests.patch"))))) | |
e2b2c466 | 43 | (build-system gnu-build-system) |
2aa76ee1 LC |
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)))))) | |
01eafd38 | 61 | `(("bison" ,bison-for-tests) |
2aa76ee1 | 62 | ("indent" ,indent)))) |
ba42199e | 63 | ;; m4 is not present in PATH when cross-building |
20a94666 | 64 | (native-inputs `(("m4" ,m4))) |
e2b2c466 LC |
65 | (propagated-inputs `(("m4" ,m4))) |
66 | (home-page "http://flex.sourceforge.net/") | |
9e771e3b | 67 | (synopsis "Fast lexical analyser generator") |
e2b2c466 | 68 | (description |
35b9e423 | 69 | "Flex is a tool for generating scanners. A scanner, sometimes |
e2b2c466 | 70 | called a tokenizer, is a program which recognizes lexical patterns in |
35b9e423 | 71 | text. The flex program reads user-specified input files, or its standard |
e2b2c466 | 72 | input if no file names are given, for a description of a scanner to |
35b9e423 EB |
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 | |
e2b2c466 | 77 | is run, it analyzes its input for occurrences of text matching the |
35b9e423 | 78 | regular expressions for each rule. Whenever it finds a match, it |
e2b2c466 | 79 | executes the corresponding C code.") |
166191b3 | 80 | (license (non-copyleft "file://COPYING" |
4a44e743 NK |
81 | "See COPYING in the distribution.")))) |
82 |