| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 |
|
| 29 | (define-module (gnu packages lua)
|
| 30 | #:use-module ((guix licenses) #:prefix license:)
|
| 31 | #:use-module (guix packages)
|
| 32 | #:use-module (guix download)
|
| 33 | #:use-module (guix git-download)
|
| 34 | #:use-module (guix utils)
|
| 35 | #:use-module (guix build-system gnu)
|
| 36 | #:use-module (guix build-system cmake)
|
| 37 | #:use-module (gnu packages)
|
| 38 | #:use-module (gnu packages readline)
|
| 39 | #:use-module (gnu packages tls)
|
| 40 | #:use-module (gnu packages xml)
|
| 41 | #:use-module (gnu packages glib)
|
| 42 | #:use-module (gnu packages libevent)
|
| 43 | #:use-module (gnu packages libffi)
|
| 44 | #:use-module (gnu packages pkg-config)
|
| 45 | #:use-module (gnu packages xorg)
|
| 46 | #:use-module (gnu packages gtk))
|
| 47 |
|
| 48 | (define-public lua
|
| 49 | (package
|
| 50 | (name "lua")
|
| 51 | (version "5.3.5")
|
| 52 | (source (origin
|
| 53 | (method url-fetch)
|
| 54 | (uri (string-append "https://www.lua.org/ftp/lua-"
|
| 55 | version ".tar.gz"))
|
| 56 | (sha256
|
| 57 | (base32 "1b2qn2rv96nmbm6zab4l877bd4zq7wpwm8drwjiy2ih4jqzysbhc"))
|
| 58 | (patches (search-patches "lua-pkgconfig.patch"
|
| 59 | "lua-liblua-so.patch"))))
|
| 60 | (build-system gnu-build-system)
|
| 61 | (inputs `(("readline" ,readline)))
|
| 62 | (arguments
|
| 63 | '(#:modules ((guix build gnu-build-system)
|
| 64 | (guix build utils)
|
| 65 | (srfi srfi-1))
|
| 66 | #:test-target "test"
|
| 67 | #:make-flags
|
| 68 | '("MYCFLAGS=-fPIC -DLUA_DL_DLOPEN"
|
| 69 | "linux")
|
| 70 | #:phases
|
| 71 | (modify-phases %standard-phases
|
| 72 | (delete 'configure)
|
| 73 | (replace 'install
|
| 74 | (lambda* (#:key outputs #:allow-other-keys)
|
| 75 | (let ((out (assoc-ref outputs "out")))
|
| 76 | (invoke "make" "install"
|
| 77 | (string-append "INSTALL_TOP=" out)
|
| 78 | (string-append "INSTALL_MAN=" out
|
| 79 | "/share/man/man1"))))))))
|
| 80 | (home-page "https://www.lua.org/")
|
| 81 | (synopsis "Embeddable scripting language")
|
| 82 | (description
|
| 83 | "Lua is a powerful, fast, lightweight, embeddable scripting language. Lua
|
| 84 | combines simple procedural syntax with powerful data description constructs
|
| 85 | based on associative arrays and extensible semantics. Lua is dynamically typed,
|
| 86 | runs by interpreting bytecode for a register-based virtual machine, and has
|
| 87 | automatic memory management with incremental garbage collection, making it ideal
|
| 88 | for configuration, scripting, and rapid prototyping.")
|
| 89 | (license license:x11)))
|
| 90 |
|
| 91 | (define-public lua-5.2
|
| 92 | (package (inherit lua)
|
| 93 | (version "5.2.4")
|
| 94 | (source
|
| 95 | (origin
|
| 96 | (method url-fetch)
|
| 97 | (uri (string-append "https://www.lua.org/ftp/lua-"
|
| 98 | version ".tar.gz"))
|
| 99 | (sha256
|
| 100 | (base32 "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr"))
|
| 101 | (patches (search-patches "lua-pkgconfig.patch"
|
| 102 | "lua-liblua-so.patch"))))))
|
| 103 |
|
| 104 | (define-public lua-5.1
|
| 105 | (package (inherit lua)
|
| 106 | (version "5.1.5")
|
| 107 | (source (origin
|
| 108 | (method url-fetch)
|
| 109 | (uri (string-append "https://www.lua.org/ftp/lua-"
|
| 110 | version ".tar.gz"))
|
| 111 | (sha256
|
| 112 | (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16"))
|
| 113 | (patches (search-patches "lua51-liblua-so.patch"
|
| 114 | "lua-CVE-2014-5461.patch"
|
| 115 | "lua51-pkgconfig.patch"))))))
|
| 116 |
|
| 117 | (define-public luajit
|
| 118 | (package
|
| 119 | (name "luajit")
|
| 120 | (version "2.1.0-beta3")
|
| 121 | (source (origin
|
| 122 | (method url-fetch)
|
| 123 | (uri (string-append "http://luajit.org/download/LuaJIT-"
|
| 124 | version ".tar.gz"))
|
| 125 | (sha256
|
| 126 | (base32 "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs"))
|
| 127 | (patches (search-patches "luajit-no_ldconfig.patch"))))
|
| 128 | (build-system gnu-build-system)
|
| 129 | (arguments
|
| 130 | `(#:tests? #f |
| 131 | #:phases
|
| 132 | (modify-phases %standard-phases
|
| 133 | (delete 'configure) |
| 134 | (add-after 'install 'create-luajit-symlink
|
| 135 | (lambda* (#:key outputs #:allow-other-keys)
|
| 136 | (let* ((out (assoc-ref outputs "out"))
|
| 137 | (bin (string-append out "/bin")))
|
| 138 | (with-directory-excursion bin
|
| 139 | (symlink ,(string-append name "-" version)
|
| 140 | ,name)
|
| 141 | #t)))))
|
| 142 | #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
|
| 143 | (home-page "https://www.luajit.org/")
|
| 144 | (synopsis "Just in time compiler for Lua programming language version 5.1")
|
| 145 | (description
|
| 146 | "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua
|
| 147 | programming language. Lua is a powerful, dynamic and light-weight programming
|
| 148 | language. It may be embedded or used as a general-purpose, stand-alone
|
| 149 | language.")
|
| 150 | (license license:x11)))
|
| 151 |
|
| 152 | (define (make-lua-expat name lua)
|
| 153 | (package
|
| 154 | (name name)
|
| 155 | (version "1.3.0")
|
| 156 | (source (origin
|
| 157 | (method url-fetch)
|
| 158 | (uri (string-append "https://matthewwild.co.uk/projects/"
|
| 159 | "luaexpat/luaexpat-" version ".tar.gz"))
|
| 160 | (sha256
|
| 161 | (base32
|
| 162 | "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h"))))
|
| 163 | (build-system gnu-build-system)
|
| 164 | (arguments
|
| 165 | `(#:make-flags
|
| 166 | (let ((out (assoc-ref %outputs "out"))
|
| 167 | (lua-version ,(version-major+minor (package-version lua))))
|
| 168 | (list "CC=gcc"
|
| 169 | (string-append "LUA_LDIR=" out "/share/lua/" lua-version)
|
| 170 | (string-append "LUA_CDIR=" out "/lib/lua/" lua-version)))
|
| 171 | #:phases
|
| 172 | (modify-phases %standard-phases
|
| 173 | (delete 'configure)
|
| 174 | (replace 'check
|
| 175 | (lambda _
|
| 176 | (setenv "LUA_CPATH" "src/?.so;;")
|
| 177 | (setenv "LUA_PATH" "src/?.lua;;")
|
| 178 | (invoke "lua" "tests/test.lua")
|
| 179 | (invoke "lua" "tests/test-lom.lua"))))))
|
| 180 | (inputs
|
| 181 | `(("lua" ,lua)
|
| 182 | ("expat" ,expat)))
|
| 183 | (home-page "http://matthewwild.co.uk/projects/luaexpat/")
|
| 184 | (synopsis "SAX XML parser based on the Expat library")
|
| 185 | (description "LuaExpat is a SAX XML parser based on the Expat library.")
|
| 186 | (license (package-license lua-5.1))))
|
| 187 |
|
| 188 | (define-public lua5.1-expat
|
| 189 | (make-lua-expat "lua5.1-expat" lua-5.1))
|
| 190 |
|
| 191 | (define-public lua5.2-expat
|
| 192 | (make-lua-expat "lua5.2-expat" lua-5.2))
|
| 193 |
|
| 194 | (define (make-lua-socket name lua)
|
| 195 | (package
|
| 196 | (name name)
|
| 197 | (version "3.0-rc1")
|
| 198 | (source (origin
|
| 199 | (method url-fetch)
|
| 200 | (uri (string-append
|
| 201 | "https://github.com/diegonehab/luasocket/archive/v"
|
| 202 | version ".tar.gz"))
|
| 203 | (file-name (string-append name "-" version ".tar.gz"))
|
| 204 | (sha256
|
| 205 | (base32
|
| 206 | "0j8jx8bjicvp9khs26xjya8c495wrpb7parxfnabdqa5nnsxjrwb"))))
|
| 207 | (build-system gnu-build-system)
|
| 208 | (arguments
|
| 209 | `(#:make-flags
|
| 210 | (let ((out (assoc-ref %outputs "out"))
|
| 211 | (lua-version ,(version-major+minor (package-version lua))))
|
| 212 | (list (string-append "INSTALL_TOP=" out)
|
| 213 | (string-append "LUAV?=" lua-version)))
|
| 214 | #:phases
|
| 215 | (modify-phases %standard-phases
|
| 216 | (delete 'configure)
|
| 217 | (replace 'check
|
| 218 | (lambda _
|
| 219 | (setenv "LUA_CPATH" (string-append "src/?.so." ,version ";;"))
|
| 220 | (setenv "LUA_PATH" "src/?.lua;;")
|
| 221 | (when (zero? (primitive-fork))
|
| 222 | (invoke "lua" "test/testsrvr.lua"))
|
| 223 | (invoke "lua" "test/testclnt.lua"))))))
|
| 224 | (inputs
|
| 225 | `(("lua" ,lua)))
|
| 226 | (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/")
|
| 227 | (synopsis "Socket library for Lua")
|
| 228 | (description "LuaSocket is a Lua extension library that is composed by two
|
| 229 | parts: a C core that provides support for the TCP and UDP transport layers,
|
| 230 | and a set of Lua modules that add support for functionality commonly needed by
|
| 231 | applications that deal with the Internet.
|
| 232 |
|
| 233 | Among the supported modules, the most commonly used implement the
|
| 234 | SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading
|
| 235 | files) client protocols. These provide a very natural and generic interface
|
| 236 | to the functionality defined by each protocol. In addition, you will find
|
| 237 | that the MIME (common encodings), URL (anything you could possible want to do
|
| 238 | with one) and LTN12 (filters, sinks, sources and pumps) modules can be very
|
| 239 | handy.")
|
| 240 | (license license:expat)))
|
| 241 |
|
| 242 | (define-public lua5.1-socket
|
| 243 | (make-lua-socket "lua5.1-socket" lua-5.1))
|
| 244 |
|
| 245 | (define-public lua5.2-socket
|
| 246 | (make-lua-socket "lua5.2-socket" lua-5.2))
|
| 247 |
|
| 248 | (define (make-lua-filesystem name lua)
|
| 249 | (package
|
| 250 | (name name)
|
| 251 | (version "1.6.3")
|
| 252 | (source (origin
|
| 253 | (method url-fetch)
|
| 254 | (uri (string-append "https://github.com/keplerproject/"
|
| 255 | "luafilesystem/archive/v_"
|
| 256 | "1_6_3" ".tar.gz"))
|
| 257 | (file-name (string-append name "-" version ".tar.gz"))
|
| 258 | (sha256
|
| 259 | (base32
|
| 260 | "0s10ckxin0bysd6gaywqhxkpw3ybjhprr8m655b8cx3pxjwd49am"))))
|
| 261 | (build-system gnu-build-system)
|
| 262 | (arguments
|
| 263 | `(#:make-flags
|
| 264 | (let ((out (assoc-ref %outputs "out"))
|
| 265 | (lua-version ,(version-major+minor (package-version lua))))
|
| 266 | (list (string-append "PREFIX=" out)
|
| 267 | (string-append "LUA_LIBDIR=" out "/lib/lua/" lua-version)))
|
| 268 | #:test-target "test"
|
| 269 | #:phases
|
| 270 | (modify-phases %standard-phases
|
| 271 | (delete 'configure))))
|
| 272 | (inputs
|
| 273 | `(("lua" ,lua)))
|
| 274 | (home-page "https://keplerproject.github.io/luafilesystem/index.html")
|
| 275 | (synopsis "File system library for Lua")
|
| 276 | (description "LuaFileSystem is a Lua library developed to complement the
|
| 277 | set of functions related to file systems offered by the standard Lua
|
| 278 | distribution. LuaFileSystem offers a portable way to access the underlying
|
| 279 | directory structure and file attributes.")
|
| 280 | (license (package-license lua-5.1))))
|
| 281 |
|
| 282 | (define-public lua-filesystem
|
| 283 | (make-lua-filesystem "lua-filesystem" lua))
|
| 284 |
|
| 285 | (define-public lua5.1-filesystem
|
| 286 | (make-lua-filesystem "lua5.1-filesystem" lua-5.1))
|
| 287 |
|
| 288 | (define-public lua5.2-filesystem
|
| 289 | (make-lua-filesystem "lua5.2-filesystem" lua-5.2))
|
| 290 |
|
| 291 | (define (make-lua-sec name lua)
|
| 292 | (package
|
| 293 | (name name)
|
| 294 | (version "0.7")
|
| 295 | (source (origin
|
| 296 | (method url-fetch)
|
| 297 | (uri (string-append "https://github.com/brunoos/luasec/archive/"
|
| 298 | "luasec-" version ".tar.gz"))
|
| 299 | (sha256
|
| 300 | (base32
|
| 301 | "0c9sdz3gvrsbvvdqzpnsappgwl40hfljlpfybqis6wia3mdyjxi1"))))
|
| 302 | (build-system gnu-build-system)
|
| 303 | (arguments
|
| 304 | `(#:make-flags
|
| 305 | (let ((out (assoc-ref %outputs "out"))
|
| 306 | (lua-version ,(version-major+minor (package-version lua))))
|
| 307 | (list "linux"
|
| 308 | "CC=gcc"
|
| 309 | "LD=gcc"
|
| 310 | (string-append "LUAPATH=" out "/share/lua/" lua-version)
|
| 311 | (string-append "LUACPATH=" out "/lib/lua/" lua-version)))
|
| 312 | #:tests? #f |
| 313 | #:phases
|
| 314 | (modify-phases %standard-phases
|
| 315 | (delete 'configure))))
|
| 316 | (inputs
|
| 317 | `(("lua" ,lua)
|
| 318 | ("openssl" ,openssl)))
|
| 319 | (propagated-inputs
|
| 320 | `(("lua-socket"
|
| 321 | ,(make-lua-socket
|
| 322 | (format #f "lua~a-socket"
|
| 323 | (version-major+minor (package-version lua))) lua))))
|
| 324 | (home-page "https://github.com/brunoos/luasec/wiki")
|
| 325 | (synopsis "OpenSSL bindings for Lua")
|
| 326 | (description "LuaSec is a binding for OpenSSL library to provide TLS/SSL
|
| 327 | communication. It takes an already established TCP connection and creates a
|
| 328 | secure session between the peers.")
|
| 329 | (license license:expat)))
|
| 330 |
|
| 331 | (define-public lua5.1-sec
|
| 332 | (make-lua-sec "lua5.1-sec" lua-5.1))
|
| 333 |
|
| 334 | (define-public lua5.2-sec
|
| 335 | (make-lua-sec "lua5.2-sec" lua-5.2))
|
| 336 |
|
| 337 | (define-public lua-lgi
|
| 338 | (package
|
| 339 | (name "lua-lgi")
|
| 340 | (version "0.9.2")
|
| 341 | (source
|
| 342 | (origin
|
| 343 | (method url-fetch)
|
| 344 | (uri (string-append
|
| 345 | "https://github.com/pavouk/lgi/archive/"
|
| 346 | version ".tar.gz"))
|
| 347 | (file-name (string-append name "-" version ".tar.gz"))
|
| 348 | (sha256
|
| 349 | (base32
|
| 350 | "0kwcaj3ahi9gxfyp0lr5zgr6vi1mgsg9sz0980x0nwxlh9a11i6g"))))
|
| 351 | (build-system gnu-build-system)
|
| 352 | (arguments
|
| 353 | '(#:make-flags (list "CC=gcc"
|
| 354 | (string-append "PREFIX=" (assoc-ref %outputs "out")))
|
| 355 | #:phases
|
| 356 | (modify-phases %standard-phases
|
| 357 | (delete 'configure) |
| 358 | (add-before 'build 'set-env
|
| 359 | (lambda* (#:key inputs #:allow-other-keys)
|
| 360 | |
| 361 | (let* ((cairo (string-append
|
| 362 | (assoc-ref inputs "cairo") "/lib" )))
|
| 363 | (setenv "LD_LIBRARY_PATH" cairo)
|
| 364 | #t)))
|
| 365 | (add-before 'build 'set-lua-version
|
| 366 | (lambda _
|
| 367 | |
| 368 | |
| 369 | (substitute* "./lgi/Makefile"
|
| 370 | (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))
|
| 371 | #t))
|
| 372 | (add-before 'check 'skip-test-gtk
|
| 373 | (lambda _
|
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | (substitute* "./tests/test.lua"
|
| 382 | (("'gtk.lua',") "-- 'gtk.lua',"))
|
| 383 | #t))
|
| 384 | (add-before 'check 'start-xserver-instance
|
| 385 | (lambda* (#:key inputs #:allow-other-keys)
|
| 386 | |
| 387 | (system (format #f "~a/bin/Xvfb :1 &"
|
| 388 | (assoc-ref inputs "xorg-server")))
|
| 389 | (setenv "DISPLAY" ":1")
|
| 390 | #t)))))
|
| 391 | (inputs
|
| 392 | `(("gobject-introspection" ,gobject-introspection)
|
| 393 | ("glib" ,glib)
|
| 394 | ("pango" ,pango)
|
| 395 | ("gtk" ,gtk+-2)
|
| 396 | ("lua" ,lua)
|
| 397 | ("cairo" ,cairo)
|
| 398 | ("libffi" ,libffi)
|
| 399 | ("xorg-server" ,xorg-server)))
|
| 400 | (native-inputs
|
| 401 | `(("pkg-config" ,pkg-config)
|
| 402 | ("dbus" ,dbus))) |
| 403 | (home-page "https://github.com/pavouk/lgi/")
|
| 404 | (synopsis "Lua bridge to GObject based libraries")
|
| 405 | (description
|
| 406 | "LGI is gobject-introspection based dynamic Lua binding to GObject
|
| 407 | based libraries. It allows using GObject-based libraries directly from Lua.
|
| 408 | Notable examples are GTK+, GStreamer and Webkit.")
|
| 409 | (license license:expat)))
|
| 410 |
|
| 411 | (define (make-lua-lpeg name lua)
|
| 412 | (package
|
| 413 | (name name)
|
| 414 | (version "1.0.2")
|
| 415 | (source (origin
|
| 416 | (method url-fetch)
|
| 417 | (uri (string-append "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-"
|
| 418 | version ".tar.gz"))
|
| 419 | (sha256
|
| 420 | (base32 "1zjzl7acvcdavmcg5l7wi12jd4rh95q9pl5aiww7hv0v0mv6bmj8"))))
|
| 421 | (build-system gnu-build-system)
|
| 422 | (arguments
|
| 423 | `(#:phases
|
| 424 | (modify-phases %standard-phases
|
| 425 | (delete 'configure)
|
| 426 | |
| 427 | (replace 'install
|
| 428 | (lambda* (#:key outputs #:allow-other-keys)
|
| 429 | (let ((out (assoc-ref outputs "out"))
|
| 430 | (lua-version ,(version-major+minor (package-version lua))))
|
| 431 | (install-file "lpeg.so"
|
| 432 | (string-append out "/lib/lua/" lua-version))
|
| 433 | (install-file "re.lua"
|
| 434 | (string-append out "/share/lua/" lua-version))
|
| 435 | #t))))
|
| 436 | #:test-target "test"))
|
| 437 | (inputs `(("lua" ,lua)))
|
| 438 | (synopsis "Pattern-matching library for Lua")
|
| 439 | (description
|
| 440 | "LPeg is a pattern-matching library for Lua, based on Parsing Expression
|
| 441 | Grammars (PEGs).")
|
| 442 | (home-page "http://www.inf.puc-rio.br/~roberto/lpeg")
|
| 443 | (license license:expat)))
|
| 444 |
|
| 445 | (define-public lua-lpeg
|
| 446 | (make-lua-lpeg "lua-lpeg" lua))
|
| 447 |
|
| 448 | (define-public lua5.1-lpeg
|
| 449 | (make-lua-lpeg "lua5.1-lpeg" lua-5.1))
|
| 450 |
|
| 451 | (define-public lua5.2-lpeg
|
| 452 | (make-lua-lpeg "lua5.2-lpeg" lua-5.2))
|
| 453 |
|
| 454 | (define (make-lua-luv name lua)
|
| 455 | (package
|
| 456 | (name name)
|
| 457 | (version "1.30.1-1")
|
| 458 | (source (origin
|
| 459 | |
| 460 | |
| 461 | (method git-fetch)
|
| 462 | (uri (git-reference
|
| 463 | (url "https://github.com/luvit/luv.git")
|
| 464 | (commit version)))
|
| 465 | (file-name (git-file-name name version))
|
| 466 | (sha256
|
| 467 | (base32
|
| 468 | "0b2zxrsjxzhzwfp28lchplrp272v6zkbpq1ddz7a0rf20l7dbls1"))))
|
| 469 | (build-system cmake-build-system)
|
| 470 | (arguments
|
| 471 | `(#:tests? #f |
| 472 | #:configure-flags
|
| 473 | '("-DWITH_LUA_ENGINE=Lua"
|
| 474 | "-DWITH_SHARED_LIBUV=On"
|
| 475 | "-DBUILD_MODULE=Off"
|
| 476 | "-DBUILD_SHARED_LIBS=On"
|
| 477 | "-DLUA_BUILD_TYPE=System")
|
| 478 | #:phases
|
| 479 | (modify-phases %standard-phases
|
| 480 | (add-after 'unpack 'copy-lua-compat
|
| 481 | (lambda* (#:key inputs #:allow-other-keys)
|
| 482 | (copy-recursively (assoc-ref inputs "lua-compat")
|
| 483 | "lua-compat")
|
| 484 | (setenv "CPATH"
|
| 485 | (string-append (getcwd) "/lua-compat:"
|
| 486 | (or (getenv "CPATH") "")))
|
| 487 | #t)))))
|
| 488 | (inputs
|
| 489 | `(("lua" ,lua)
|
| 490 | ("libuv" ,libuv)))
|
| 491 | (native-inputs
|
| 492 | `(("lua-compat"
|
| 493 | ,(origin
|
| 494 | (method git-fetch)
|
| 495 | (uri (git-reference
|
| 496 | (url "https://github.com/keplerproject/lua-compat-5.3.git")
|
| 497 | (commit "daebe77a2f498817713df37f0bb316db1d82222f")))
|
| 498 | (file-name "lua-compat-5.3-checkout")
|
| 499 | (sha256
|
| 500 | (base32
|
| 501 | "02a14nvn7aggg1yikj9h3dcf8aqjbxlws1bfvqbpfxv9d5phnrpz"))))))
|
| 502 | (home-page "https://github.com/luvit/luv/")
|
| 503 | (synopsis "Libuv bindings for Lua")
|
| 504 | (description
|
| 505 | "This library makes libuv available to Lua scripts.")
|
| 506 | (license license:asl2.0)))
|
| 507 |
|
| 508 | (define-public lua-luv
|
| 509 | (make-lua-luv "lua-luv" lua))
|
| 510 |
|
| 511 | (define-public lua5.1-luv
|
| 512 | (make-lua-luv "lua5.1-luv" lua-5.1))
|
| 513 |
|
| 514 | (define-public lua5.2-luv
|
| 515 | (make-lua-luv "lua5.2-luv" lua-5.2))
|
| 516 |
|
| 517 | |
| 518 | (define (make-lua-bitop name lua)
|
| 519 | (package
|
| 520 | (name name)
|
| 521 | (version "1.0.2")
|
| 522 | (source (origin
|
| 523 | (method url-fetch)
|
| 524 | (uri (string-append "http://bitop.luajit.org/download/"
|
| 525 | "LuaBitOp-" version ".tar.gz"))
|
| 526 | (sha256
|
| 527 | (base32
|
| 528 | "16fffbrgfcw40kskh2bn9q7m3gajffwd2f35rafynlnd7llwj1qj"))))
|
| 529 | (build-system gnu-build-system)
|
| 530 | (arguments
|
| 531 | `(#:test-target "test"
|
| 532 | #:make-flags
|
| 533 | (list "INSTALL=install -pD"
|
| 534 | (string-append "INSTALLPATH=printf "
|
| 535 | (assoc-ref %outputs "out")
|
| 536 | "/lib/lua/"
|
| 537 | ,(version-major+minor (package-version lua))
|
| 538 | "/bit/bit.so"))
|
| 539 | #:phases
|
| 540 | (modify-phases %standard-phases
|
| 541 | (delete 'configure))))
|
| 542 | (inputs `(("lua" ,lua)))
|
| 543 | (home-page "https://bitop.luajit.org/index.html")
|
| 544 | (synopsis "Bitwise operations on numbers for Lua")
|
| 545 | (description
|
| 546 | "Lua BitOp is a C extension module for Lua which adds bitwise operations
|
| 547 | on numbers.")
|
| 548 | (license license:expat)))
|
| 549 |
|
| 550 | (define-public lua5.2-bitop
|
| 551 | (make-lua-bitop "lua5.2-bitop" lua-5.2))
|
| 552 |
|
| 553 | (define-public lua5.1-bitop
|
| 554 | (make-lua-bitop "lua5.1-bitop" lua-5.1))
|
| 555 |
|
| 556 | (define-public selene
|
| 557 | (package
|
| 558 | (name "selene")
|
| 559 | (version "2017.08.25")
|
| 560 | (source (origin
|
| 561 | (method git-fetch)
|
| 562 | (uri (git-reference
|
| 563 | (url "https://github.com/jeremyong/Selene.git")
|
| 564 | |
| 565 | (commit "ffe1ade2568d4cff5894552be8f43e63e379a4c9")))
|
| 566 | (file-name "Selene")
|
| 567 | (sha256
|
| 568 | (base32
|
| 569 | "1axrgv3rxxdsaf807lwvklfzicn6x6gpf35narllrnz9lg6hn508"))))
|
| 570 | (build-system cmake-build-system)
|
| 571 | (arguments
|
| 572 | `(#:configure-flags
|
| 573 | |
| 574 | '("-DLUA_PC_CFG=lua;lua-5.3;lua-5.1")
|
| 575 | #:test-target "all"
|
| 576 | #:phases
|
| 577 | |
| 578 | (modify-phases %standard-phases
|
| 579 | (delete 'build)
|
| 580 | (replace 'install
|
| 581 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 582 | (let* ((output (assoc-ref outputs "out"))
|
| 583 | (source (assoc-ref inputs "source"))
|
| 584 | (includedir (string-append output "/include")))
|
| 585 | (copy-recursively
|
| 586 | (string-append source "/include")
|
| 587 | includedir))
|
| 588 | #t))
|
| 589 | |
| 590 | (replace 'check
|
| 591 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 592 | (let* ((output (assoc-ref outputs "out"))
|
| 593 | (source (assoc-ref inputs "source"))
|
| 594 | (builddir (getcwd))
|
| 595 | (testdir (string-append builddir "/test")))
|
| 596 | (copy-recursively (string-append source "/test") testdir)
|
| 597 | (invoke "make")
|
| 598 | (mkdir-p "runner")
|
| 599 | (copy-file "./test_runner" "./runner/test_runner")
|
| 600 | (chdir "./runner")
|
| 601 | (invoke "./test_runner")))))))
|
| 602 | (native-inputs
|
| 603 | `(("lua" ,lua)
|
| 604 | ("pkg-config" ,pkg-config)))
|
| 605 | (home-page "https://github.com/jeremyong/Selene")
|
| 606 | (synopsis "Lua C++11 bindings")
|
| 607 | (description
|
| 608 | "Selene is a simple C++11 header-only library enabling seamless
|
| 609 | interoperability between C++ and Lua programming language.")
|
| 610 | (license license:zlib)))
|