summaryrefslogtreecommitdiff
path: root/gnu/packages/irc.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/irc.scm')
-rw-r--r--gnu/packages/irc.scm196
1 files changed, 144 insertions, 52 deletions
diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 9fc0943db1..9e6cb3d001 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -102,62 +102,154 @@
(define-public glirc
(package
- (name "glirc")
- (version "2.39.0.1")
- (source
- (origin
- (method url-fetch)
- (uri (hackage-uri "glirc" version))
- (sha256
- (base32 "0jaywb43jfv6kzyz540k02mxdgw1shc6hn7kia21alssszkilh4r"))))
- (build-system haskell-build-system)
- (arguments
- (list
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'install 'install-extra-documentation
- (lambda _
- (install-file "glirc.1"
- (string-append #$output "/share/man/man1"))
- ;; The man page is very terse and punts to the GitHub wiki for real
- ;; information. Some of that is also in the README, so install it.
- (install-file "README.md"
- (string-append #$output "/share/doc/"
- #$name "-" #$version)))))))
- (native-inputs
- (list ghc-hunit))
- (inputs
- (list ghc-async
- ghc-attoparsec
- ghc-base64-bytestring
- ghc-config-schema
- ghc-config-value
- ghc-curve25519
- ghc-free
- ghc-githash
- ghc-hashable
- ghc-hookup
- ghc-hsopenssl
- ghc-irc-core
- ghc-kan-extensions
- ghc-lens
- ghc-network
- ghc-psqueues
- ghc-random
- ghc-regex-tdfa
- ghc-split
- ghc-unordered-containers
- ghc-vector
- ghc-vty))
- (home-page "https://github.com/glguy/irc-core")
- (synopsis "Console IRC client")
- (description
- "Glirc is a console IRC client that focuses on providing both high-detail
+ (name "glirc")
+ (version "2.39.0.1") ; inherited by glirc-* extensions below
+ (source
+ (origin
+ (method url-fetch)
+ (uri (hackage-uri "glirc" version))
+ (sha256
+ (base32 "0jaywb43jfv6kzyz540k02mxdgw1shc6hn7kia21alssszkilh4r"))))
+ (build-system haskell-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-extra-documentation
+ (lambda _
+ (install-file "glirc.1"
+ (string-append #$output "/share/man/man1"))
+ ;; The man page is very terse and punts to the GitHub wiki for real
+ ;; information. Some of that is also in the README, so install it.
+ (install-file "README.md"
+ (string-append #$output "/share/doc/"
+ #$name "-" #$version)))))))
+ (native-inputs
+ (list ghc-hunit))
+ (inputs
+ (list ghc-async
+ ghc-attoparsec
+ ghc-base64-bytestring
+ ghc-config-schema
+ ghc-config-value
+ ghc-curve25519
+ ghc-free
+ ghc-githash
+ ghc-hashable
+ ghc-hookup
+ ghc-hsopenssl
+ ghc-irc-core
+ ghc-kan-extensions
+ ghc-lens
+ ghc-network
+ ghc-psqueues
+ ghc-random
+ ghc-regex-tdfa
+ ghc-split
+ ghc-unordered-containers
+ ghc-vector
+ ghc-vty))
+ (home-page "https://github.com/glguy/irc-core")
+ (synopsis "Console IRC client")
+ (description
+ "Glirc is a console IRC client that focuses on providing both high-detail
and concise views of an IRC connection. All views and transformation are
dynamic and don't change the underlying model. It also provides advanced
line-editing features including syntax-highlighting, multi-line buffering,
and argument placeholders.")
- (license license:isc)))
+ (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