gnu: Python: Update to 3.7.4.
[jackhill/guix/guix.git] / gnu / packages / flex.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
06172df5 2;;; Copyright © 2012, 2013, 2014, 2019 Ludovic Courtès <ludo@gnu.org>
93b3a8b0 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
e2b2c466 4;;;
233e7676 5;;; This file is part of GNU Guix.
e2b2c466 6;;;
233e7676 7;;; GNU Guix is free software; you can redistribute it and/or modify it
e2b2c466
LC
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;;;
233e7676 12;;; GNU Guix is distributed in the hope that it will be useful, but
e2b2c466
LC
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
233e7676 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
e2b2c466 19
1ffa7090 20(define-module (gnu packages flex)
4a44e743 21 #:use-module (guix licenses)
e2b2c466
LC
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
06172df5 25 #:use-module (guix utils)
59a43334 26 #:use-module (gnu packages)
1ffa7090 27 #:use-module (gnu packages m4)
83dcfa72 28 #:use-module (gnu packages man)
1ffa7090 29 #:use-module (gnu packages bison)
8efe2a22 30 #:use-module (gnu packages code)
0160458b 31 #:use-module (srfi srfi-1))
e2b2c466 32
0160458b 33(define-public flex
e2b2c466
LC
34 (package
35 (name "flex")
93fabf59 36 (version "2.6.4")
e2b2c466 37 (source (origin
83dcfa72
DC
38 (method url-fetch)
39 (uri (string-append
40 "https://github.com/westes/flex"
41 "/releases/download/v" version "/"
2dca204e 42 "flex-" version ".tar.gz"))
83dcfa72
DC
43 (sha256
44 (base32
2dca204e 45 "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8"))))
e2b2c466 46 (build-system gnu-build-system)
2aa76ee1
LC
47 (inputs
48 (let ((bison-for-tests
83dcfa72
DC
49 (package
50 (inherit bison)
06172df5
LC
51 (arguments
52 ;; Disable tests, since they require flex.
53 (substitute-keyword-arguments (package-arguments bison)
54 ((#:tests? _ #f) #f)))
2aa76ee1 55 (inputs (alist-delete "flex" (package-inputs bison))))))
01eafd38 56 `(("bison" ,bison-for-tests)
2aa76ee1 57 ("indent" ,indent))))
ba42199e 58 ;; m4 is not present in PATH when cross-building
83dcfa72
DC
59 (native-inputs
60 `(("help2man" ,help2man)
61 ("m4" ,m4)))
e2b2c466 62 (propagated-inputs `(("m4" ,m4)))
83dcfa72 63 (home-page "https://github.com/westes/flex")
9e771e3b 64 (synopsis "Fast lexical analyser generator")
e2b2c466 65 (description
35b9e423 66 "Flex is a tool for generating scanners. A scanner, sometimes
e2b2c466 67called a tokenizer, is a program which recognizes lexical patterns in
35b9e423 68text. The flex program reads user-specified input files, or its standard
e2b2c466 69input if no file names are given, for a description of a scanner to
35b9e423
EB
70generate. The description is in the form of pairs of regular expressions
71and C code, called rules. Flex generates a C source file named,
72\"lex.yy.c\", which defines the function yylex(). The file \"lex.yy.c\"
73can be compiled and linked to produce an executable. When the executable
e2b2c466 74is run, it analyzes its input for occurrences of text matching the
35b9e423 75regular expressions for each rule. Whenever it finds a match, it
e2b2c466 76executes the corresponding C code.")
166191b3 77 (license (non-copyleft "file://COPYING"
83dcfa72 78 "See COPYING in the distribution."))))
0a3aca47
LF
79
80(define-public flex-2.6.1
81 (package
82 (inherit flex)
83 (version "2.6.1")
84 (source (origin
85 (method url-fetch)
86 (uri (string-append "https://github.com/westes/flex"
87 "/releases/download/v" version "/"
88 "flex-" version ".tar.xz"))
89 (sha256
90 (base32
91 "0gqhk4vkwy4gl9xbpgkljph8c0a5kpijz6wd0p5r9q202qn42yic"))))))