From 9ad3d6798170729eb49821e587c865a457c619a5 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 16 Sep 2019 12:24:48 +0200 Subject: gnu: Add lua-luv. * gnu/packages/lua.scm (lua-luv, lua5.1-luv, lua5.2-luv): New variables. (make-lua-luv): New procedure. --- gnu/packages/lua.scm | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) (limited to 'gnu/packages/lua.scm') diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index ff62d3b362..075decc61a 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2014 Andreas Enge ;;; Copyright © 2016, 2017 Efraim Flashner -;;; Copyright © 2016 Ricardo Wurmus +;;; Copyright © 2016, 2019 Ricardo Wurmus ;;; Copyright © 2016 doncatnip ;;; Copyright © 2016, 2017, 2019 Clément Lassieur ;;; Copyright © 2016 José Miguel Sánchez García @@ -39,6 +39,7 @@ #:use-module (gnu packages tls) #:use-module (gnu packages xml) #:use-module (gnu packages glib) + #:use-module (gnu packages libevent) #:use-module (gnu packages libffi) #:use-module (gnu packages pkg-config) #:use-module (gnu packages xorg) @@ -450,6 +451,69 @@ Grammars (PEGs).") (define-public lua5.2-lpeg (make-lua-lpeg "lua5.2-lpeg" lua-5.2)) +(define (make-lua-luv name lua) + (package + (name name) + (version "1.30.1-0") + (source (origin + ;; The release tarball includes the sources of libuv but does + ;; not include the pkg-config files. + (method git-fetch) + (uri (git-reference + (url "https://github.com/luvit/luv.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1lfzzyphpim28kw33k7zylcyxnf40ckhdg6hbqyzb5hszdf2hbka")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; there are none + #:configure-flags + '("-DWITH_LUA_ENGINE=Lua" + "-DWITH_SHARED_LIBUV=On" + "-DBUILD_MODULE=Off" + "-DBUILD_SHARED_LIBS=On" + "-DLUA_BUILD_TYPE=System") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'copy-lua-compat + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "lua-compat") + "lua-compat") + (setenv "CPATH" + (string-append (getcwd) "/lua-compat:" + (or (getenv "CPATH") ""))) + #t))))) + (inputs + `(("lua" ,lua) + ("libuv" ,libuv))) + (native-inputs + `(("lua-compat" + ,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/keplerproject/lua-compat-5.3.git") + (commit "daebe77a2f498817713df37f0bb316db1d82222f"))) + (file-name "lua-compat-5.3-checkout") + (sha256 + (base32 + "02a14nvn7aggg1yikj9h3dcf8aqjbxlws1bfvqbpfxv9d5phnrpz")))))) + (home-page "https://github.com/luvit/luv/") + (synopsis "Libuv bindings for Lua") + (description + "This library makes libuv available to Lua scripts.") + (license license:asl2.0))) + +(define-public lua-luv + (make-lua-luv "lua-luv" lua)) + +(define-public lua5.1-luv + (make-lua-luv "lua5.1-luv" lua-5.1)) + +(define-public lua5.2-luv + (make-lua-luv "lua5.2-luv" lua-5.2)) + ;; Lua 5.3 is not supported. (define (make-lua-bitop name lua) (package -- cgit v1.2.3