flex.scm 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. (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 man)
  27. #:use-module (gnu packages bison)
  28. #:use-module (gnu packages indent)
  29. #:use-module (srfi srfi-1))
  30. (define-public flex
  31. (package
  32. (name "flex")
  33. (version "2.6.4")
  34. (source (origin
  35. (method url-fetch)
  36. (uri (string-append
  37. "https://github.com/westes/flex"
  38. "/releases/download/v" version "/"
  39. "flex-" version ".tar.gz"))
  40. (sha256
  41. (base32
  42. "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8"))))
  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
  49. (inherit bison)
  50. (version "2.7.1")
  51. (source (origin
  52. (method url-fetch)
  53. (uri (string-append
  54. "mirror://gnu/bison/"
  55. "bison-" version ".tar.xz"))
  56. (sha256
  57. (base32
  58. "1yx7isx67sdmyijvihgyra1f59fwdz7sqriginvavfj5yb5ss2dl"))))
  59. ;; Unlike Bison 3.0, this version did not need Flex for its
  60. ;; tests, so it allows us to break the cycle.
  61. (inputs (alist-delete "flex" (package-inputs bison))))))
  62. `(("bison" ,bison-for-tests)
  63. ("indent" ,indent))))
  64. ;; m4 is not present in PATH when cross-building
  65. (native-inputs
  66. `(("help2man" ,help2man)
  67. ("m4" ,m4)))
  68. (propagated-inputs `(("m4" ,m4)))
  69. (home-page "https://github.com/westes/flex")
  70. (synopsis "Fast lexical analyser generator")
  71. (description
  72. "Flex is a tool for generating scanners. A scanner, sometimes
  73. called a tokenizer, is a program which recognizes lexical patterns in
  74. text. The flex program reads user-specified input files, or its standard
  75. input if no file names are given, for a description of a scanner to
  76. generate. The description is in the form of pairs of regular expressions
  77. and C code, called rules. Flex generates a C source file named,
  78. \"lex.yy.c\", which defines the function yylex(). The file \"lex.yy.c\"
  79. can be compiled and linked to produce an executable. When the executable
  80. is run, it analyzes its input for occurrences of text matching the
  81. regular expressions for each rule. Whenever it finds a match, it
  82. executes the corresponding C code.")
  83. (license (non-copyleft "file://COPYING"
  84. "See COPYING in the distribution."))))
  85. (define-public flex-2.6.1
  86. (package
  87. (inherit flex)
  88. (version "2.6.1")
  89. (source (origin
  90. (method url-fetch)
  91. (uri (string-append "https://github.com/westes/flex"
  92. "/releases/download/v" version "/"
  93. "flex-" version ".tar.xz"))
  94. (sha256
  95. (base32
  96. "0gqhk4vkwy4gl9xbpgkljph8c0a5kpijz6wd0p5r9q202qn42yic"))))))