diff options
| author | Nox <noximilien@riseup.net> | 2026-05-19 01:46:43 +0200 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2026-06-07 22:38:21 +0900 |
| commit | de250c53bba9c08160608651ec9138c1cfec1dd4 (patch) | |
| tree | 6db94eb7aa8ab0c5ce9eb5d1eced74b5ed0893c1 /gnu/packages/lua.scm | |
| parent | e0b763355d6518b64c9ef7698954c308eceeaeee (diff) | |
gnu: make-lua-socket: Update to 3.1.0.
* gnu/packages/lua.scm (make-lua-socket): Update to 3.1.0.
[source]: Replace with lunarmodules repository. [home-page]: Likewise.
[arguments]: Use gexp. <#:phases>{check}: Move after install phase.
Use GUIX_LUA_{C,}PATH. Add more test invocations.
{install-unix}: Add after install phase.
[synopsis]: Update according to home page.
[license]: Update according to upstream's intent.
Change-Id: Ibddef80ff8343190bc0dc8a371492806c94bb6c8
Merges: https://codeberg.org/guix/guix/pulls/8711
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
socket
Change-Id: Iaa9d9bb7d042b722350c5a6492621b226c05a207
Diffstat (limited to 'gnu/packages/lua.scm')
| -rw-r--r-- | gnu/packages/lua.scm | 91 |
1 files changed, 55 insertions, 36 deletions
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 4b12a0a2d86..ca154de5e95 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm | |||
| @@ -374,41 +374,60 @@ some projects."))) | |||
| 374 | (make-lua-expat "lua5.5-expat" lua-5.5)) | 374 | (make-lua-expat "lua5.5-expat" lua-5.5)) |
| 375 | 375 | ||
| 376 | (define (make-lua-socket name lua) | 376 | (define (make-lua-socket name lua) |
| 377 | (package | 377 | ;; The 3.1.0 tag still has 3.0.0 in a bunch of places. |
| 378 | (name name) | 378 | (let ((commit "de359ea4083ac6d944216229e4104dc36537c29c") |
| 379 | (version "3.0-rc1") | 379 | (revision "1")) |
| 380 | (source (origin | 380 | (package |
| 381 | (method git-fetch) | 381 | (name name) |
| 382 | (uri (git-reference | 382 | (version (git-version "3.1.0" revision commit)) |
| 383 | (url "https://github.com/diegonehab/luasocket") | 383 | (source |
| 384 | (commit (string-append "v" version)))) | 384 | (origin |
| 385 | (file-name (git-file-name name version)) | 385 | (method git-fetch) |
| 386 | (sha256 | 386 | (uri |
| 387 | (base32 | 387 | (git-reference |
| 388 | "1chs7z7a3i3lck4x7rz60ziwbf793gw169hpjdfca8y4yf1hzsxk")))) | 388 | (url "https://github.com/lunarmodules/luasocket") |
| 389 | (build-system gnu-build-system) | 389 | (commit commit))) |
| 390 | (arguments | 390 | (file-name (git-file-name name version)) |
| 391 | `(#:make-flags | 391 | (sha256 |
| 392 | (let ((out (assoc-ref %outputs "out")) | 392 | (base32 "1bdcdad8fq2p193jcvsv59wm5mifb07alvrxm8qq31qmgs1q4mpw")))) |
| 393 | (lua-version ,(version-major+minor (package-version lua)))) | 393 | (build-system gnu-build-system) |
| 394 | (list (string-append "INSTALL_TOP=" out) | 394 | (arguments |
| 395 | (string-append "LUAV?=" lua-version))) | 395 | (let ((luav (version-major+minor (package-version lua)))) |
| 396 | #:phases | 396 | (list |
| 397 | (modify-phases %standard-phases | 397 | #:make-flags |
| 398 | (delete 'configure) | 398 | #~(list (string-append "INSTALL_TOP=" #$output) |
| 399 | (replace 'check | 399 | (string-append "LUAV=" #$luav) |
| 400 | (lambda _ | 400 | "MYCFLAGS=-DLUASOCKET_DEBUG") |
| 401 | (setenv "LUA_CPATH" (string-append "src/?.so." ,version ";;")) | 401 | #:modules |
| 402 | (setenv "LUA_PATH" "src/?.lua;;") | 402 | (cons '(ice-9 threads) %default-gnu-modules) |
| 403 | (when (zero? (primitive-fork)) | 403 | #:phases |
| 404 | (invoke "lua" "test/testsrvr.lua")) | 404 | #~(modify-phases %standard-phases |
| 405 | (invoke "lua" "test/testclnt.lua")))))) | 405 | (delete 'configure) |
| 406 | (inputs | 406 | (delete 'check) |
| 407 | (list lua)) | 407 | (add-after 'install 'install-unix |
| 408 | (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/") | 408 | (lambda* (#:key make-flags #:allow-other-keys) |
| 409 | (synopsis "Socket library for Lua") | 409 | (apply invoke "make" "install-unix" make-flags))) |
| 410 | (description "LuaSocket is a Lua extension library that is composed by two | 410 | (add-after 'install-unix 'check |
| 411 | parts: a C core that provides support for the TCP and UDP transport layers, | 411 | (lambda _ |
| 412 | (setenv "GUIX_LUA_CPATH" | ||
| 413 | (string-append #$output "/lib/lua/" #$luav)) | ||
| 414 | (setenv "GUIX_LUA_PATH" | ||
| 415 | (string-append #$output "/share/lua/" #$luav)) | ||
| 416 | (with-directory-excursion "test" | ||
| 417 | (make-thread invoke "lua" "testsrvr.lua") | ||
| 418 | (make-thread invoke "lua" "utestsrvr.lua") | ||
| 419 | (for-each | ||
| 420 | (lambda (test) | ||
| 421 | (invoke "lua" (string-append test ".lua"))) | ||
| 422 | '("hello" "stufftest" "excepttest" "test_bind" | ||
| 423 | "test_getaddrinfo" "ltn12test" "mimetest" "urltest" | ||
| 424 | "test_socket_error" "testclnt" "utestclnt"))))))))) | ||
| 425 | (inputs (list lua)) | ||
| 426 | (home-page "https://lunarmodules.github.io/luasocket") | ||
| 427 | (synopsis "Network support for the Lua language") | ||
| 428 | (description | ||
| 429 | "LuaSocket is a Lua extension library that is composed by two parts: | ||
| 430 | a C core that provides support for the TCP and UDP transport layers, | ||
| 412 | and a set of Lua modules that add support for functionality commonly needed by | 431 | and a set of Lua modules that add support for functionality commonly needed by |
| 413 | applications that deal with the Internet. | 432 | applications that deal with the Internet. |
| 414 | 433 | ||
| @@ -419,7 +438,7 @@ to the functionality defined by each protocol. In addition, you will find | |||
| 419 | that the MIME (common encodings), URL (anything you could possible want to do | 438 | that the MIME (common encodings), URL (anything you could possible want to do |
| 420 | with one) and LTN12 (filters, sinks, sources and pumps) modules can be very | 439 | with one) and LTN12 (filters, sinks, sources and pumps) modules can be very |
| 421 | handy.") | 440 | handy.") |
| 422 | (license license:expat))) | 441 | (license (package-license lua-5.1))))) |
| 423 | 442 | ||
| 424 | (define-public lua5.1-socket | 443 | (define-public lua5.1-socket |
| 425 | (make-lua-socket "lua5.1-socket" lua-5.1)) | 444 | (make-lua-socket "lua5.1-socket" lua-5.1)) |
