[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
26/28: gnu: Add glirc-lua.
From: |
guix-commits |
Subject: |
26/28: gnu: Add glirc-lua. |
Date: |
Sun, 17 Sep 2023 08:26:44 -0400 (EDT) |
nckx pushed a commit to branch master
in repository guix.
commit bdbaf2c2ff54f493df5ed9e65ee6b4d416628b6e
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sun Sep 10 02:00:00 2023 +0200
gnu: Add glirc-lua.
* gnu/packages/irc.scm (glirc-lua): New public variable.
---
gnu/packages/irc.scm | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 93 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 9fc0943db1..107c4d0d19 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -103,7 +103,7 @@
(define-public glirc
(package
(name "glirc")
- (version "2.39.0.1")
+ (version "2.39.0.1") ; inherited by glirc-* extensions below
(source
(origin
(method url-fetch)
@@ -159,6 +159,98 @@ line-editing features including syntax-highlighting,
multi-line buffering,
and argument placeholders.")
(license license:isc)))
+(define-public glirc-lua
+ (package
+ (name "glirc-lua")
+ (version (package-version glirc))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/glguy/irc-core")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1hadxsahl30jhgk8vvcg7lwndzc282iybcjam87xx5c0lh0mfzan"))))
+ (build-system meson-build-system)
+ (arguments
+ (list
+ #:modules
+ '((guix build meson-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'enter-subdirectory
+ (lambda _
+ (chdir "lua-extension")))
+ (replace 'install
+ (lambda _
+ (install-file "glirc-lua.so" (string-append #$output "/lib"))))
+ (add-after 'install 'set-lua-paths
+ (lambda _
+ (let ((x.y #$(version-major+minor
+ (package-version
+ (this-package-native-input "lua"))))
+ (libraries (filter (match-lambda
+ ((label . _)
+ (string-prefix? "lua-" label)))
+ '#$(package-native-inputs
+ this-package))))
+ (setenv "LUA_PATH"
+ (string-join
+ (map (match-lambda
+ ((_ dir)
+ (string-append
+ dir "/share/lua/" x.y "/?.lua;"
+ dir "/share/lua/" x.y "/?/?.lua")))
+ libraries)
+ ";"))
+ (setenv "LUA_CPATH"
+ (string-join
+ (map (match-lambda
+ ((_ dir)
+ (string-append
+ dir "/lib/lua/" x.y "/?.so;"
+ dir "/lib/lua/" x.y "/?/?.so")))
+ libraries)
+ ";")))))
+ (add-after 'set-lua-paths 'document
+ (lambda _
+ (with-directory-excursion "../lua-extension/doc"
+ ;; Guix's ldoc command is a shell script without a shebang.
+ (invoke "sh" "ldoc" ".")
+ (let ((doc (string-append #$output "/share/doc/" #$name)))
+ (mkdir-p doc)
+ (copy-recursively "api" doc)))))
+ (add-after 'document 'leave-subdirectory
+ ;; Let default phases like 'install-license-files do their thing.
+ (lambda _
+ (chdir ".."))))))
+ (native-inputs
+ (list pkg-config
+ ;; For building the API documentation.
+ lua lua-filesystem lua-ldoc lua-penlight))
+ (inputs
+ (list lua))
+ (home-page (package-home-page glirc))
+ (synopsis "Lua scripting extension to the glirc IRC client")
+ (description
+ "This extension lets you script the glirc IRC client using Lua.
+To use it, you must tell @command{glirc} exactly where to find
+@file{glirc-lua.so} by adding something like this to your
+@file{~/.config/glirc/config}:
+
+@example
+extensions:
+ * path: \"../../.guix-profile/lib/glirc-lua.so\"
+ args: [\"example.lua\", @dots{}]
+@end example
+
+Also ensure that @file{example.lua} finds any Lua libraries it needs, e.g., by
+setting @env{LUA_PATH} and @env{LUA_CPATH} in glirc's run-time environment.")
+ (license (package-license glirc))))
+
(define-public quassel
(package
(name "quassel")
- 22/28: gnu: drpm: Update to 0.5.2., (continued)
- 22/28: gnu: drpm: Update to 0.5.2., guix-commits, 2023/09/17
- 27/28: gnu: glirc: Re-indent., guix-commits, 2023/09/17
- 07/28: gnu: drumkv1: Update to 0.9.32., guix-commits, 2023/09/17
- 10/28: gnu: qtractor: Update to 0.9.35., guix-commits, 2023/09/17
- 09/28: gnu: padthv1: Update to 0.9.32., guix-commits, 2023/09/17
- 12/28: gnu: fuse-overlayfs: Update to 1.13., guix-commits, 2023/09/17
- 08/28: gnu: samplv1: Update to 0.9.32., guix-commits, 2023/09/17
- 11/28: gnu: libdiscid: Update to 0.6.4., guix-commits, 2023/09/17
- 16/28: gnu: boxes: Update to 2.2.1., guix-commits, 2023/09/17
- 20/28: gnu: fsearch: Update to 0.2.3., guix-commits, 2023/09/17
- 26/28: gnu: Add glirc-lua.,
guix-commits <=
- 23/28: gnu: httping: Update to 2.9., guix-commits, 2023/09/17
- 21/28: gnu: mu: Update to 1.10.7., guix-commits, 2023/09/17
- 28/28: gnu: net-snmp: Update to 5.9.4., guix-commits, 2023/09/17