diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2026-03-09 15:20:34 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2026-04-02 11:35:51 +0900 |
| commit | 3d3e8d7d6763ac1a5ac55a08dde976f943425a05 (patch) | |
| tree | 19627bb0c299fa540a7657a2be740fb5d9f0f555 /gnu/packages/lua.scm | |
| parent | f52e17b7366ce115bff41b3c894d8e6b7be34544 (diff) | |
gnu: Add lua-djot.
* gnu/packages/lua.scm (lua5.4-djot, lua-djot)
(lua5.2-djot, lua5.1-djot): New variables.
Change-Id: I152a723dcece7218def021fbaefa50a662a811e0
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Diffstat (limited to 'gnu/packages/lua.scm')
| -rw-r--r-- | gnu/packages/lua.scm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 5de59de4bb4..dab1249f1c6 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | ;;; Copyright © 2025 Zheng Junjie <z572@z572.online> | 26 | ;;; Copyright © 2025 Zheng Junjie <z572@z572.online> |
| 27 | ;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se> | 27 | ;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se> |
| 28 | ;;; Copyright © 2025 Aaron Boyd <aaron.boyd.org@gmail.com> | 28 | ;;; Copyright © 2025 Aaron Boyd <aaron.boyd.org@gmail.com> |
| 29 | ;;; Copyright © 2026 Nguyễn Gia Phong <cnx@loang.net> | ||
| 29 | ;;; | 30 | ;;; |
| 30 | ;;; This file is part of GNU Guix. | 31 | ;;; This file is part of GNU Guix. |
| 31 | ;;; | 32 | ;;; |
| @@ -1201,6 +1202,68 @@ on numbers.") | |||
| 1201 | (define-public lua5.1-bitop | 1202 | (define-public lua5.1-bitop |
| 1202 | (make-lua-bitop "lua5.1-bitop" lua-5.1)) | 1203 | (make-lua-bitop "lua5.1-bitop" lua-5.1)) |
| 1203 | 1204 | ||
| 1205 | (define (make-lua-djot name lua) | ||
| 1206 | (package | ||
| 1207 | (name name) | ||
| 1208 | (version "0.2.1") | ||
| 1209 | (source | ||
| 1210 | (origin | ||
| 1211 | (method git-fetch) | ||
| 1212 | (uri (git-reference | ||
| 1213 | (url "https://github.com/jgm/djot.lua") | ||
| 1214 | (commit version))) | ||
| 1215 | (file-name (git-file-name name version)) | ||
| 1216 | (sha256 (base32 "0kivx4yyj2zhj23d93h5rr0ab7gkazd3z7r7aqv1bgmigcw47pj2")) | ||
| 1217 | (modules '((guix build utils))) | ||
| 1218 | (snippet #~(begin | ||
| 1219 | (delete-file-recursively "clib") | ||
| 1220 | (delete-file-recursively "doc/api") | ||
| 1221 | (delete-file "doc/djot.1"))))) | ||
| 1222 | (build-system gnu-build-system) | ||
| 1223 | (arguments | ||
| 1224 | (list | ||
| 1225 | #:phases | ||
| 1226 | #~(modify-phases %standard-phases | ||
| 1227 | (add-after 'unpack 'patch-makefile | ||
| 1228 | (lambda _ | ||
| 1229 | (substitute* "Makefile" | ||
| 1230 | (("^all: .*") "all:\n")))) | ||
| 1231 | (delete 'configure) | ||
| 1232 | (replace 'check | ||
| 1233 | (lambda* (#:key tests? #:allow-other-keys) | ||
| 1234 | (when tests? | ||
| 1235 | (invoke "lua" "test.lua")))) | ||
| 1236 | (replace 'install | ||
| 1237 | (lambda _ | ||
| 1238 | (let ((lua-path | ||
| 1239 | (string-append | ||
| 1240 | #$output | ||
| 1241 | "/share/lua/" | ||
| 1242 | #$(version-major+minor (package-version lua))))) | ||
| 1243 | (install-file "djot.lua" lua-path) | ||
| 1244 | (copy-recursively "djot" (string-append lua-path "/djot")))))))) | ||
| 1245 | (native-inputs (list lua)) | ||
| 1246 | (home-page "https://github.com/jgm/djot.lua") | ||
| 1247 | (synopsis "Lua parser for the djot light markup language") | ||
| 1248 | (description | ||
| 1249 | "This package provides a Lua parser for djot, a light markup syntax. | ||
| 1250 | It can produce an AST, rendered HTML, or a stream of match tokens | ||
| 1251 | that identify elements by source position, which could be used | ||
| 1252 | for syntax highlighting or a linting tool.") | ||
| 1253 | (license license:expat))) | ||
| 1254 | |||
| 1255 | (define-public lua5.4-djot | ||
| 1256 | (make-lua-djot "lua5.4-djot" lua-5.4)) | ||
| 1257 | |||
| 1258 | (define-public lua-djot | ||
| 1259 | (make-lua-djot "lua-djot" lua)) | ||
| 1260 | |||
| 1261 | (define-public lua5.2-djot | ||
| 1262 | (make-lua-djot "lua5.2-djot" lua-5.2)) | ||
| 1263 | |||
| 1264 | (define-public lua5.1-djot | ||
| 1265 | (make-lua-djot "lua5.1-djot" lua-5.1)) | ||
| 1266 | |||
| 1204 | (define-public lutok | 1267 | (define-public lutok |
| 1205 | (package | 1268 | (package |
| 1206 | (name "lutok") | 1269 | (name "lutok") |
