diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2026-03-18 23:33:15 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2026-04-02 11:36:08 +0900 |
| commit | bd0bba7440dfd1074da63e68fd8f3890eef3ec5b (patch) | |
| tree | 1457aa676c5d0a9e12395acbe5b81aa99af5d227 /gnu/packages/lua.scm | |
| parent | 3d3e8d7d6763ac1a5ac55a08dde976f943425a05 (diff) | |
gnu: Add djot.
* gnu/packages/lua.scm (djot): New variable.
Change-Id: I8bf67cda21d213edac3c395f97b52e4026bc9c53
Merges: https://codeberg.org/guix/guix/pulls/6999
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Diffstat (limited to 'gnu/packages/lua.scm')
| -rw-r--r-- | gnu/packages/lua.scm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index dab1249f1c6..a31b036961e 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm | |||
| @@ -1264,6 +1264,43 @@ for syntax highlighting or a linting tool.") | |||
| 1264 | (define-public lua5.1-djot | 1264 | (define-public lua5.1-djot |
| 1265 | (make-lua-djot "lua5.1-djot" lua-5.1)) | 1265 | (make-lua-djot "lua5.1-djot" lua-5.1)) |
| 1266 | 1266 | ||
| 1267 | (define-public djot | ||
| 1268 | (package | ||
| 1269 | (inherit lua5.1-djot) | ||
| 1270 | (name "djot") | ||
| 1271 | (arguments | ||
| 1272 | (substitute-keyword-arguments (package-arguments lua5.1-djot) | ||
| 1273 | ((#:phases phases) | ||
| 1274 | #~(modify-phases #$phases | ||
| 1275 | (replace 'patch-makefile | ||
| 1276 | (lambda _ | ||
| 1277 | (substitute* "Makefile" | ||
| 1278 | (("^all: .*") "all: doc/djot.1\n")))) | ||
| 1279 | (replace 'check | ||
| 1280 | (lambda* (#:key tests? #:allow-other-keys) | ||
| 1281 | (when tests? | ||
| 1282 | (invoke "luajit" "test.lua")))) | ||
| 1283 | (add-after 'install 'install-bin-and-man | ||
| 1284 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 1285 | (let ((out-lua (string-append #$output "/share/lua/5.1")) | ||
| 1286 | (out-bin (string-append #$output "/bin/djot"))) | ||
| 1287 | (copy-file "bin/main.lua" "bin/djot") | ||
| 1288 | (substitute* "bin/djot" | ||
| 1289 | (("^local djot = require" all) | ||
| 1290 | (string-append | ||
| 1291 | "#!" | ||
| 1292 | (search-input-file inputs "bin/luajit") | ||
| 1293 | "\n" | ||
| 1294 | all))) | ||
| 1295 | (install-file "bin/djot" (string-append #$output "/bin")) | ||
| 1296 | (chmod out-bin #o755) | ||
| 1297 | (wrap-program out-bin | ||
| 1298 | `("GUIX_LUA_PATH" ";" = (,out-lua)))) | ||
| 1299 | (install-file "doc/djot.1" | ||
| 1300 | (string-append #$output "/share/man/man1")))))))) | ||
| 1301 | (native-inputs (list pandoc)) | ||
| 1302 | (inputs (list luajit)))) | ||
| 1303 | |||
| 1267 | (define-public lutok | 1304 | (define-public lutok |
| 1268 | (package | 1305 | (package |
| 1269 | (name "lutok") | 1306 | (name "lutok") |
