You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

81 lines
3.4 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  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.
  10. ;;;
  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.
  15. ;;;
  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/>.
  18. (define-module (gnu packages flex)
  19. #:use-module (guix licenses)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix build-system gnu)
  23. #:use-module (gnu packages)
  24. #:use-module (gnu packages m4)
  25. #:use-module (gnu packages bison)
  26. #:use-module (gnu packages indent)
  27. #:use-module (srfi srfi-1)
  28. #:export (flex))
  29. (define flex
  30. (package
  31. (name "flex")
  32. (version "2.5.37")
  33. (source (origin
  34. (method url-fetch)
  35. (uri (string-append "mirror://sourceforge/flex/flex-"
  36. version ".tar.bz2"))
  37. (sha256
  38. (base32
  39. "0ah5mi4j62b85a9rllv1004mzjb5cd0mn4glvz13p88rpx77pahp"))
  40. (patches (list (search-patch "flex-bison-tests.patch")))))
  41. (build-system gnu-build-system)
  42. (inputs
  43. (let ((bison-for-tests
  44. ;; Work around an incompatibility with Bison 3.0:
  45. ;; <http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00014.html>.
  46. (package (inherit bison)
  47. (version "2.7.1")
  48. (source (origin
  49. (method url-fetch)
  50. (uri (string-append "mirror://gnu/bison/bison-"
  51. version ".tar.xz"))
  52. (sha256
  53. (base32
  54. "1yx7isx67sdmyijvihgyra1f59fwdz7sqriginvavfj5yb5ss2dl"))))
  55. ;; Unlike Bison 3.0, this version did not need Flex for its
  56. ;; tests, so it allows us to break the cycle.
  57. (inputs (alist-delete "flex" (package-inputs bison))))))
  58. `(("bison" ,bison-for-tests)
  59. ("indent" ,indent))))
  60. (propagated-inputs `(("m4" ,m4)))
  61. (home-page "http://flex.sourceforge.net/")
  62. (synopsis "A fast lexical analyser generator")
  63. (description
  64. "Flex is a tool for generating scanners. A scanner, sometimes
  65. called a tokenizer, is a program which recognizes lexical patterns in
  66. text. The flex program reads user-specified input files, or its standard
  67. input if no file names are given, for a description of a scanner to
  68. generate. The description is in the form of pairs of regular expressions
  69. and C code, called rules. Flex generates a C source file named,
  70. \"lex.yy.c\", which defines the function yylex(). The file \"lex.yy.c\"
  71. can be compiled and linked to produce an executable. When the executable
  72. is run, it analyzes its input for occurrences of text matching the
  73. regular expressions for each rule. Whenever it finds a match, it
  74. executes the corresponding C code.")
  75. (license (bsd-style "file://COPYING"
  76. "See COPYING in the distribution."))))