aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/lua.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/lua.scm')
-rw-r--r--gnu/packages/lua.scm168
1 files changed, 160 insertions, 8 deletions
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index b4b5dee8be..8bd67c594d 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -21,12 +22,14 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages lua)
- #:use-module (guix licenses)
+ #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
- #:use-module (gnu packages readline))
+ #:use-module (gnu packages readline)
+ #:use-module (gnu packages tls)
+ #:use-module (gnu packages xml))
(define-public lua
(package
@@ -44,14 +47,15 @@
(inputs `(("readline" ,readline)))
(arguments
'(#:modules ((guix build gnu-build-system)
- (guix build utils)
- (srfi srfi-1))
+ (guix build utils)
+ (srfi srfi-1))
#:test-target "test"
+ #:make-flags
+ '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX"
+ "linux")
#:phases
(modify-phases %standard-phases
(delete 'configure)
- (replace 'build
- (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
@@ -68,7 +72,7 @@ based on associative arrays and extensible semantics. Lua is dynamically typed,
runs by interpreting bytecode for a register-based virtual machine, and has
automatic memory management with incremental garbage collection, making it ideal
for configuration, scripting, and rapid prototyping.")
- (license x11)))
+ (license license:x11)))
(define-public lua-5.1
(package (inherit lua)
@@ -106,4 +110,152 @@ for configuration, scripting, and rapid prototyping.")
programming language. Lua is a powerful, dynamic and light-weight programming
language. It may be embedded or used as a general-purpose, stand-alone
language.")
- (license x11)))
+ (license license:x11)))
+
+(define-public lua5.1-expat
+ (package
+ (name "lua5.1-expat")
+ (version "1.3.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://matthewwild.co.uk/projects/"
+ "luaexpat/luaexpat-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list "CC=gcc"
+ (string-append "LUA_LDIR=" out "/share/lua/$(LUA_V)")
+ (string-append "LUA_CDIR=" out "/lib/lua/$(LUA_V)")))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'check
+ (lambda _
+ (setenv "LUA_CPATH" "src/?.so;;")
+ (setenv "LUA_PATH" "src/?.lua;;")
+ (and (zero? (system* "lua" "tests/test.lua"))
+ (zero? (system* "lua" "tests/test-lom.lua"))))))))
+ (inputs
+ `(("lua" ,lua-5.1)
+ ("expat" ,expat)))
+ (home-page "http://matthewwild.co.uk/projects/luaexpat/")
+ (synopsis "SAX XML parser based on the Expat library")
+ (description "LuaExpat is a SAX XML parser based on the Expat library.")
+ (license (package-license lua-5.1))))
+
+(define-public lua5.1-socket
+ (package
+ (name "lua5.1-socket")
+ (version "2.0.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://files.luaforge.net/releases/"
+ "luasocket/luasocket/luasocket-"
+ version "/luasocket-" version ".tar.gz"))
+ (sha256
+ (base32
+ "19ichkbc4rxv00ggz8gyf29jibvc2wq9pqjik0ll326rrxswgnag"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list (string-append "INSTALL_TOP_SHARE=" out "/share/lua/5.1")
+ (string-append "INSTALL_TOP_LIB=" out "/lib/lua/5.1")))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'check
+ (lambda _
+ (setenv "LUA_CPATH" (string-append "src/?.so." ,version ";;"))
+ (setenv "LUA_PATH" "src/?.lua;;")
+ (when (zero? (primitive-fork))
+ (system* "lua" "test/testsrvr.lua"))
+ (zero? (system* "lua" "test/testclnt.lua")))))))
+ (inputs
+ `(("lua" ,lua-5.1)))
+ (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/")
+ (synopsis "Socket library for Lua")
+ (description "LuaSocket is a Lua extension library that is composed by two
+parts: a C core that provides support for the TCP and UDP transport layers,
+and a set of Lua modules that add support for functionality commonly needed by
+applications that deal with the Internet.
+
+Among the supported modules, the most commonly used implement the
+SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading
+files) client protocols. These provide a very natural and generic interface
+to the functionality defined by each protocol. In addition, you will find
+that the MIME (common encodings), URL (anything you could possible want to do
+with one) and LTN12 (filters, sinks, sources and pumps) modules can be very
+handy.")
+ (license (package-license lua-5.1))))
+
+(define-public lua5.1-filesystem
+ (package
+ (name "lua5.1-filesystem")
+ (version "1.6.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/keplerproject/"
+ "luafilesystem/archive/v_"
+ "1_6_3" ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0s10ckxin0bysd6gaywqhxkpw3ybjhprr8m655b8cx3pxjwd49am"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+ #:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (inputs
+ `(("lua" ,lua-5.1)))
+ (home-page "https://keplerproject.github.io/luafilesystem/index.html")
+ (synopsis "File system library for Lua")
+ (description "LuaFileSystem is a Lua library developed to complement the
+set of functions related to file systems offered by the standard Lua
+distribution. LuaFileSystem offers a portable way to access the underlying
+directory structure and file attributes.")
+ (license (package-license lua-5.1))))
+
+(define-public lua5.1-sec
+ (package
+ (name "lua5.1-sec")
+ (version "0.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/brunoos/luasec/archive/"
+ "luasec-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0pgd1anzznl4s0h16wg8dlw9mgdb9h52drlcki6sbf5y31fa7wyf"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list "linux"
+ "CC=gcc"
+ "LD=gcc"
+ (string-append "LUAPATH=" out "/share/lua/5.1")
+ (string-append "LUACPATH=" out "/lib/lua/5.1")))
+ #:tests? #f ; no tests included
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (inputs
+ `(("lua" ,lua-5.1)
+ ("openssl" ,openssl)))
+ (propagated-inputs
+ `(("lua-socket" ,lua5.1-socket)))
+ (home-page "https://github.com/brunoos/luasec/wiki")
+ (synopsis "OpenSSL bindings for Lua")
+ (description "LuaSec is a binding for OpenSSL library to provide TLS/SSL
+communication. It takes an already established TCP connection and creates a
+secure session between the peers.")
+ (license (package-license lua-5.1))))