projects/guix·blob java-team · refs

77 lines · 3.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2019 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2021 Simon South <[email protected]>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages ragel)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix utils)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base))
29
30(define-public ragel
31 (package
32 (name "ragel")
33 (version "6.10")
34 (source (origin
35 (method url-fetch)
36 (uri (string-append "https://www.colm.net/files/ragel/ragel-"
37 version ".tar.gz"))
38 (sha256
39 (base32
40 "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az"))))
41 (build-system gnu-build-system)
42 (arguments
43 (if (target-aarch64?)
44 '(#:phases
45 (modify-phases %standard-phases
46 (add-after 'unpack 'apply-char-signedness-fix
47 ;; Apply a backported fix for aarch64-linux, where the C/C++
48 ;; "char" type is unsigned by default.
49 ;;
50 ;; The patch is applied in this custom phase and not via the
51 ;; "origin" object above to avoid rebuilding a large number of
52 ;; packages on other platforms.
53 (lambda _
54 (let ((patch
55 (search-input-file %build-inputs "/bin/patch"))
56 (char-signedness-patch
57 (assoc-ref %build-inputs "char-signedness-patch")))
58 (invoke patch "-p1" "-i" char-signedness-patch))))))
59 '()))
60 (native-inputs
61 (if (target-aarch64?)
62 `(("char-signedness-patch"
63 ,(search-patch "ragel-char-signedness.patch"))
64 ("patch" ,patch))
65 '()))
66 (home-page "https://www.colm.net/open-source/ragel/")
67 (synopsis "State machine compiler")
68 (description
69 "Ragel compiles executable finite state machines from regular languages.
70Ragel targets C, C++, Obj-C, C#, D, Java, Go and Ruby. Ragel state machines
71can not only recognize byte sequences as regular expression machines do, but
72can also execute code at arbitrary points in the recognition of a regular
73language. Code embedding is done using inline operators that do not disrupt
74the regular language syntax.")
75 ;; GPLv2 (or later) with exception for generated code.
76 (license license:gpl2+)))
77