diff options
| author | Carlo Zancanaro <carlo@zancanaro.id.au> | 2026-06-08 23:45:00 +1000 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2026-06-17 22:00:50 +0900 |
| commit | 19dbaf78b8563d6bfb40cfc89aebc0239de22eca (patch) | |
| tree | edb31ba342e8b0d533232ca7efab84652578dac8 /gnu | |
| parent | dce1ff1c9d8f14ce781c971140d34a2f0e4b59bc (diff) | |
gnu: lua-socket: Define variants with package rewrites.
* gnu/packages/lua.scm (make-lua-socket): Remove procedure.
(lua-socket): Convert to direct package definition.
(lua5.5-socket, lua5.4-socket, lua5.3-socket, lua5.2-socket)
(lua5.1-socket): Define as rewrite of lua-socket.
Merges: https://codeberg.org/guix/guix/pulls/9183
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/lua.scm | 83 |
1 files changed, 37 insertions, 46 deletions
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index b79e35240b1..59bb6a41b24 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm | |||
| @@ -464,12 +464,12 @@ with the appropriate luaX.X- prefix for this package." | |||
| 464 | (lua-5.2 lua5.2-expat) | 464 | (lua-5.2 lua5.2-expat) |
| 465 | (lua-5.1 lua5.1-expat)) | 465 | (lua-5.1 lua5.1-expat)) |
| 466 | 466 | ||
| 467 | (define (make-lua-socket name lua) | 467 | (define-public lua-socket |
| 468 | ;; The 3.1.0 tag still has 3.0.0 in a bunch of places. | 468 | ;; The 3.1.0 tag still has 3.0.0 in a bunch of places. |
| 469 | (let ((commit "de359ea4083ac6d944216229e4104dc36537c29c") | 469 | (let ((commit "de359ea4083ac6d944216229e4104dc36537c29c") |
| 470 | (revision "1")) | 470 | (revision "1")) |
| 471 | (package | 471 | (package |
| 472 | (name name) | 472 | (name "lua-socket") |
| 473 | (version (git-version "3.1.0" revision commit)) | 473 | (version (git-version "3.1.0" revision commit)) |
| 474 | (source | 474 | (source |
| 475 | (origin | 475 | (origin |
| @@ -483,36 +483,35 @@ with the appropriate luaX.X- prefix for this package." | |||
| 483 | (base32 "1bdcdad8fq2p193jcvsv59wm5mifb07alvrxm8qq31qmgs1q4mpw")))) | 483 | (base32 "1bdcdad8fq2p193jcvsv59wm5mifb07alvrxm8qq31qmgs1q4mpw")))) |
| 484 | (build-system gnu-build-system) | 484 | (build-system gnu-build-system) |
| 485 | (arguments | 485 | (arguments |
| 486 | (let ((luav (version-major+minor (package-version lua)))) | 486 | (list |
| 487 | (list | 487 | #:make-flags |
| 488 | #:make-flags | 488 | #~(list (string-append "INSTALL_TOP=" #$output) |
| 489 | #~(list (string-append "INSTALL_TOP=" #$output) | 489 | (string-append "LUAV=" #$(this-lua-version)) |
| 490 | (string-append "LUAV=" #$luav) | 490 | "MYCFLAGS=-DLUASOCKET_DEBUG") |
| 491 | "MYCFLAGS=-DLUASOCKET_DEBUG") | 491 | #:modules |
| 492 | #:modules | 492 | (cons '(ice-9 threads) %default-gnu-modules) |
| 493 | (cons '(ice-9 threads) %default-gnu-modules) | 493 | #:phases |
| 494 | #:phases | 494 | #~(modify-phases %standard-phases |
| 495 | #~(modify-phases %standard-phases | 495 | (delete 'configure) |
| 496 | (delete 'configure) | 496 | (delete 'check) |
| 497 | (delete 'check) | 497 | (add-after 'install 'install-unix |
| 498 | (add-after 'install 'install-unix | 498 | (lambda* (#:key make-flags #:allow-other-keys) |
| 499 | (lambda* (#:key make-flags #:allow-other-keys) | 499 | (apply invoke "make" "install-unix" make-flags))) |
| 500 | (apply invoke "make" "install-unix" make-flags))) | 500 | (add-after 'install-unix 'check |
| 501 | (add-after 'install-unix 'check | 501 | (lambda _ |
| 502 | (lambda _ | 502 | (setenv "GUIX_LUA_CPATH" |
| 503 | (setenv "GUIX_LUA_CPATH" | 503 | (string-append #$output "/lib/lua/" #$(this-lua-version))) |
| 504 | (string-append #$output "/lib/lua/" #$luav)) | 504 | (setenv "GUIX_LUA_PATH" |
| 505 | (setenv "GUIX_LUA_PATH" | 505 | (string-append #$output "/share/lua/" #$(this-lua-version))) |
| 506 | (string-append #$output "/share/lua/" #$luav)) | 506 | (with-directory-excursion "test" |
| 507 | (with-directory-excursion "test" | 507 | (make-thread invoke "lua" "testsrvr.lua") |
| 508 | (make-thread invoke "lua" "testsrvr.lua") | 508 | (make-thread invoke "lua" "utestsrvr.lua") |
| 509 | (make-thread invoke "lua" "utestsrvr.lua") | 509 | (for-each |
| 510 | (for-each | 510 | (lambda (test) |
| 511 | (lambda (test) | 511 | (invoke "lua" (string-append test ".lua"))) |
| 512 | (invoke "lua" (string-append test ".lua"))) | 512 | '("hello" "stufftest" "excepttest" "test_bind" |
| 513 | '("hello" "stufftest" "excepttest" "test_bind" | 513 | "test_getaddrinfo" "ltn12test" "mimetest" "urltest" |
| 514 | "test_getaddrinfo" "ltn12test" "mimetest" "urltest" | 514 | "test_socket_error" "testclnt" "utestclnt")))))))) |
| 515 | "test_socket_error" "testclnt" "utestclnt"))))))))) | ||
| 516 | (inputs (list lua)) | 515 | (inputs (list lua)) |
| 517 | (home-page "https://lunarmodules.github.io/luasocket") | 516 | (home-page "https://lunarmodules.github.io/luasocket") |
| 518 | (synopsis "Network support for the Lua language") | 517 | (synopsis "Network support for the Lua language") |
| @@ -531,20 +530,12 @@ with one) and LTN12 (filters, sinks, sources and pumps) modules can be very | |||
| 531 | handy.") | 530 | handy.") |
| 532 | (license (package-license lua-5.1))))) | 531 | (license (package-license lua-5.1))))) |
| 533 | 532 | ||
| 534 | (define-public lua5.1-socket | 533 | (define-public-lua-variants lua-socket |
| 535 | (make-lua-socket "lua5.1-socket" lua-5.1)) | 534 | (lua-5.5 lua5.5-socket) |
| 536 | 535 | (lua-5.4 lua5.4-socket) | |
| 537 | (define-public lua5.2-socket | 536 | (lua-5.3 lua5.3-socket) |
| 538 | (make-lua-socket "lua5.2-socket" lua-5.2)) | 537 | (lua-5.2 lua5.2-socket) |
| 539 | 538 | (lua-5.1 lua5.1-socket)) | |
| 540 | (define-public lua-socket | ||
| 541 | (make-lua-socket "lua-socket" lua)) | ||
| 542 | |||
| 543 | (define-public lua5.4-socket | ||
| 544 | (make-lua-socket "lua5.4-socket" lua-5.4)) | ||
| 545 | |||
| 546 | (define-public lua5.5-socket | ||
| 547 | (make-lua-socket "lua5.5-socket" lua-5.5)) | ||
| 548 | 539 | ||
| 549 | (define (make-lua-filesystem name lua) | 540 | (define (make-lua-filesystem name lua) |
| 550 | (package | 541 | (package |
