gnu: Add tintin++.
[jackhill/guix/guix.git] / gnu / packages / lua.scm
CommitLineData
712e6e68
CR
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
924cd631 3;;; Copyright © 2014 Raimon Grau <raimonster@gmail.com>
a2c03fb1 4;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
90f80bf2 5;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
32fddd8e 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
07cbe28e 7;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
712e6e68
CR
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages lua)
572e433f 25 #:use-module ((guix licenses) #:prefix license:)
712e6e68
CR
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
fd07a6a6 30 #:use-module (gnu packages readline)
d62dc2ae 31 #:use-module (gnu packages tls)
fd07a6a6 32 #:use-module (gnu packages xml))
712e6e68
CR
33
34(define-public lua
35 (package
36 (name "lua")
2cb33ef8 37 (version "5.2.4")
712e6e68
CR
38 (source (origin
39 (method url-fetch)
40 (uri (string-append "http://www.lua.org/ftp/lua-"
41 version ".tar.gz"))
42 (sha256
2cb33ef8 43 (base32 "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr"))
fc1adab1
AK
44 (patches (search-patches "lua-pkgconfig.patch"
45 "lua52-liblua-so.patch"))))
712e6e68 46 (build-system gnu-build-system)
b3546174 47 (inputs `(("readline" ,readline)))
712e6e68
CR
48 (arguments
49 '(#:modules ((guix build gnu-build-system)
07cbe28e
RW
50 (guix build utils)
51 (srfi srfi-1))
712e6e68 52 #:test-target "test"
07cbe28e
RW
53 #:make-flags
54 '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX"
55 "linux")
a4349e7a
EF
56 #:phases
57 (modify-phases %standard-phases
58 (delete 'configure)
a4349e7a
EF
59 (replace 'install
60 (lambda* (#:key outputs #:allow-other-keys)
61 (let ((out (assoc-ref outputs "out")))
62 (zero? (system* "make" "install"
63 (string-append "INSTALL_TOP=" out)
64 (string-append "INSTALL_MAN=" out
65 "/share/man/man1")))))))))
712e6e68 66 (home-page "http://www.lua.org/")
9e771e3b 67 (synopsis "Embeddable scripting language")
712e6e68
CR
68 (description
69 "Lua is a powerful, fast, lightweight, embeddable scripting language. Lua
70combines simple procedural syntax with powerful data description constructs
35b9e423 71based on associative arrays and extensible semantics. Lua is dynamically typed,
712e6e68
CR
72runs by interpreting bytecode for a register-based virtual machine, and has
73automatic memory management with incremental garbage collection, making it ideal
74for configuration, scripting, and rapid prototyping.")
572e433f 75 (license license:x11)))
924cd631 76
01d3f19b
AE
77(define-public lua-5.1
78 (package (inherit lua)
79 (version "5.1.5")
80 (source (origin
81 (method url-fetch)
82 (uri (string-append "http://www.lua.org/ftp/lua-"
83 version ".tar.gz"))
84 (sha256
c361d075 85 (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16"))
32fddd8e
EF
86 (patches (search-patches "lua51-liblua-so.patch"
87 "lua-CVE-2014-5461.patch"))))))
01d3f19b 88
924cd631
RG
89(define-public luajit
90 (package
91 (name "luajit")
89deaf16 92 (version "2.0.4")
924cd631
RG
93 (source (origin
94 (method url-fetch)
95 (uri (string-append "http://luajit.org/download/LuaJIT-"
96 version ".tar.gz"))
97 (sha256
89deaf16 98 (base32 "0zc0y7p6nx1c0pp4nhgbdgjljpfxsb5kgwp4ysz22l1p2bms83v2"))
fc1adab1
AK
99 (patches (search-patches "luajit-symlinks.patch"
100 "luajit-no_ldconfig.patch"))))
924cd631
RG
101 (build-system gnu-build-system)
102 (arguments
103 '(#:tests? #f ;luajit is distributed without tests
104 #:phases (alist-delete 'configure %standard-phases)
105 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
106 (home-page "http://www.luajit.org/")
107 (synopsis "Just in time compiler for Lua programming language version 5.1")
108 (description
109 "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua
110programming language. Lua is a powerful, dynamic and light-weight programming
111language. It may be embedded or used as a general-purpose, stand-alone
112language.")
572e433f 113 (license license:x11)))
fd07a6a6
RW
114
115(define-public lua5.1-expat
116 (package
117 (name "lua5.1-expat")
118 (version "1.3.0")
119 (source (origin
120 (method url-fetch)
121 (uri (string-append "https://matthewwild.co.uk/projects/"
122 "luaexpat/luaexpat-" version ".tar.gz"))
123 (sha256
124 (base32
125 "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h"))))
126 (build-system gnu-build-system)
127 (arguments
128 `(#:make-flags
129 (let ((out (assoc-ref %outputs "out")))
130 (list "CC=gcc"
131 (string-append "LUA_LDIR=" out "/share/lua/$(LUA_V)")
132 (string-append "LUA_CDIR=" out "/lib/lua/$(LUA_V)")))
133 #:phases
134 (modify-phases %standard-phases
135 (delete 'configure)
136 (replace 'check
137 (lambda _
138 (setenv "LUA_CPATH" "src/?.so;;")
139 (setenv "LUA_PATH" "src/?.lua;;")
140 (and (zero? (system* "lua" "tests/test.lua"))
141 (zero? (system* "lua" "tests/test-lom.lua"))))))))
142 (inputs
143 `(("lua" ,lua-5.1)
144 ("expat" ,expat)))
145 (home-page "http://matthewwild.co.uk/projects/luaexpat/")
146 (synopsis "SAX XML parser based on the Expat library")
147 (description "LuaExpat is a SAX XML parser based on the Expat library.")
148 (license (package-license lua-5.1))))
c21b8261
RW
149
150(define-public lua5.1-socket
151 (package
152 (name "lua5.1-socket")
153 (version "2.0.2")
154 (source (origin
155 (method url-fetch)
156 (uri (string-append "http://files.luaforge.net/releases/"
157 "luasocket/luasocket/luasocket-"
158 version "/luasocket-" version ".tar.gz"))
159 (sha256
160 (base32
161 "19ichkbc4rxv00ggz8gyf29jibvc2wq9pqjik0ll326rrxswgnag"))))
162 (build-system gnu-build-system)
163 (arguments
164 `(#:make-flags
165 (let ((out (assoc-ref %outputs "out")))
166 (list (string-append "INSTALL_TOP_SHARE=" out "/share/lua/5.1")
167 (string-append "INSTALL_TOP_LIB=" out "/lib/lua/5.1")))
168 #:phases
169 (modify-phases %standard-phases
170 (delete 'configure)
171 (replace 'check
172 (lambda _
173 (setenv "LUA_CPATH" (string-append "src/?.so." ,version ";;"))
174 (setenv "LUA_PATH" "src/?.lua;;")
175 (when (zero? (primitive-fork))
176 (system* "lua" "test/testsrvr.lua"))
177 (zero? (system* "lua" "test/testclnt.lua")))))))
178 (inputs
179 `(("lua" ,lua-5.1)))
180 (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/")
181 (synopsis "Socket library for Lua")
182 (description "LuaSocket is a Lua extension library that is composed by two
183parts: a C core that provides support for the TCP and UDP transport layers,
184and a set of Lua modules that add support for functionality commonly needed by
185applications that deal with the Internet.
186
187Among the supported modules, the most commonly used implement the
188SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading
189files) client protocols. These provide a very natural and generic interface
190to the functionality defined by each protocol. In addition, you will find
191that the MIME (common encodings), URL (anything you could possible want to do
192with one) and LTN12 (filters, sinks, sources and pumps) modules can be very
193handy.")
194 (license (package-license lua-5.1))))
182de8fc
RW
195
196(define-public lua5.1-filesystem
197 (package
198 (name "lua5.1-filesystem")
199 (version "1.6.3")
200 (source (origin
201 (method url-fetch)
202 (uri (string-append "https://github.com/keplerproject/"
203 "luafilesystem/archive/v_"
204 "1_6_3" ".tar.gz"))
205 (file-name (string-append name "-" version ".tar.gz"))
206 (sha256
207 (base32
208 "0s10ckxin0bysd6gaywqhxkpw3ybjhprr8m655b8cx3pxjwd49am"))))
209 (build-system gnu-build-system)
210 (arguments
211 `(#:make-flags
212 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
213 #:test-target "test"
214 #:phases
215 (modify-phases %standard-phases
216 (delete 'configure))))
217 (inputs
218 `(("lua" ,lua-5.1)))
219 (home-page "https://keplerproject.github.io/luafilesystem/index.html")
220 (synopsis "File system library for Lua")
221 (description "LuaFileSystem is a Lua library developed to complement the
222set of functions related to file systems offered by the standard Lua
223distribution. LuaFileSystem offers a portable way to access the underlying
224directory structure and file attributes.")
225 (license (package-license lua-5.1))))
d62dc2ae
RW
226
227(define-public lua5.1-sec
228 (package
229 (name "lua5.1-sec")
230 (version "0.6")
231 (source (origin
232 (method url-fetch)
233 (uri (string-append "https://github.com/brunoos/luasec/archive/"
234 "luasec-" version ".tar.gz"))
235 (sha256
236 (base32
237 "0pgd1anzznl4s0h16wg8dlw9mgdb9h52drlcki6sbf5y31fa7wyf"))))
238 (build-system gnu-build-system)
239 (arguments
240 `(#:make-flags
241 (let ((out (assoc-ref %outputs "out")))
242 (list "linux"
243 "CC=gcc"
244 "LD=gcc"
245 (string-append "LUAPATH=" out "/share/lua/5.1")
246 (string-append "LUACPATH=" out "/lib/lua/5.1")))
247 #:tests? #f ; no tests included
248 #:phases
249 (modify-phases %standard-phases
250 (delete 'configure))))
251 (inputs
252 `(("lua" ,lua-5.1)
253 ("openssl" ,openssl)))
254 (propagated-inputs
255 `(("lua-socket" ,lua5.1-socket)))
256 (home-page "https://github.com/brunoos/luasec/wiki")
257 (synopsis "OpenSSL bindings for Lua")
258 (description "LuaSec is a binding for OpenSSL library to provide TLS/SSL
259communication. It takes an already established TCP connection and creates a
260secure session between the peers.")
261 (license (package-license lua-5.1))))