gnu: calibre: Build with non-modular Qt.
[jackhill/guix/guix.git] / gnu / packages / lua.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2014 Raimon Grau <raimonster@gmail.com>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages lua)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages readline))
30
31 (define-public lua
32 (package
33 (name "lua")
34 (version "5.2.4")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append "http://www.lua.org/ftp/lua-"
38 version ".tar.gz"))
39 (sha256
40 (base32 "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr"))
41 (patches (search-patches "lua-pkgconfig.patch"
42 "lua52-liblua-so.patch"))))
43 (build-system gnu-build-system)
44 (inputs `(("readline" ,readline)))
45 (arguments
46 '(#:modules ((guix build gnu-build-system)
47 (guix build utils)
48 (srfi srfi-1))
49 #:test-target "test"
50 #:phases
51 (modify-phases %standard-phases
52 (delete 'configure)
53 (replace 'build
54 (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux"))))
55 (replace 'install
56 (lambda* (#:key outputs #:allow-other-keys)
57 (let ((out (assoc-ref outputs "out")))
58 (zero? (system* "make" "install"
59 (string-append "INSTALL_TOP=" out)
60 (string-append "INSTALL_MAN=" out
61 "/share/man/man1")))))))))
62 (home-page "http://www.lua.org/")
63 (synopsis "Embeddable scripting language")
64 (description
65 "Lua is a powerful, fast, lightweight, embeddable scripting language. Lua
66 combines simple procedural syntax with powerful data description constructs
67 based on associative arrays and extensible semantics. Lua is dynamically typed,
68 runs by interpreting bytecode for a register-based virtual machine, and has
69 automatic memory management with incremental garbage collection, making it ideal
70 for configuration, scripting, and rapid prototyping.")
71 (license x11)))
72
73 (define-public lua-5.1
74 (package (inherit lua)
75 (version "5.1.5")
76 (source (origin
77 (method url-fetch)
78 (uri (string-append "http://www.lua.org/ftp/lua-"
79 version ".tar.gz"))
80 (sha256
81 (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16"))
82 (patches (search-patches "lua51-liblua-so.patch"
83 "lua-CVE-2014-5461.patch"))))))
84
85 (define-public luajit
86 (package
87 (name "luajit")
88 (version "2.0.4")
89 (source (origin
90 (method url-fetch)
91 (uri (string-append "http://luajit.org/download/LuaJIT-"
92 version ".tar.gz"))
93 (sha256
94 (base32 "0zc0y7p6nx1c0pp4nhgbdgjljpfxsb5kgwp4ysz22l1p2bms83v2"))
95 (patches (search-patches "luajit-symlinks.patch"
96 "luajit-no_ldconfig.patch"))))
97 (build-system gnu-build-system)
98 (arguments
99 '(#:tests? #f ;luajit is distributed without tests
100 #:phases (alist-delete 'configure %standard-phases)
101 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
102 (home-page "http://www.luajit.org/")
103 (synopsis "Just in time compiler for Lua programming language version 5.1")
104 (description
105 "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua
106 programming language. Lua is a powerful, dynamic and light-weight programming
107 language. It may be embedded or used as a general-purpose, stand-alone
108 language.")
109 (license x11)))