X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/50269c0197deca710e04c9ad6b92ab8740758133..bfb22078fd3a184f60968938851ada97d7dead58:/gnu/packages/lua.scm diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 3a528599fa..be77ac4a63 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -8,6 +8,8 @@ ;;; Copyright © 2016 doncatnip ;;; Copyright © 2016, 2017 Clément Lassieur ;;; Copyright © 2016 José Miguel Sánchez García +;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2018 Fis Trivial ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,8 +30,11 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (guix build utils) #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) #:use-module (gnu packages) #:use-module (gnu packages readline) #:use-module (gnu packages tls) @@ -43,13 +48,13 @@ (define-public lua (package (name "lua") - (version "5.3.4") + (version "5.3.5") (source (origin (method url-fetch) (uri (string-append "https://www.lua.org/ftp/lua-" version ".tar.gz")) (sha256 - (base32 "0320a8dg3aci4hxla380dx1ifkw8gj4gbw5c4dz41g1kh98sm0gn")) + (base32 "1b2qn2rv96nmbm6zab4l877bd4zq7wpwm8drwjiy2ih4jqzysbhc")) (patches (search-patches "lua-pkgconfig.patch" "lua-liblua-so.patch")))) (build-system gnu-build-system) @@ -68,10 +73,10 @@ (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - (zero? (system* "make" "install" - (string-append "INSTALL_TOP=" out) - (string-append "INSTALL_MAN=" out - "/share/man/man1"))))))))) + (invoke "make" "install" + (string-append "INSTALL_TOP=" out) + (string-append "INSTALL_MAN=" out + "/share/man/man1")))))))) (home-page "https://www.lua.org/") (synopsis "Embeddable scripting language") (description @@ -112,21 +117,30 @@ for configuration, scripting, and rapid prototyping.") (define-public luajit (package (name "luajit") - (version "2.1.0-beta2") + (version "2.1.0-beta3") (source (origin (method url-fetch) (uri (string-append "http://luajit.org/download/LuaJIT-" version ".tar.gz")) (sha256 - (base32 "0iyghj1xjlmd9ywa4flf9yszynf3jhbp0yqb9b49k7ab0g528fbi")) - (patches (search-patches "luajit-symlinks.patch" - "luajit-no_ldconfig.patch")))) + (base32 "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs")) + (patches (search-patches "luajit-no_ldconfig.patch")))) (build-system gnu-build-system) (arguments - '(#:tests? #f ;luajit is distributed without tests - #:phases (modify-phases %standard-phases (delete 'configure)) - #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))))) - (home-page "http://www.luajit.org/") + `(#:tests? #f ; luajit is distributed without tests + #:phases + (modify-phases %standard-phases + (delete 'configure) ; no configure script + (add-after 'install 'create-luajit-symlink + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (with-directory-excursion bin + (symlink ,(string-append name "-" version) + ,name) + #t))))) + #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))))) + (home-page "https://www.luajit.org/") (synopsis "Just in time compiler for Lua programming language version 5.1") (description "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua @@ -160,8 +174,8 @@ language.") (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")))))))) + (invoke "lua" "tests/test.lua") + (invoke "lua" "tests/test-lom.lua")))))) (inputs `(("lua" ,lua-5.1) ("expat" ,expat))) @@ -179,6 +193,7 @@ language.") (uri (string-append "https://github.com/diegonehab/luasocket/archive/v" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "0j8jx8bjicvp9khs26xjya8c495wrpb7parxfnabdqa5nnsxjrwb")))) @@ -195,8 +210,8 @@ language.") (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"))))))) + (invoke "lua" "test/testsrvr.lua")) + (invoke "lua" "test/testclnt.lua")))))) (inputs `(("lua" ,lua-5.1))) (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/") @@ -285,7 +300,7 @@ secure session between the peers.") (define-public lua-lgi (package (name "lua-lgi") - (version "0.9.1") + (version "0.9.2") (source (origin (method url-fetch) @@ -295,7 +310,7 @@ secure session between the peers.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1fmgdl5y4ph3yc6ycg865s3vai1rjkyda61cgqxk6zd13hmznw0c")))) + "0kwcaj3ahi9gxfyp0lr5zgr6vi1mgsg9sz0980x0nwxlh9a11i6g")))) (build-system gnu-build-system) (arguments '(#:make-flags (list "CC=gcc" @@ -339,14 +354,15 @@ secure session between the peers.") (inputs `(("gobject-introspection" ,gobject-introspection) ("glib" ,glib) - ("pango", pango) - ("gtk", gtk+-2) + ("pango" ,pango) + ("gtk" ,gtk+-2) ("lua" ,lua) ("cairo" ,cairo) ("libffi" ,libffi) - ("xorg-server", xorg-server))) + ("xorg-server" ,xorg-server))) (native-inputs - `(("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config) + ("dbus" ,dbus))) ;tests use 'dbus-run-session' (home-page "https://github.com/pavouk/lgi/") (synopsis "Lua bridge to GObject based libraries") (description @@ -381,7 +397,7 @@ Notable examples are GTK+, GStreamer and Webkit.") (string-append out "/share/lua/" lua-version)) #t)))) #:test-target "test")) - (inputs `(("lua", lua))) + (inputs `(("lua" ,lua))) (synopsis "Pattern-matching library for Lua") (description "LPeg is a pattern-matching library for Lua, based on Parsing Expression @@ -420,8 +436,8 @@ Grammars (PEGs).") #:phases (modify-phases %standard-phases (delete 'configure)))) - (inputs `(("lua", lua))) - (home-page "http://bitop.luajit.org/index.html") + (inputs `(("lua" ,lua))) + (home-page "https://bitop.luajit.org/index.html") (synopsis "Bitwise operations on numbers for Lua") (description "Lua BitOp is a C extension module for Lua which adds bitwise operations @@ -433,3 +449,59 @@ on numbers.") (define-public lua5.1-bitop (make-lua-bitop "lua5.1-bitop" lua-5.1)) + +(define-public selene + (package + (name "selene") + (version "2017.08.25") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeremyong/Selene.git") + ;; The release is quite old. + (commit "ffe1ade2568d4cff5894552be8f43e63e379a4c9"))) + (file-name "Selene") + (sha256 + (base32 + "1axrgv3rxxdsaf807lwvklfzicn6x6gpf35narllrnz9lg6hn508")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + ;; lua pc file in CMakeLists.txt is lua5.3.pc + '("-DLUA_PC_CFG=lua;lua-5.3;lua-5.1") + #:test-target "all" + #:phases + ;; This is a header only library + (modify-phases %standard-phases + (delete 'build) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((output (assoc-ref outputs "out")) + (source (assoc-ref inputs "source")) + (includedir (string-append output "/include"))) + (copy-recursively + (string-append source "/include") + includedir)) + #t)) + ;; The path of test files are hard coded. + (replace 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((output (assoc-ref outputs "out")) + (source (assoc-ref inputs "source")) + (builddir (getcwd)) + (testdir (string-append builddir "/test"))) + (copy-recursively (string-append source "/test") testdir) + (invoke "make") + (mkdir-p "runner") + (copy-file "./test_runner" "./runner/test_runner") + (chdir "./runner") + (invoke "./test_runner"))))))) + (native-inputs + `(("lua" ,lua) + ("pkg-config" ,pkg-config))) + (home-page "https://github.com/jeremyong/Selene") + (synopsis "Lua C++11 bindings") + (description + "Selene is a simple C++11 header-only library enabling seamless + interoperability between C++ and Lua programming language.") + (license license:zlib)))