Commit | Line | Data |
---|---|---|
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> |
f2dc5f5b | 6 | ;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il> |
9ad3d679 | 7 | ;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net> |
03d8505f | 8 | ;;; Copyright © 2016 doncatnip <gnopap@gmail.com> |
7c97a063 | 9 | ;;; Copyright © 2016, 2017, 2019 Clément Lassieur <clement@lassieur.org> |
35cdc267 | 10 | ;;; Copyright © 2016 José Miguel Sánchez García <jmi2k@openmailbox.org> |
88a09963 | 11 | ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
ce577655 | 12 | ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com> |
1c58aa6f | 13 | ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
31be8fc8 | 14 | ;;; Copyright © 2020 Simon South <simon@simonsouth.net> |
0190c9b2 | 15 | ;;; Copyright © 2020 Paul A. Patience <paul@apatience.com> |
712e6e68 CR |
16 | ;;; |
17 | ;;; This file is part of GNU Guix. | |
18 | ;;; | |
19 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
20 | ;;; under the terms of the GNU General Public License as published by | |
21 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
22 | ;;; your option) any later version. | |
23 | ;;; | |
24 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
25 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
27 | ;;; GNU General Public License for more details. | |
28 | ;;; | |
29 | ;;; You should have received a copy of the GNU General Public License | |
30 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
31 | ||
32 | (define-module (gnu packages lua) | |
572e433f | 33 | #:use-module ((guix licenses) #:prefix license:) |
712e6e68 CR |
34 | #:use-module (guix packages) |
35 | #:use-module (guix download) | |
ce577655 | 36 | #:use-module (guix git-download) |
35cdc267 | 37 | #:use-module (guix utils) |
712e6e68 | 38 | #:use-module (guix build-system gnu) |
ce577655 | 39 | #:use-module (guix build-system cmake) |
1fd4b99e | 40 | #:use-module (guix build-system trivial) |
712e6e68 | 41 | #:use-module (gnu packages) |
fd07a6a6 | 42 | #:use-module (gnu packages readline) |
31be8fc8 | 43 | #:use-module (gnu packages m4) |
d62dc2ae | 44 | #:use-module (gnu packages tls) |
03d8505f | 45 | #:use-module (gnu packages xml) |
46 | #:use-module (gnu packages glib) | |
9ad3d679 | 47 | #:use-module (gnu packages libevent) |
03d8505f | 48 | #:use-module (gnu packages libffi) |
49 | #:use-module (gnu packages pkg-config) | |
50 | #:use-module (gnu packages xorg) | |
51 | #:use-module (gnu packages gtk)) | |
712e6e68 CR |
52 | |
53 | (define-public lua | |
54 | (package | |
55 | (name "lua") | |
6094a65e | 56 | (version "5.3.5") |
712e6e68 CR |
57 | (source (origin |
58 | (method url-fetch) | |
6dbf1fec | 59 | (uri (string-append "https://www.lua.org/ftp/lua-" |
712e6e68 CR |
60 | version ".tar.gz")) |
61 | (sha256 | |
6094a65e | 62 | (base32 "1b2qn2rv96nmbm6zab4l877bd4zq7wpwm8drwjiy2ih4jqzysbhc")) |
fc1adab1 | 63 | (patches (search-patches "lua-pkgconfig.patch" |
6dbf1fec | 64 | "lua-liblua-so.patch")))) |
712e6e68 | 65 | (build-system gnu-build-system) |
b3546174 | 66 | (inputs `(("readline" ,readline))) |
712e6e68 | 67 | (arguments |
50836eb7 | 68 | `(#:modules ((guix build gnu-build-system) |
07cbe28e RW |
69 | (guix build utils) |
70 | (srfi srfi-1)) | |
712e6e68 | 71 | #:test-target "test" |
07cbe28e | 72 | #:make-flags |
50836eb7 EF |
73 | (list "MYCFLAGS=-fPIC -DLUA_DL_DLOPEN" |
74 | (string-append "CC=" ,(cc-for-target)) | |
75 | (string-append "SYSLIBS=-L" (assoc-ref %build-inputs "readline") | |
76 | "/lib") | |
77 | "linux") | |
a4349e7a EF |
78 | #:phases |
79 | (modify-phases %standard-phases | |
80 | (delete 'configure) | |
a4349e7a EF |
81 | (replace 'install |
82 | (lambda* (#:key outputs #:allow-other-keys) | |
83 | (let ((out (assoc-ref outputs "out"))) | |
ffa95cf3 MW |
84 | (invoke "make" "install" |
85 | (string-append "INSTALL_TOP=" out) | |
86 | (string-append "INSTALL_MAN=" out | |
87 | "/share/man/man1")))))))) | |
6dbf1fec | 88 | (home-page "https://www.lua.org/") |
9e771e3b | 89 | (synopsis "Embeddable scripting language") |
712e6e68 CR |
90 | (description |
91 | "Lua is a powerful, fast, lightweight, embeddable scripting language. Lua | |
92 | combines simple procedural syntax with powerful data description constructs | |
35b9e423 | 93 | based on associative arrays and extensible semantics. Lua is dynamically typed, |
712e6e68 CR |
94 | runs by interpreting bytecode for a register-based virtual machine, and has |
95 | automatic memory management with incremental garbage collection, making it ideal | |
96 | for configuration, scripting, and rapid prototyping.") | |
572e433f | 97 | (license license:x11))) |
924cd631 | 98 | |
6dbf1fec MB |
99 | (define-public lua-5.2 |
100 | (package (inherit lua) | |
101 | (version "5.2.4") | |
102 | (source | |
103 | (origin | |
104 | (method url-fetch) | |
105 | (uri (string-append "https://www.lua.org/ftp/lua-" | |
106 | version ".tar.gz")) | |
107 | (sha256 | |
108 | (base32 "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr")) | |
109 | (patches (search-patches "lua-pkgconfig.patch" | |
110 | "lua-liblua-so.patch")))))) | |
111 | ||
01d3f19b AE |
112 | (define-public lua-5.1 |
113 | (package (inherit lua) | |
114 | (version "5.1.5") | |
115 | (source (origin | |
116 | (method url-fetch) | |
6dbf1fec | 117 | (uri (string-append "https://www.lua.org/ftp/lua-" |
01d3f19b AE |
118 | version ".tar.gz")) |
119 | (sha256 | |
c361d075 | 120 | (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16")) |
32fddd8e | 121 | (patches (search-patches "lua51-liblua-so.patch" |
a287fafe DM |
122 | "lua-CVE-2014-5461.patch" |
123 | "lua51-pkgconfig.patch")))))) | |
01d3f19b | 124 | |
924cd631 RG |
125 | (define-public luajit |
126 | (package | |
127 | (name "luajit") | |
906f1b48 | 128 | (version "2.1.0-beta3") |
924cd631 RG |
129 | (source (origin |
130 | (method url-fetch) | |
131 | (uri (string-append "http://luajit.org/download/LuaJIT-" | |
132 | version ".tar.gz")) | |
133 | (sha256 | |
906f1b48 TGR |
134 | (base32 "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs")) |
135 | (patches (search-patches "luajit-no_ldconfig.patch")))) | |
924cd631 RG |
136 | (build-system gnu-build-system) |
137 | (arguments | |
a093bb69 TGR |
138 | `(#:tests? #f ; luajit is distributed without tests |
139 | #:phases | |
140 | (modify-phases %standard-phases | |
141 | (delete 'configure) ; no configure script | |
142 | (add-after 'install 'create-luajit-symlink | |
143 | (lambda* (#:key outputs #:allow-other-keys) | |
144 | (let* ((out (assoc-ref outputs "out")) | |
145 | (bin (string-append out "/bin"))) | |
146 | (with-directory-excursion bin | |
147 | (symlink ,(string-append name "-" version) | |
148 | ,name) | |
149 | #t))))) | |
150 | #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))))) | |
0386cdd3 | 151 | (home-page "https://www.luajit.org/") |
924cd631 RG |
152 | (synopsis "Just in time compiler for Lua programming language version 5.1") |
153 | (description | |
154 | "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua | |
155 | programming language. Lua is a powerful, dynamic and light-weight programming | |
156 | language. It may be embedded or used as a general-purpose, stand-alone | |
157 | language.") | |
572e433f | 158 | (license license:x11))) |
fd07a6a6 | 159 | |
7c97a063 | 160 | (define (make-lua-expat name lua) |
fd07a6a6 | 161 | (package |
7c97a063 | 162 | (name name) |
fd07a6a6 RW |
163 | (version "1.3.0") |
164 | (source (origin | |
165 | (method url-fetch) | |
166 | (uri (string-append "https://matthewwild.co.uk/projects/" | |
167 | "luaexpat/luaexpat-" version ".tar.gz")) | |
168 | (sha256 | |
169 | (base32 | |
170 | "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h")))) | |
171 | (build-system gnu-build-system) | |
172 | (arguments | |
173 | `(#:make-flags | |
7c97a063 CL |
174 | (let ((out (assoc-ref %outputs "out")) |
175 | (lua-version ,(version-major+minor (package-version lua)))) | |
fd07a6a6 | 176 | (list "CC=gcc" |
7c97a063 CL |
177 | (string-append "LUA_LDIR=" out "/share/lua/" lua-version) |
178 | (string-append "LUA_CDIR=" out "/lib/lua/" lua-version))) | |
fd07a6a6 RW |
179 | #:phases |
180 | (modify-phases %standard-phases | |
181 | (delete 'configure) | |
182 | (replace 'check | |
183 | (lambda _ | |
184 | (setenv "LUA_CPATH" "src/?.so;;") | |
185 | (setenv "LUA_PATH" "src/?.lua;;") | |
12a16602 MW |
186 | (invoke "lua" "tests/test.lua") |
187 | (invoke "lua" "tests/test-lom.lua")))))) | |
fd07a6a6 | 188 | (inputs |
7c97a063 | 189 | `(("lua" ,lua) |
fd07a6a6 | 190 | ("expat" ,expat))) |
aa033c8e | 191 | (home-page "https://matthewwild.co.uk/projects/luaexpat/") |
fd07a6a6 RW |
192 | (synopsis "SAX XML parser based on the Expat library") |
193 | (description "LuaExpat is a SAX XML parser based on the Expat library.") | |
194 | (license (package-license lua-5.1)))) | |
c21b8261 | 195 | |
7c97a063 CL |
196 | (define-public lua5.1-expat |
197 | (make-lua-expat "lua5.1-expat" lua-5.1)) | |
198 | ||
199 | (define-public lua5.2-expat | |
200 | (make-lua-expat "lua5.2-expat" lua-5.2)) | |
201 | ||
253aab77 | 202 | (define (make-lua-socket name lua) |
c21b8261 | 203 | (package |
253aab77 | 204 | (name name) |
50269c01 | 205 | (version "3.0-rc1") |
c21b8261 | 206 | (source (origin |
5545abec EF |
207 | (method git-fetch) |
208 | (uri (git-reference | |
209 | (url "https://github.com/diegonehab/luasocket") | |
210 | (commit (string-append "v" version)))) | |
211 | (file-name (git-file-name name version)) | |
c21b8261 RW |
212 | (sha256 |
213 | (base32 | |
5545abec | 214 | "1chs7z7a3i3lck4x7rz60ziwbf793gw169hpjdfca8y4yf1hzsxk")))) |
c21b8261 RW |
215 | (build-system gnu-build-system) |
216 | (arguments | |
217 | `(#:make-flags | |
253aab77 CL |
218 | (let ((out (assoc-ref %outputs "out")) |
219 | (lua-version ,(version-major+minor (package-version lua)))) | |
220 | (list (string-append "INSTALL_TOP=" out) | |
221 | (string-append "LUAV?=" lua-version))) | |
c21b8261 RW |
222 | #:phases |
223 | (modify-phases %standard-phases | |
224 | (delete 'configure) | |
225 | (replace 'check | |
226 | (lambda _ | |
227 | (setenv "LUA_CPATH" (string-append "src/?.so." ,version ";;")) | |
228 | (setenv "LUA_PATH" "src/?.lua;;") | |
229 | (when (zero? (primitive-fork)) | |
6e3fc9ba MW |
230 | (invoke "lua" "test/testsrvr.lua")) |
231 | (invoke "lua" "test/testclnt.lua")))))) | |
c21b8261 | 232 | (inputs |
253aab77 | 233 | `(("lua" ,lua))) |
c21b8261 RW |
234 | (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/") |
235 | (synopsis "Socket library for Lua") | |
236 | (description "LuaSocket is a Lua extension library that is composed by two | |
237 | parts: a C core that provides support for the TCP and UDP transport layers, | |
238 | and a set of Lua modules that add support for functionality commonly needed by | |
239 | applications that deal with the Internet. | |
240 | ||
241 | Among the supported modules, the most commonly used implement the | |
242 | SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading | |
243 | files) client protocols. These provide a very natural and generic interface | |
244 | to the functionality defined by each protocol. In addition, you will find | |
245 | that the MIME (common encodings), URL (anything you could possible want to do | |
246 | with one) and LTN12 (filters, sinks, sources and pumps) modules can be very | |
247 | handy.") | |
253aab77 CL |
248 | (license license:expat))) |
249 | ||
250 | (define-public lua5.1-socket | |
251 | (make-lua-socket "lua5.1-socket" lua-5.1)) | |
252 | ||
253 | (define-public lua5.2-socket | |
254 | (make-lua-socket "lua5.2-socket" lua-5.2)) | |
182de8fc | 255 | |
d9943257 | 256 | (define (make-lua-filesystem name lua) |
182de8fc | 257 | (package |
d9943257 | 258 | (name name) |
3095616b | 259 | (version "1.7.0.2") |
182de8fc | 260 | (source (origin |
f2dc5f5b EF |
261 | (method git-fetch) |
262 | (uri (git-reference | |
263 | (url "https://github.com/keplerproject/luafilesystem") | |
3095616b | 264 | (commit (string-append "v" |
f2dc5f5b EF |
265 | (string-join |
266 | (string-split version #\.) "_"))))) | |
267 | (file-name (git-file-name name version)) | |
182de8fc RW |
268 | (sha256 |
269 | (base32 | |
3095616b | 270 | "0zmprgkm9zawdf9wnw0v3w6ibaj442wlc6alp39hmw610fl4vghi")))) |
182de8fc RW |
271 | (build-system gnu-build-system) |
272 | (arguments | |
273 | `(#:make-flags | |
d9943257 CL |
274 | (let ((out (assoc-ref %outputs "out")) |
275 | (lua-version ,(version-major+minor (package-version lua)))) | |
276 | (list (string-append "PREFIX=" out) | |
277 | (string-append "LUA_LIBDIR=" out "/lib/lua/" lua-version))) | |
182de8fc RW |
278 | #:test-target "test" |
279 | #:phases | |
280 | (modify-phases %standard-phases | |
281 | (delete 'configure)))) | |
282 | (inputs | |
d9943257 | 283 | `(("lua" ,lua))) |
182de8fc RW |
284 | (home-page "https://keplerproject.github.io/luafilesystem/index.html") |
285 | (synopsis "File system library for Lua") | |
286 | (description "LuaFileSystem is a Lua library developed to complement the | |
287 | set of functions related to file systems offered by the standard Lua | |
288 | distribution. LuaFileSystem offers a portable way to access the underlying | |
289 | directory structure and file attributes.") | |
290 | (license (package-license lua-5.1)))) | |
d62dc2ae | 291 | |
d9943257 CL |
292 | (define-public lua-filesystem |
293 | (make-lua-filesystem "lua-filesystem" lua)) | |
294 | ||
295 | (define-public lua5.1-filesystem | |
296 | (make-lua-filesystem "lua5.1-filesystem" lua-5.1)) | |
297 | ||
298 | (define-public lua5.2-filesystem | |
299 | (make-lua-filesystem "lua5.2-filesystem" lua-5.2)) | |
300 | ||
31be8fc8 SS |
301 | (define (make-lua-ossl name lua) |
302 | (package | |
303 | (name name) | |
304 | (version "20170903") | |
305 | (source (origin | |
306 | (method url-fetch) | |
307 | (uri (string-append "https://25thandclement.com/~william/" | |
308 | "projects/releases/luaossl-" version ".tgz")) | |
309 | (sha256 | |
310 | (base32 | |
311 | "10392bvd0lzyibipblgiss09zlqh3a5zgqg1b9lgbybpqb9cv2k3")))) | |
312 | (build-system gnu-build-system) | |
313 | (arguments | |
314 | `(#:make-flags | |
315 | (let ((out (assoc-ref %outputs "out")) | |
316 | (lua-api-version ,(version-major+minor (package-version lua)))) | |
317 | (list "CC=gcc" | |
318 | "CFLAGS='-D HAVE_SYS_SYSCTL_H=0'" ; sys/sysctl.h is deprecated | |
88a09963 TGR |
319 | (string-append "prefix=" out) |
320 | (string-append "LUA_APIS=" lua-api-version))) | |
31be8fc8 SS |
321 | #:phases |
322 | (modify-phases %standard-phases | |
323 | (delete 'configure) | |
324 | (delete 'check) | |
325 | (add-after 'install 'check | |
326 | (lambda* (#:key outputs #:allow-other-keys) | |
327 | (let ((out (assoc-ref outputs "out")) | |
328 | (lua-version ,(version-major+minor (package-version lua)))) | |
329 | (setenv "LUA_CPATH" | |
330 | (string-append out "/lib/lua/" lua-version "/?.so;;")) | |
331 | (setenv "LUA_PATH" | |
332 | (string-append out "/share/lua/" lua-version "/?.lua;;")) | |
333 | (with-directory-excursion "regress" | |
334 | (for-each (lambda (f) | |
335 | (invoke "lua" f)) | |
336 | (find-files "." "^[0-9].*\\.lua$")))) | |
337 | #t))))) | |
338 | (inputs | |
339 | `(("lua" ,lua) | |
340 | ("openssl" ,openssl))) | |
341 | (home-page "https://25thandclement.com/~william/projects/luaossl.html") | |
342 | (synopsis "OpenSSL bindings for Lua") | |
343 | (description "The luaossl extension module for Lua provides comprehensive, | |
344 | low-level bindings to the OpenSSL library, including support for certificate and | |
345 | key management, key generation, signature verification, and deep bindings to the | |
346 | distinguished name, alternative name, and X.509v3 extension interfaces. It also | |
347 | binds OpenSSL's bignum, message digest, HMAC, cipher, and CSPRNG interfaces.") | |
348 | (license license:expat))) | |
349 | ||
350 | (define-public lua-ossl | |
351 | (make-lua-ossl "lua-ossl" lua)) | |
352 | ||
353 | (define-public lua5.1-ossl | |
354 | (make-lua-ossl "lua5.1-ossl" lua-5.1)) | |
355 | ||
356 | (define-public lua5.2-ossl | |
357 | (make-lua-ossl "lua5.2-ossl" lua-5.2)) | |
358 | ||
eb5b6c57 | 359 | (define (make-lua-sec name lua) |
d62dc2ae | 360 | (package |
eb5b6c57 | 361 | (name name) |
6298f327 | 362 | (version "0.9") |
d62dc2ae | 363 | (source (origin |
b63785ec EF |
364 | (method git-fetch) |
365 | (uri (git-reference | |
366 | (url "https://github.com/brunoos/luasec") | |
6298f327 | 367 | (commit (string-append "v" version)))) |
b63785ec | 368 | (file-name (git-file-name name version)) |
d62dc2ae RW |
369 | (sha256 |
370 | (base32 | |
6298f327 | 371 | "0ssncgkggyr8i3z6zbvgrgsqj2q8676rnsikhpfwnk9n7sx4gwbl")))) |
d62dc2ae RW |
372 | (build-system gnu-build-system) |
373 | (arguments | |
374 | `(#:make-flags | |
eb5b6c57 CL |
375 | (let ((out (assoc-ref %outputs "out")) |
376 | (lua-version ,(version-major+minor (package-version lua)))) | |
d62dc2ae RW |
377 | (list "linux" |
378 | "CC=gcc" | |
379 | "LD=gcc" | |
eb5b6c57 CL |
380 | (string-append "LUAPATH=" out "/share/lua/" lua-version) |
381 | (string-append "LUACPATH=" out "/lib/lua/" lua-version))) | |
d62dc2ae RW |
382 | #:tests? #f ; no tests included |
383 | #:phases | |
384 | (modify-phases %standard-phases | |
385 | (delete 'configure)))) | |
386 | (inputs | |
eb5b6c57 | 387 | `(("lua" ,lua) |
d62dc2ae RW |
388 | ("openssl" ,openssl))) |
389 | (propagated-inputs | |
eb5b6c57 CL |
390 | `(("lua-socket" |
391 | ,(make-lua-socket | |
392 | (format #f "lua~a-socket" | |
393 | (version-major+minor (package-version lua))) lua)))) | |
d62dc2ae RW |
394 | (home-page "https://github.com/brunoos/luasec/wiki") |
395 | (synopsis "OpenSSL bindings for Lua") | |
396 | (description "LuaSec is a binding for OpenSSL library to provide TLS/SSL | |
397 | communication. It takes an already established TCP connection and creates a | |
398 | secure session between the peers.") | |
eb5b6c57 CL |
399 | (license license:expat))) |
400 | ||
401 | (define-public lua5.1-sec | |
402 | (make-lua-sec "lua5.1-sec" lua-5.1)) | |
403 | ||
404 | (define-public lua5.2-sec | |
405 | (make-lua-sec "lua5.2-sec" lua-5.2)) | |
03d8505f | 406 | |
7c54e226 SS |
407 | (define (make-lua-cqueues name lua lua-ossl) |
408 | (package | |
409 | (name name) | |
410 | (version "20171014") | |
411 | (source (origin | |
412 | (method url-fetch) | |
413 | (uri (string-append "https://25thandclement.com/~william/" | |
414 | "projects/releases/cqueues-" version ".tgz")) | |
415 | (sha256 | |
416 | (base32 | |
417 | "1dabhpn6r0hlln8vx9hxm34pfcm46qzgpb2apmziwg5z51fi4ksb")))) | |
418 | (build-system gnu-build-system) | |
419 | (arguments | |
420 | `(#:modules ((guix build gnu-build-system) | |
421 | (guix build utils) | |
422 | (ice-9 string-fun)) | |
423 | #:make-flags | |
424 | (let ((out (assoc-ref %outputs "out")) | |
425 | (lua-api-version ,(version-major+minor (package-version lua)))) | |
426 | (list "CC=gcc" | |
427 | (string-append "LUA_APIS=" lua-api-version))) | |
428 | #:phases | |
429 | (modify-phases %standard-phases | |
430 | (delete 'configure) | |
431 | (delete 'check) | |
432 | (replace 'install | |
433 | (lambda* (#:key make-flags outputs #:allow-other-keys) | |
434 | (let ((out (assoc-ref outputs "out"))) | |
435 | (apply invoke "make" "install" | |
436 | (append make-flags | |
437 | (list (string-append "DESTDIR=" out) | |
438 | "prefix=")))))) | |
439 | (add-after 'install 'check | |
440 | (lambda* (#:key inputs outputs make-flags #:allow-other-keys) | |
441 | (let* | |
442 | ((lua-version ,(version-major+minor (package-version lua))) | |
443 | (env-suffix (if (equal? lua-version "5.1") | |
444 | "" | |
445 | (string-append | |
446 | "_" | |
447 | (string-replace-substring lua-version "." "_")))) | |
448 | ||
449 | (lua-ossl (assoc-ref inputs "lua-ossl")) | |
450 | (out (assoc-ref outputs "out")) | |
451 | ||
452 | (lua-cpath (lambda (p) | |
453 | (string-append p "/lib/lua/" lua-version "/?.so"))) | |
454 | (lua-path (lambda (p) | |
455 | (string-append p "/share/lua/" lua-version "/?.lua")))) | |
456 | ;; The test suite sets Lua-version-specific search-path variables | |
457 | ;; when available so we must do the same, as these take | |
458 | ;; precedence over the generic "LUA_CPATH" and "LUA_PATH" | |
459 | (setenv (string-append "LUA_CPATH" env-suffix) | |
460 | (string-append | |
461 | (string-join (map lua-cpath (list out lua-ossl)) ";") | |
462 | ";;")) | |
463 | (setenv (string-append "LUA_PATH" env-suffix) | |
464 | (string-append | |
465 | (string-join (map lua-path (list out lua-ossl)) ";") | |
466 | ";;")) | |
467 | ||
468 | ;; Skip regression tests we expect to fail | |
469 | (with-directory-excursion "regress" | |
470 | (for-each (lambda (f) | |
471 | (rename-file f (string-append f ".skip"))) | |
472 | (append | |
473 | ;; Regression tests that require network | |
474 | ;; connectivity | |
475 | '("22-client-dtls.lua" | |
476 | "30-starttls-completion.lua" | |
477 | "62-noname.lua" | |
478 | "153-dns-resolvers.lua") | |
479 | ||
480 | ;; Regression tests that require LuaJIT | |
481 | '("44-resolvers-gc.lua" | |
482 | "51-join-defunct-thread.lua") | |
483 | ||
484 | ;; Regression tests that require Lua 5.3 | |
485 | (if (not (equal? lua-version "5.3")) | |
486 | '("152-thread-integer-passing.lua") | |
487 | '())))) | |
488 | ||
489 | (apply invoke "make" "check" make-flags))))))) | |
490 | (native-inputs | |
491 | `(("m4" ,m4))) | |
492 | (inputs | |
493 | `(("lua" ,lua) | |
494 | ("openssl" ,openssl))) | |
495 | (propagated-inputs | |
496 | `(("lua-ossl" ,lua-ossl))) | |
497 | (home-page "https://25thandclement.com/~william/projects/cqueues.html") | |
498 | (synopsis "Event loop for Lua using continuation queues") | |
499 | (description "The cqueues extension module for Lua implements an event loop | |
500 | that operates through the yielding and resumption of coroutines. It is designed | |
501 | to be non-intrusive, composable, and embeddable within existing applications.") | |
502 | (license license:expat))) | |
503 | ||
504 | (define-public lua-cqueues | |
505 | (make-lua-cqueues "lua-cqueues" lua lua-ossl)) | |
506 | ||
507 | (define-public lua5.1-cqueues | |
508 | (make-lua-cqueues "lua5.1-cqueues" lua-5.1 lua5.1-ossl)) | |
509 | ||
510 | (define-public lua5.2-cqueues | |
511 | (make-lua-cqueues "lua5.2-cqueues" lua-5.2 lua5.2-ossl)) | |
512 | ||
1fd4b99e NG |
513 | (define-public lua-penlight |
514 | (package | |
515 | (name "lua-penlight") | |
516 | (version "1.7.0") | |
517 | (source | |
518 | (origin | |
519 | (method git-fetch) | |
520 | (uri (git-reference | |
b0e7b699 | 521 | (url "https://github.com/Tieske/Penlight") |
1fd4b99e NG |
522 | (commit version))) |
523 | (file-name (git-file-name name version)) | |
524 | (sha256 | |
525 | (base32 "0qc2d1riyr4b5a0gnsmdw2lz5pw65s4ac60hc34w3mmk9l6yg6nl")))) | |
526 | (build-system trivial-build-system) | |
527 | (inputs | |
528 | `(("lua" ,lua))) | |
529 | (propagated-inputs | |
530 | `(("lua-filesystem" ,lua-filesystem))) | |
531 | (arguments | |
532 | `(#:modules ((guix build utils)) | |
533 | #:builder | |
534 | (begin | |
535 | (use-modules (guix build utils)) | |
536 | (let* ((source (assoc-ref %build-inputs "source")) | |
537 | (lua-version ,(version-major+minor (package-version lua))) | |
538 | (destination (string-append (assoc-ref %outputs "out") | |
539 | "/share/lua/" lua-version))) | |
540 | (mkdir-p destination) | |
541 | (with-directory-excursion source | |
542 | (copy-recursively "lua/" destination))) | |
543 | #t))) | |
544 | (home-page "http://tieske.github.io/Penlight/") | |
545 | (synopsis "Collection of general purpose libraries for the Lua language") | |
546 | (description "Penlight is a set of pure Lua libraries focusing on | |
547 | input data handling (such as reading configuration files), functional | |
548 | programming (such as map, reduce, placeholder expressions,etc), and OS | |
549 | path management. Much of the functionality is inspired by the Python | |
550 | standard libraries.") | |
551 | (license license:expat))) | |
552 | ||
4898e06a NG |
553 | (define-public lua-ldoc |
554 | (package | |
555 | (name "lua-ldoc") | |
556 | (version "1.4.6") | |
557 | (source | |
558 | (origin | |
559 | (method git-fetch) | |
560 | (uri (git-reference | |
b0e7b699 | 561 | (url "https://github.com/stevedonovan/LDoc") |
4898e06a NG |
562 | (commit version))) |
563 | (file-name (git-file-name name version)) | |
564 | (sha256 | |
565 | (base32 "1h0cf7bp4am54r0j8lhjs2l1c7q5vz74ba0jvw9qdbaqimls46g8")))) | |
566 | (build-system gnu-build-system) | |
567 | (inputs | |
568 | `(("lua" ,lua))) | |
569 | (propagated-inputs | |
570 | `(("lua-penlight" ,lua-penlight))) | |
571 | (arguments | |
572 | `(#:tests? #f ;tests must run after installation. | |
573 | #:phases | |
574 | (modify-phases %standard-phases | |
575 | (add-after 'unpack 'fix-installation-directory | |
576 | (lambda* (#:key outputs #:allow-other-keys) | |
577 | (let ((out (assoc-ref outputs "out")) | |
578 | (lua-version ,(version-major+minor (package-version lua)))) | |
579 | (substitute* "makefile" | |
580 | (("LUA=.*") "#\n") | |
581 | (("(LUA_PREFIX=).*" _ prefix) | |
582 | (string-append prefix out "\n")) | |
583 | (("(LUA_BINDIR=).*" _ prefix) | |
584 | (string-append prefix out "/bin\n")) | |
585 | (("(LUA_SHAREDIR=).*" _ prefix) | |
586 | (string-append prefix out "/share/lua/" lua-version "\n")))) | |
587 | #t)) | |
588 | (delete 'configure) | |
589 | (add-before 'install 'create-bin-directory | |
590 | (lambda* (#:key outputs #:allow-other-keys) | |
591 | (mkdir-p (string-append (assoc-ref outputs "out") "/bin")) | |
592 | #t))))) | |
593 | (home-page "http://stevedonovan.github.io/ldoc/") | |
594 | (synopsis "Lua documentation generator") | |
595 | (description | |
596 | "LDoc is a LuaDoc-compatible documentation generation system for | |
597 | Lua source code. It parses the declaration and documentation comments | |
598 | in a set of Lua source files and produces a set of XHTML pages | |
599 | describing the commented declarations and functions.") | |
600 | (license license:expat))) | |
601 | ||
1c58aa6f | 602 | (define (make-lua-lgi name lua) |
03d8505f | 603 | (package |
1c58aa6f | 604 | (name name) |
ad514303 | 605 | (version "0.9.2") |
03d8505f | 606 | (source |
1c58aa6f NG |
607 | (origin |
608 | (method git-fetch) | |
609 | (uri (git-reference | |
610 | (url "https://github.com/pavouk/lgi") | |
611 | (commit version))) | |
612 | (file-name (git-file-name name version)) | |
613 | (sha256 | |
614 | (base32 "03rbydnj411xpjvwsyvhwy4plm96481d7jax544mvk7apd8sd5jj")))) | |
03d8505f | 615 | (build-system gnu-build-system) |
616 | (arguments | |
1c58aa6f NG |
617 | `(#:make-flags |
618 | (list "CC=gcc" | |
619 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
03d8505f | 620 | #:phases |
621 | (modify-phases %standard-phases | |
1c58aa6f | 622 | (delete 'configure) ; no configure script |
03d8505f | 623 | (add-before 'build 'set-env |
624 | (lambda* (#:key inputs #:allow-other-keys) | |
1c58aa6f NG |
625 | ;; We need to load cairo dynamically. |
626 | (let* ((cairo (string-append (assoc-ref inputs "cairo") "/lib"))) | |
03d8505f | 627 | (setenv "LD_LIBRARY_PATH" cairo) |
628 | #t))) | |
629 | (add-before 'build 'set-lua-version | |
630 | (lambda _ | |
1c58aa6f | 631 | ;; Lua version and therefore install directories are hardcoded. |
03d8505f | 632 | (substitute* "./lgi/Makefile" |
1c58aa6f NG |
633 | (("LUA_VERSION=5.1") |
634 | (format #f | |
635 | "LUA_VERSION=~a" | |
636 | ,(version-major+minor (package-version lua))))) | |
03d8505f | 637 | #t)) |
638 | (add-before 'check 'skip-test-gtk | |
639 | (lambda _ | |
640 | ;; FIXME: Skip GTK tests: | |
641 | ;; gtk3 - can't get it to run with the xorg-server config below | |
642 | ;; and some non-gtk tests will also fail | |
643 | ;; gtk2 - lots of functions aren't implemented | |
644 | ;; We choose gtk2 as the lesser evil and simply skip the test. | |
645 | ;; Currently, awesome is the only package that uses lua-lgi but | |
646 | ;; it doesn't need or interact with GTK using lua-lgi. | |
647 | (substitute* "./tests/test.lua" | |
648 | (("'gtk.lua',") "-- 'gtk.lua',")) | |
649 | #t)) | |
650 | (add-before 'check 'start-xserver-instance | |
651 | (lambda* (#:key inputs #:allow-other-keys) | |
652 | ;; There must be a running X server during tests. | |
653 | (system (format #f "~a/bin/Xvfb :1 &" | |
654 | (assoc-ref inputs "xorg-server"))) | |
655 | (setenv "DISPLAY" ":1") | |
656 | #t))))) | |
1c58aa6f NG |
657 | (native-inputs |
658 | `(("dbus" ,dbus) ;tests use 'dbus-run-session' | |
659 | ("pkg-config" ,pkg-config))) | |
03d8505f | 660 | (inputs |
1c58aa6f | 661 | `(("cairo" ,cairo) |
03d8505f | 662 | ("glib" ,glib) |
1c58aa6f | 663 | ("gobject-introspection" ,gobject-introspection) |
c695fb76 | 664 | ("gtk" ,gtk+-2) |
03d8505f | 665 | ("libffi" ,libffi) |
1c58aa6f NG |
666 | ("lua" ,lua) |
667 | ("pango" ,pango) | |
c695fb76 | 668 | ("xorg-server" ,xorg-server))) |
03d8505f | 669 | (home-page "https://github.com/pavouk/lgi/") |
670 | (synopsis "Lua bridge to GObject based libraries") | |
671 | (description | |
1c58aa6f NG |
672 | "LGI is gobject-introspection based dynamic Lua binding to GObject based |
673 | libraries. It allows using GObject-based libraries directly from Lua. | |
03d8505f | 674 | Notable examples are GTK+, GStreamer and Webkit.") |
675 | (license license:expat))) | |
35cdc267 | 676 | |
1c58aa6f NG |
677 | (define-public lua-lgi |
678 | (make-lua-lgi "lua-lgi" lua)) | |
679 | ||
680 | (define-public lua5.1-lgi | |
681 | (make-lua-lgi "lua5.1-lgi" lua-5.1)) | |
682 | ||
683 | (define-public lua5.2-lgi | |
684 | (make-lua-lgi "lua5.2-lgi" lua-5.2)) | |
685 | ||
149b2c43 | 686 | (define (make-lua-lpeg name lua) |
35cdc267 | 687 | (package |
149b2c43 | 688 | (name name) |
e3545ffc | 689 | (version "1.0.2") |
35cdc267 JMSG |
690 | (source (origin |
691 | (method url-fetch) | |
692 | (uri (string-append "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-" | |
693 | version ".tar.gz")) | |
694 | (sha256 | |
e3545ffc | 695 | (base32 "1zjzl7acvcdavmcg5l7wi12jd4rh95q9pl5aiww7hv0v0mv6bmj8")))) |
35cdc267 JMSG |
696 | (build-system gnu-build-system) |
697 | (arguments | |
698 | `(#:phases | |
699 | (modify-phases %standard-phases | |
700 | (delete 'configure) | |
701 | ;; `make install` isn't available, so we have to do it manually | |
702 | (replace 'install | |
703 | (lambda* (#:key outputs #:allow-other-keys) | |
704 | (let ((out (assoc-ref outputs "out")) | |
705 | (lua-version ,(version-major+minor (package-version lua)))) | |
706 | (install-file "lpeg.so" | |
707 | (string-append out "/lib/lua/" lua-version)) | |
708 | (install-file "re.lua" | |
709 | (string-append out "/share/lua/" lua-version)) | |
710 | #t)))) | |
711 | #:test-target "test")) | |
c695fb76 | 712 | (inputs `(("lua" ,lua))) |
35cdc267 JMSG |
713 | (synopsis "Pattern-matching library for Lua") |
714 | (description | |
715 | "LPeg is a pattern-matching library for Lua, based on Parsing Expression | |
716 | Grammars (PEGs).") | |
717 | (home-page "http://www.inf.puc-rio.br/~roberto/lpeg") | |
718 | (license license:expat))) | |
cf9a788d | 719 | |
149b2c43 CL |
720 | (define-public lua-lpeg |
721 | (make-lua-lpeg "lua-lpeg" lua)) | |
722 | ||
01a0a0c4 H |
723 | (define-public lua5.1-lpeg |
724 | (make-lua-lpeg "lua5.1-lpeg" lua-5.1)) | |
725 | ||
d9ed1779 | 726 | (define-public lua5.2-lpeg |
149b2c43 | 727 | (make-lua-lpeg "lua5.2-lpeg" lua-5.2)) |
d9ed1779 | 728 | |
9ad3d679 RW |
729 | (define (make-lua-luv name lua) |
730 | (package | |
731 | (name name) | |
251ce98c | 732 | (version "1.32.0-0") |
9ad3d679 RW |
733 | (source (origin |
734 | ;; The release tarball includes the sources of libuv but does | |
735 | ;; not include the pkg-config files. | |
736 | (method git-fetch) | |
737 | (uri (git-reference | |
b0e7b699 | 738 | (url "https://github.com/luvit/luv") |
9ad3d679 RW |
739 | (commit version))) |
740 | (file-name (git-file-name name version)) | |
741 | (sha256 | |
742 | (base32 | |
251ce98c | 743 | "0c65c1lhbl0axnyks3910gjs0z0hw7w6jvl07g8kbpnbvfl4qajh")))) |
9ad3d679 RW |
744 | (build-system cmake-build-system) |
745 | (arguments | |
5327fbb3 | 746 | `(#:tests? #f ; there are none |
9ad3d679 RW |
747 | #:configure-flags |
748 | '("-DWITH_LUA_ENGINE=Lua" | |
749 | "-DWITH_SHARED_LIBUV=On" | |
750 | "-DBUILD_MODULE=Off" | |
751 | "-DBUILD_SHARED_LIBS=On" | |
752 | "-DLUA_BUILD_TYPE=System") | |
753 | #:phases | |
754 | (modify-phases %standard-phases | |
755 | (add-after 'unpack 'copy-lua-compat | |
756 | (lambda* (#:key inputs #:allow-other-keys) | |
757 | (copy-recursively (assoc-ref inputs "lua-compat") | |
758 | "lua-compat") | |
759 | (setenv "CPATH" | |
760 | (string-append (getcwd) "/lua-compat:" | |
761 | (or (getenv "CPATH") ""))) | |
762 | #t))))) | |
763 | (inputs | |
764 | `(("lua" ,lua) | |
765 | ("libuv" ,libuv))) | |
766 | (native-inputs | |
767 | `(("lua-compat" | |
768 | ,(origin | |
769 | (method git-fetch) | |
770 | (uri (git-reference | |
b0e7b699 | 771 | (url "https://github.com/keplerproject/lua-compat-5.3") |
9ad3d679 RW |
772 | (commit "daebe77a2f498817713df37f0bb316db1d82222f"))) |
773 | (file-name "lua-compat-5.3-checkout") | |
774 | (sha256 | |
775 | (base32 | |
776 | "02a14nvn7aggg1yikj9h3dcf8aqjbxlws1bfvqbpfxv9d5phnrpz")))))) | |
777 | (home-page "https://github.com/luvit/luv/") | |
778 | (synopsis "Libuv bindings for Lua") | |
779 | (description | |
780 | "This library makes libuv available to Lua scripts.") | |
781 | (license license:asl2.0))) | |
782 | ||
783 | (define-public lua-luv | |
784 | (make-lua-luv "lua-luv" lua)) | |
785 | ||
786 | (define-public lua5.1-luv | |
787 | (make-lua-luv "lua5.1-luv" lua-5.1)) | |
788 | ||
789 | (define-public lua5.2-luv | |
790 | (make-lua-luv "lua5.2-luv" lua-5.2)) | |
791 | ||
cf9a788d | 792 | ;; Lua 5.3 is not supported. |
cb31a524 | 793 | (define (make-lua-bitop name lua) |
cf9a788d | 794 | (package |
cb31a524 | 795 | (name name) |
cf9a788d RW |
796 | (version "1.0.2") |
797 | (source (origin | |
798 | (method url-fetch) | |
799 | (uri (string-append "http://bitop.luajit.org/download/" | |
800 | "LuaBitOp-" version ".tar.gz")) | |
801 | (sha256 | |
802 | (base32 | |
803 | "16fffbrgfcw40kskh2bn9q7m3gajffwd2f35rafynlnd7llwj1qj")))) | |
804 | (build-system gnu-build-system) | |
805 | (arguments | |
806 | `(#:test-target "test" | |
807 | #:make-flags | |
808 | (list "INSTALL=install -pD" | |
809 | (string-append "INSTALLPATH=printf " | |
810 | (assoc-ref %outputs "out") | |
811 | "/lib/lua/" | |
cb31a524 | 812 | ,(version-major+minor (package-version lua)) |
cf9a788d RW |
813 | "/bit/bit.so")) |
814 | #:phases | |
815 | (modify-phases %standard-phases | |
816 | (delete 'configure)))) | |
c695fb76 | 817 | (inputs `(("lua" ,lua))) |
0386cdd3 | 818 | (home-page "https://bitop.luajit.org/index.html") |
cf9a788d RW |
819 | (synopsis "Bitwise operations on numbers for Lua") |
820 | (description | |
821 | "Lua BitOp is a C extension module for Lua which adds bitwise operations | |
822 | on numbers.") | |
823 | (license license:expat))) | |
cb31a524 CL |
824 | |
825 | (define-public lua5.2-bitop | |
826 | (make-lua-bitop "lua5.2-bitop" lua-5.2)) | |
827 | ||
828 | (define-public lua5.1-bitop | |
829 | (make-lua-bitop "lua5.1-bitop" lua-5.1)) | |
ce577655 FT |
830 | |
831 | (define-public selene | |
832 | (package | |
833 | (name "selene") | |
834 | (version "2017.08.25") | |
835 | (source (origin | |
836 | (method git-fetch) | |
837 | (uri (git-reference | |
b0e7b699 | 838 | (url "https://github.com/jeremyong/Selene") |
ce577655 FT |
839 | ;; The release is quite old. |
840 | (commit "ffe1ade2568d4cff5894552be8f43e63e379a4c9"))) | |
841 | (file-name "Selene") | |
842 | (sha256 | |
843 | (base32 | |
844 | "1axrgv3rxxdsaf807lwvklfzicn6x6gpf35narllrnz9lg6hn508")))) | |
845 | (build-system cmake-build-system) | |
846 | (arguments | |
847 | `(#:configure-flags | |
848 | ;; lua pc file in CMakeLists.txt is lua5.3.pc | |
849 | '("-DLUA_PC_CFG=lua;lua-5.3;lua-5.1") | |
850 | #:test-target "all" | |
851 | #:phases | |
852 | ;; This is a header only library | |
853 | (modify-phases %standard-phases | |
854 | (delete 'build) | |
855 | (replace 'install | |
856 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
857 | (let* ((output (assoc-ref outputs "out")) | |
858 | (source (assoc-ref inputs "source")) | |
859 | (includedir (string-append output "/include"))) | |
860 | (copy-recursively | |
861 | (string-append source "/include") | |
862 | includedir)) | |
863 | #t)) | |
864 | ;; The path of test files are hard coded. | |
865 | (replace 'check | |
866 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
867 | (let* ((output (assoc-ref outputs "out")) | |
868 | (source (assoc-ref inputs "source")) | |
869 | (builddir (getcwd)) | |
870 | (testdir (string-append builddir "/test"))) | |
871 | (copy-recursively (string-append source "/test") testdir) | |
872 | (invoke "make") | |
873 | (mkdir-p "runner") | |
874 | (copy-file "./test_runner" "./runner/test_runner") | |
875 | (chdir "./runner") | |
876 | (invoke "./test_runner"))))))) | |
877 | (native-inputs | |
878 | `(("lua" ,lua) | |
879 | ("pkg-config" ,pkg-config))) | |
880 | (home-page "https://github.com/jeremyong/Selene") | |
881 | (synopsis "Lua C++11 bindings") | |
882 | (description | |
883 | "Selene is a simple C++11 header-only library enabling seamless | |
884 | interoperability between C++ and Lua programming language.") | |
885 | (license license:zlib))) | |
cb53c59d OP |
886 | |
887 | (define-public lua-resty-core | |
888 | (package | |
889 | (name "lua-resty-core") | |
9c3a29e3 | 890 | (version "0.1.18") |
cb53c59d OP |
891 | (source (origin |
892 | (method git-fetch) | |
893 | (uri (git-reference | |
894 | (url "https://github.com/openresty/lua-resty-core") | |
895 | (commit (string-append "v" version)))) | |
896 | (file-name (git-file-name name version)) | |
897 | (sha256 | |
898 | (base32 | |
9c3a29e3 | 899 | "1c58hykwpg5zqbyhrcb703pzwbkih409v3bh2gady6z2kj9q32dw")))) |
cb53c59d OP |
900 | (build-system trivial-build-system) |
901 | (arguments | |
902 | `(#:modules ((guix build utils)) | |
903 | #:builder | |
904 | (begin | |
905 | (use-modules (guix build utils)) | |
906 | (let* ((luajit-major+minor ,(version-major+minor (package-version lua))) | |
907 | (package-lua-resty (lambda (input output) | |
908 | (mkdir-p (string-append output "/lib/lua")) | |
909 | (copy-recursively (string-append input "/lib/resty") | |
910 | (string-append output "/lib/lua/resty")) | |
911 | (copy-recursively (string-append input "/lib/ngx") | |
912 | (string-append output "/lib/ngx")) | |
913 | (symlink (string-append output "/lib/lua/resty") | |
914 | (string-append output "/lib/resty"))))) | |
915 | (package-lua-resty (assoc-ref %build-inputs "source") | |
916 | (assoc-ref %outputs "out"))) | |
917 | #t))) | |
918 | (home-page "https://github.com/openresty/lua-resty-core") | |
919 | (synopsis "Lua API for NGINX") | |
920 | (description "This package provides a FFI-based Lua API for | |
921 | @code{ngx_http_lua_module} or @code{ngx_stream_lua_module}.") | |
922 | (license license:bsd-2))) | |
1263bd0d OP |
923 | |
924 | (define-public lua-resty-lrucache | |
925 | (package | |
926 | (name "lua-resty-lrucache") | |
e0c34c1a | 927 | (version "0.10") |
1263bd0d OP |
928 | (source (origin |
929 | (method git-fetch) | |
930 | (uri (git-reference | |
931 | (url "https://github.com/openresty/lua-resty-lrucache") | |
932 | (commit (string-append "v" version)))) | |
933 | (file-name (git-file-name name version)) | |
934 | (sha256 | |
935 | (base32 | |
e0c34c1a | 936 | "1bsc54v1rvxmkwg7a2c01p192lvw5g576f589is8fy1m1c6v4ap8")))) |
1263bd0d OP |
937 | (build-system trivial-build-system) |
938 | (arguments | |
939 | `(#:modules ((guix build utils)) | |
940 | #:builder | |
941 | (begin | |
942 | (use-modules (guix build utils)) | |
943 | (let* ((luajit-major+minor ,(version-major+minor (package-version lua))) | |
944 | (package-lua-resty (lambda (input output) | |
945 | (mkdir-p (string-append output "/lib/lua/" luajit-major+minor)) | |
946 | (copy-recursively (string-append input "/lib/resty") | |
947 | (string-append output "/lib/lua/" luajit-major+minor "/resty")) | |
948 | (symlink (string-append output "/lib/lua/" luajit-major+minor "/resty") | |
949 | (string-append output "/lib/resty"))))) | |
950 | (package-lua-resty (assoc-ref %build-inputs "source") | |
951 | (assoc-ref %outputs "out"))) | |
952 | #t))) | |
953 | (home-page "https://github.com/openresty/lua-resty-lrucache") | |
954 | (synopsis "Lua LRU cache based on the LuaJIT FFI") | |
955 | (description | |
956 | "This package provides Lua LRU cache based on the LuaJIT FFI.") | |
957 | (license license:bsd-2))) | |
8688fd8f OP |
958 | |
959 | (define-public lua-resty-signal | |
960 | (package | |
961 | (name "lua-resty-signal") | |
962 | (version "0.02") | |
963 | (source (origin | |
964 | (method git-fetch) | |
965 | (uri (git-reference | |
966 | (url "https://github.com/openresty/lua-resty-signal") | |
967 | (commit (string-append "v" version)))) | |
968 | (file-name (git-file-name name version)) | |
969 | (sha256 | |
970 | (base32 | |
971 | "13y1pqn45y49mhqwywasfdsid46d0c33yi6mrnracbnmvyxz1cif")))) | |
972 | (build-system gnu-build-system) | |
973 | (arguments | |
974 | `(#:tests? #f ;TODO: Run the test suite. | |
975 | #:make-flags (list "CC=gcc" | |
976 | (string-append "PREFIX=" %output)) | |
977 | #:phases | |
978 | (modify-phases %standard-phases | |
979 | (delete 'configure) | |
980 | (add-after 'install 'install-lua | |
981 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
982 | (use-modules (guix build utils)) | |
983 | (let* ((luajit-major+minor ,(version-major+minor (package-version lua))) | |
984 | (package-lua-resty (lambda (input output) | |
985 | (mkdir-p (string-append output "/lib/lua/" luajit-major+minor)) | |
986 | (copy-recursively (string-append input "/lib/resty") | |
987 | (string-append output "/lib/lua/" luajit-major+minor "/resty")) | |
988 | (symlink (string-append output "/lib/lua/" luajit-major+minor "/resty") | |
989 | (string-append output "/lib/resty"))))) | |
990 | (package-lua-resty (assoc-ref inputs "source") | |
991 | (assoc-ref outputs "out"))) | |
992 | #t))))) | |
993 | (home-page "https://github.com/openresty/lua-resty-signal") | |
994 | (synopsis "Lua library for killing or sending signals to Linux processes") | |
995 | (description "This package provides Lua library for killing or sending | |
996 | signals to Linux processes.") | |
997 | (license license:bsd-3))) | |
0100fd06 OP |
998 | |
999 | (define-public lua-tablepool | |
1000 | (package | |
1001 | (name "lua-tablepool") | |
1002 | (version "0.01") | |
1003 | (source (origin | |
1004 | (method git-fetch) | |
1005 | (uri (git-reference | |
1006 | (url "https://github.com/openresty/lua-tablepool") | |
1007 | (commit (string-append "v" version)))) | |
1008 | (file-name (git-file-name name version)) | |
1009 | (sha256 | |
1010 | (base32 | |
1011 | "03yjj3w6znvj6843prg84m0lkrn49l901f9hj9bgy3cj9s0awl6y")))) | |
1012 | (build-system trivial-build-system) | |
1013 | (arguments | |
1014 | `(#:modules ((guix build utils)) | |
1015 | #:builder | |
1016 | (begin | |
1017 | (use-modules (guix build utils)) | |
1018 | (let* ((luajit-major+minor ,(version-major+minor (package-version lua))) | |
1019 | (package-lua-resty (lambda (input output) | |
1020 | (mkdir-p (string-append output "/lib/lua/" luajit-major+minor)) | |
1021 | (copy-recursively (string-append input "/lib") | |
1022 | (string-append output "/lib"))))) | |
1023 | (package-lua-resty (assoc-ref %build-inputs "source") | |
1024 | (assoc-ref %outputs "out"))) | |
1025 | #t))) | |
1026 | (home-page "https://github.com/openresty/lua-tablepool") | |
1027 | (synopsis "Lua table recycling pools for LuaJIT") | |
1028 | (description "This package provides Lua table recycling pools for LuaJIT.") | |
1029 | (license license:bsd-2))) | |
89c4122e OP |
1030 | |
1031 | (define-public lua-resty-shell | |
1032 | (package | |
1033 | (name "lua-resty-shell") | |
1034 | (version "0.03") | |
1035 | (source (origin | |
1036 | (method git-fetch) | |
1037 | (uri (git-reference | |
1038 | (url "https://github.com/openresty/lua-resty-shell") | |
1039 | (commit (string-append "v" version)))) | |
1040 | (file-name (git-file-name name version)) | |
1041 | (sha256 | |
1042 | (base32 | |
1043 | "1s6g04ip4hr97r2pd8ry3alq063604s9a3l0hn9nsidh81ps4dp7")))) | |
1044 | (build-system trivial-build-system) | |
1045 | (arguments | |
1046 | `(#:modules ((guix build utils)) | |
1047 | #:builder | |
1048 | (begin | |
1049 | (use-modules (guix build utils)) | |
1050 | (let* ((luajit-major+minor ,(version-major+minor (package-version lua))) | |
1051 | (package-lua-resty (lambda (input output) | |
1052 | (mkdir-p (string-append output "/lib/lua/" luajit-major+minor)) | |
1053 | (copy-recursively (string-append input "/lib/resty") | |
1054 | (string-append output "/lib/lua/" luajit-major+minor "/resty")) | |
1055 | (symlink (string-append output "/lib/lua/" luajit-major+minor "/resty") | |
1056 | (string-append output "/lib/resty"))))) | |
1057 | (package-lua-resty (assoc-ref %build-inputs "source") | |
1058 | (assoc-ref %outputs "out"))) | |
1059 | #t))) | |
1060 | (home-page "https://github.com/openresty/lua-resty-shell") | |
1061 | (synopsis "Lua module for nonblocking system shell command executions") | |
1062 | (description "This package provides Lua module for nonblocking system | |
1063 | shell command executions.") | |
1064 | (license license:bsd-3))) | |
0190c9b2 PP |
1065 | |
1066 | (define-public fennel | |
1067 | (package | |
1068 | (name "fennel") | |
1069 | (version "0.7.0") | |
1070 | (source (origin | |
1071 | (method git-fetch) | |
1072 | (uri (git-reference | |
1073 | (url "https://git.sr.ht/~technomancy/fennel") | |
1074 | (commit version))) | |
1075 | (file-name (git-file-name name version)) | |
1076 | (sha256 | |
1077 | (base32 | |
1078 | "17pdcwhfw754fblppw46qphnsvxrn3b7066cz54lv8c0c12iryim")) | |
1079 | (modules '((guix build utils))) | |
1080 | (snippet | |
1081 | '(begin | |
1082 | (delete-file "fennelview.lua") #t)))) | |
1083 | (build-system gnu-build-system) | |
1084 | (arguments | |
1085 | '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
1086 | #:test-target "test" | |
1087 | #:phases | |
1088 | (modify-phases %standard-phases | |
1089 | (delete 'configure) | |
1090 | (add-after 'build 'patch-fennel | |
1091 | (lambda _ | |
1092 | (substitute* "fennel" | |
1093 | (("/usr/bin/env lua") (which "lua"))) | |
1094 | #t))))) | |
1095 | (inputs `(("lua" ,lua))) | |
1096 | (home-page "https://fennel-lang.org/") | |
1097 | (synopsis "A Lisp that compiles to Lua") | |
1098 | (description | |
1099 | "Fennel is a programming language that brings together the speed, | |
1100 | simplicity, and reach of Lua with the flexibility of a Lisp syntax and macro | |
1101 | system.") | |
1102 | (license license:expat))) |