[PATCH 0/4] Refactor prosody modules, and add prosody-vcard-muc.

  • Done
  • quality assurance status badge
Details
2 participants
  • Carlo Zancanaro
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
Carlo Zancanaro
Severity
normal
C
C
Carlo Zancanaro wrote on 19 Feb 13:31 +0100
(address . guix-patches@gnu.org)
cover.1708345640.git.carlo@zancanaro.id.au
I wanted to add prosody-vcard-muc, which is a prosody module. When I saw the
code for the two existing modules I thought it could use a refactor before
adding it, so I did that, too.

I have successfully reconfigured my prosody server, which uses all three of
the Guix-packaged prosody modules, with this change.

Carlo Zancanaro (4):
gnu: Extract prosody-module from existing prosody modules.
gnu: Use copy-build-system for prosody modules.
gnu: Update prosody modules to the newest revision.
gnu: Add prosody-vcard-muc.

gnu/packages/messaging.scm | 88 +++++++++++++++++---------------------
1 file changed, 39 insertions(+), 49 deletions(-)


base-commit: 07ecdb99b6c4b6b3e993d08034138bf69414020b
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 13:34 +0100
[PATCH 1/4] gnu: Extract prosody-module from existing prosody modules.
(address . 69272@debbugs.gnu.org)
7a66ea0fe55fc6cd059eea7492df0f1889155d47.1708345640.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): New procedure.
(prosody-http-upload, prosody-smacks): Use it.

Change-Id: I55c69104460adbbd89c491b18f9f22681aefb92a
---
gnu/packages/messaging.scm | 67 ++++++++++++++++----------------------
1 file changed, 28 insertions(+), 39 deletions(-)

Toggle diff (101 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 98c1c9bf67..9cc90c588b 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -40,6 +40,7 @@
;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2024 Carlo Zancanaro <carlo@zancanaro.id.au>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1577,11 +1578,18 @@ (define-public prosody
protocols.")
(license license:x11)))
-(define-public prosody-http-upload
+(define (prosody-module module-name)
(let ((changeset "765735bb590b")
- (revision "1"))
+ (revision "1")
+ (package-name (string-append
+ "prosody-"
+ (string-replace-substring
+ (if (string-prefix? "mod_" module-name)
+ (substring module-name 4)
+ module-name)
+ "_" "-"))))
(package
- (name "prosody-http-upload")
+ (name package-name)
(version (string-append "0-" revision "." (string-take changeset 7)))
(source (origin
(method hg-fetch)
@@ -1600,47 +1608,28 @@ (define-public prosody-http-upload
(use-modules (guix build utils))
(let ((out (assoc-ref %outputs "out"))
(source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source "mod_http_upload")
- (install-file "mod_http_upload.lua" out))
+ (with-directory-excursion (in-vicinity source module-name)
+ (install-file (string-append module-name ".lua") out))
#t))))
- (home-page "https://modules.prosody.im/mod_http_upload.html")
- (synopsis "XEP-0363: Allow clients to upload files over HTTP")
- (description "This module implements XEP-0363: it allows clients to
-upload files over HTTP.")
+ (home-page #f)
+ (synopsis #f)
+ (description #f)
(license (package-license prosody)))))
+(define-public prosody-http-upload
+ (package
+ (inherit (prosody-module "mod_http_upload"))
+ (synopsis "XEP-0363: Allow clients to upload files over HTTP")
+ (description "This module implements XEP-0363: it allows clients to
+upload files over HTTP.")))
+
(define-public prosody-smacks
- (let ((changeset "67f1d1f22625")
- (revision "1"))
- (package
- (name "prosody-smacks")
- (version (string-append "0-" revision "." (string-take changeset 7)))
- (source (origin
- (method hg-fetch)
- (uri (hg-reference
- (url "https://hg.prosody.im/prosody-modules/")
- (changeset changeset)))
- (file-name (string-append name "-" version "-checkout"))
- (sha256
- (base32
- "020ngpax30fgarah98yvlj0ni8rcdwq60if03a9hqdw8mic0nxxs"))))
- (build-system trivial-build-system)
- (arguments
- '(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((out (assoc-ref %outputs "out"))
- (source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source "mod_smacks")
- (install-file "mod_smacks.lua" out))
- #t))))
- (home-page "https://modules.prosody.im/mod_smacks.html")
- (synopsis "XEP-0198: Reliability and fast reconnects for XMPP")
- (description "This module implements XEP-0198: when supported by both
+ (package
+ (inherit (prosody-module "mod_smacks"))
+ (synopsis "XEP-0198: Reliability and fast reconnects for XMPP")
+ (description "This module implements XEP-0198: when supported by both
the client and server, it can allow clients to resume a disconnected session,
-and prevent message loss.")
- (license (package-license prosody)))))
+and prevent message loss.")))
(define-public libtoxcore
(let ((revision "2")
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 13:34 +0100
[PATCH 2/4] gnu: Use copy-build-system for prosody modules.
(address . 69272@debbugs.gnu.org)
d01a2b40a8ca1d2eff082509790dd8ba1926ea51.1708345640.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): Use copy-build system.

Change-Id: I6de2827c63cb454d80b20f3af84fa610a75172f4
---
gnu/packages/messaging.scm | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 9cc90c588b..3f39900c44 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -144,6 +144,7 @@ (define-module (gnu packages messaging)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system go)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system gnu)
@@ -1600,18 +1601,11 @@ (define (prosody-module module-name)
(sha256
(base32
"142wrcism70nf8ffahhd961cqg2pi1h7ic8adfs3zwh0j3pnf41f"))))
- (build-system trivial-build-system)
+ (build-system copy-build-system)
(arguments
- '(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((out (assoc-ref %outputs "out"))
- (source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source module-name)
- (install-file (string-append module-name ".lua") out))
- #t))))
- (home-page #f)
+ `(#:install-plan '((,(string-append module-name "/") "."))))
+ (home-page (string-append "https://modules.prosody.im/"
+ module-name ".html"))
(synopsis #f)
(description #f)
(license (package-license prosody)))))
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 13:34 +0100
[PATCH 3/4] gnu: Update prosody modules to the newest revision.
(address . 69272@debbugs.gnu.org)
9777065af632fd021fa1be2c9ec641fe941ab16c.1708345640.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): Update to fba64b043c52.

Change-Id: I012c2f661200cc59ae088e522ac233c09d77d2af
---
gnu/packages/messaging.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 3f39900c44..f360e69fcb 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1580,8 +1580,8 @@ (define-public prosody
(license license:x11)))
(define (prosody-module module-name)
- (let ((changeset "765735bb590b")
- (revision "1")
+ (let ((changeset "fba64b043c52")
+ (revision "2")
(package-name (string-append
"prosody-"
(string-replace-substring
@@ -1600,7 +1600,7 @@ (define (prosody-module module-name)
(file-name (string-append name "-" version "-checkout"))
(sha256
(base32
- "142wrcism70nf8ffahhd961cqg2pi1h7ic8adfs3zwh0j3pnf41f"))))
+ "1nvka8s3zqs97jqsknhp2q956rrdga1qaxa1y3i0h8zx3g9vgdch"))))
(build-system copy-build-system)
(arguments
`(#:install-plan '((,(string-append module-name "/") "."))))
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 13:34 +0100
[PATCH 4/4] gnu: Add prosody-vcard-muc.
(address . 69272@debbugs.gnu.org)
e4e517dd14b3ecd28c0f31f8b492192de8106705.1708345640.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-vcard-muc): New variable.

Change-Id: I57eae8373369e7e954084803fd7b861ab85ce4ad
---
gnu/packages/messaging.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index f360e69fcb..03b7368ae0 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1625,6 +1625,13 @@ (define-public prosody-smacks
the client and server, it can allow clients to resume a disconnected session,
and prevent message loss.")))
+(define-public prosody-vcard-muc
+ (package
+ (inherit (prosody-module "mod_vcard_muc"))
+ (synopsis "Support for MUC vCards and avatars")
+ (description "This module adds the ability to set vCard for MUC rooms. One
+of the most common use cases is to define avatars for MUC rooms.")))
+
(define-public libtoxcore
(let ((revision "2")
(commit "bf69b54f64003d160d759068f4816b2d9b2e1e21"))
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 22:44 +0100
[PATCH v2 0/4] Refactor prosody modules, and add prosody-vcard-muc.
(address . 69272@debbugs.gnu.org)
cover.1708379059.git.carlo@zancanaro.id.au
I noticed that the home-page line snuck out of the first commit and
ended up in the second. This should be better.

Carlo Zancanaro (4):
gnu: Extract prosody-module from existing prosody modules.
gnu: Use copy-build-system for prosody modules.
gnu: Update prosody modules to the newest revision.
gnu: Add prosody-vcard-muc.

gnu/packages/messaging.scm | 88 +++++++++++++++++---------------------
1 file changed, 39 insertions(+), 49 deletions(-)


base-commit: 07ecdb99b6c4b6b3e993d08034138bf69414020b
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 22:44 +0100
[PATCH v2 1/4] gnu: Extract prosody-module from existing prosody modules.
(address . 69272@debbugs.gnu.org)
55c015b018c39d59922c916574eb59de27f9a353.1708379059.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): New procedure.
(prosody-http-upload, prosody-smacks): Use it.

Change-Id: I55c69104460adbbd89c491b18f9f22681aefb92a
---
The only change from v1 is to properly define home-page in prosody-module.

gnu/packages/messaging.scm | 70 ++++++++++++++++----------------------
1 file changed, 30 insertions(+), 40 deletions(-)

Toggle diff (103 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 98c1c9bf67..d06cd74177 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -40,6 +40,7 @@
;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2024 Carlo Zancanaro <carlo@zancanaro.id.au>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1577,11 +1578,18 @@ (define-public prosody
protocols.")
(license license:x11)))
-(define-public prosody-http-upload
+(define (prosody-module module-name)
(let ((changeset "765735bb590b")
- (revision "1"))
+ (revision "1")
+ (package-name (string-append
+ "prosody-"
+ (string-replace-substring
+ (if (string-prefix? "mod_" module-name)
+ (substring module-name 4)
+ module-name)
+ "_" "-"))))
(package
- (name "prosody-http-upload")
+ (name package-name)
(version (string-append "0-" revision "." (string-take changeset 7)))
(source (origin
(method hg-fetch)
@@ -1600,47 +1608,29 @@ (define-public prosody-http-upload
(use-modules (guix build utils))
(let ((out (assoc-ref %outputs "out"))
(source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source "mod_http_upload")
- (install-file "mod_http_upload.lua" out))
+ (with-directory-excursion (in-vicinity source module-name)
+ (install-file (string-append module-name ".lua") out))
#t))))
- (home-page "https://modules.prosody.im/mod_http_upload.html")
- (synopsis "XEP-0363: Allow clients to upload files over HTTP")
- (description "This module implements XEP-0363: it allows clients to
-upload files over HTTP.")
+ (home-page (string-append "https://modules.prosody.im/"
+ module-name ".html"))
+ (synopsis #f)
+ (description #f)
(license (package-license prosody)))))
-(define-public prosody-smacks
- (let ((changeset "67f1d1f22625")
- (revision "1"))
- (package
- (name "prosody-smacks")
- (version (string-append "0-" revision "." (string-take changeset 7)))
- (source (origin
- (method hg-fetch)
- (uri (hg-reference
- (url "https://hg.prosody.im/prosody-modules/")
- (changeset changeset)))
- (file-name (string-append name "-" version "-checkout"))
- (sha256
- (base32
- "020ngpax30fgarah98yvlj0ni8rcdwq60if03a9hqdw8mic0nxxs"))))
- (build-system trivial-build-system)
- (arguments
- '(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((out (assoc-ref %outputs "out"))
- (source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source "mod_smacks")
- (install-file "mod_smacks.lua" out))
- #t))))
- (home-page "https://modules.prosody.im/mod_smacks.html")
- (synopsis "XEP-0198: Reliability and fast reconnects for XMPP")
- (description "This module implements XEP-0198: when supported by both
+(define-public prosody-http-upload
+ (package
+ (inherit (prosody-module "mod_http_upload"))
+ (synopsis "XEP-0363: Allow clients to upload files over HTTP")
+ (description "This module implements XEP-0363: it allows clients to
+upload files over HTTP.")))
+
+(define-public prosody-smack
+ (package
+ (inherit (prosody-module "mod_smacks"))
+ (synopsis "XEP-0198: Reliability and fast reconnects for XMPP")
+ (description "This module implements XEP-0198: when supported by both
the client and server, it can allow clients to resume a disconnected session,
-and prevent message loss.")
- (license (package-license prosody)))))
+and prevent message loss.")))
(define-public libtoxcore
(let ((revision "2")
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 22:44 +0100
[PATCH v2 2/4] gnu: Use copy-build-system for prosody modules.
(address . 69272@debbugs.gnu.org)
6bf5ba79c63dc0e6e5cc46e5a89f020aa8a790e3.1708379059.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): Use copy-build system.

Change-Id: I6de2827c63cb454d80b20f3af84fa610a75172f4
---
The only change from v1 is to remove the home-page definition from
this diff (because it's now in the earlier patch).

gnu/packages/messaging.scm | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index d06cd74177..3dd1e66e81 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -144,6 +144,7 @@ (define-module (gnu packages messaging)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system go)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system gnu)
@@ -1600,17 +1601,9 @@ (define (prosody-module module-name)
(sha256
(base32
"142wrcism70nf8ffahhd961cqg2pi1h7ic8adfs3zwh0j3pnf41f"))))
- (build-system trivial-build-system)
+ (build-system copy-build-system)
(arguments
- '(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((out (assoc-ref %outputs "out"))
- (source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source module-name)
- (install-file (string-append module-name ".lua") out))
- #t))))
+ `(#:install-plan '((,(string-append module-name "/") "."))))
(home-page (string-append "https://modules.prosody.im/"
module-name ".html"))
(synopsis #f)
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 22:44 +0100
[PATCH v2 3/4] gnu: Update prosody modules to the newest revision.
(address . 69272@debbugs.gnu.org)
f782d1ac6bfde5bb2226f01bec54a13064d2fde6.1708379059.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): Update to fba64b043c52.

Change-Id: I012c2f661200cc59ae088e522ac233c09d77d2af
---
gnu/packages/messaging.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 3dd1e66e81..ef009577c4 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1580,8 +1580,8 @@ (define-public prosody
(license license:x11)))
(define (prosody-module module-name)
- (let ((changeset "765735bb590b")
- (revision "1")
+ (let ((changeset "fba64b043c52")
+ (revision "2")
(package-name (string-append
"prosody-"
(string-replace-substring
--
2.41.0
C
C
Carlo Zancanaro wrote on 19 Feb 22:44 +0100
[PATCH v2 4/4] gnu: Add prosody-vcard-muc.
(address . 69272@debbugs.gnu.org)
fbf74cdc2091a7a97402f7aeeabf22e748928d2e.1708379059.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-vcard-muc): New variable.

Change-Id: I57eae8373369e7e954084803fd7b861ab85ce4ad
---
gnu/packages/messaging.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index ef009577c4..421a7afd78 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1625,6 +1625,13 @@ (define-public prosody-smack
the client and server, it can allow clients to resume a disconnected session,
and prevent message loss.")))
+(define-public prosody-vcard-muc
+ (package
+ (inherit (prosody-module "mod_vcard_muc"))
+ (synopsis "Support for MUC vCards and avatars")
+ (description "This module adds the ability to set vCard for MUC rooms. One
+of the most common use cases is to define avatars for MUC rooms.")))
+
(define-public libtoxcore
(let ((revision "2")
(commit "bf69b54f64003d160d759068f4816b2d9b2e1e21"))
--
2.41.0
L
L
Liliana Marie Prikler wrote on 24 Feb 12:32 +0100
Re: [PATCH v2 0/4] Refactor prosody modules, and add prosody-vcard-muc.
1d9b2c49f4c3870103bd3417286f754418deff0f.camel@gmail.com
Am Dienstag, dem 20.02.2024 um 08:44 +1100 schrieb Carlo Zancanaro:
Toggle quote (2 lines)
> I noticed that the home-page line snuck out of the first commit and
> ended up in the second. This should be better.
Hi, I just noticed that the prosody system test, as can be run through
make check-system TESTS=prosody
appears to not be working.

Now, it does print a warning
Prosody was unable to find lua-unbound
[…]
but I think you can ignore that. What's worse is that despite
seemingly having a timeout of one minute for its operations, it just…
stalls.

You might want to fix that and also add a test for the vcard-muc you
added.

Cheers
L
L
Liliana Marie Prikler wrote on 24 Feb 13:50 +0100
Re: [bug#69272] [PATCH v2 0/4] Refactor prosody modules, and add prosody-vcard-muc.
(name . Carlo Zancanaro)(address . carlo@zancanaro.id.au)(address . 69272@debbugs.gnu.org)
b67af9f1e683a0e6d08842355f09540eac67f68a.camel@gmail.com
Am Samstag, dem 24.02.2024 um 22:58 +1100 schrieb Carlo Zancanaro:
Toggle quote (4 lines)
> Fixing this test is beyond the scope of this patch series, and as far
> as I can tell there are no tests for other specific prosody modules.
> At the moment I don't really have the time/inclination to add these
> things.  
That's fine and relatable.

Toggle quote (2 lines)
> If that is a blocker for this patch series being accepted then I'll
> just keep it in my own channel for now.
Not really, but I would have been more confident in fast-tracking this
if there was a test case attached to it. I'll give it one more week on
the ML if no one else wants to push it.

Cheers
L
L
Liliana Marie Prikler wrote on 24 Feb 13:44 +0100
Re: [PATCH v2 0/4] Refactor prosody modules, and add prosody-vcard-muc.
2831bfc9561871e584f32d64b6d5ee596fe81473.camel@gmail.com
Am Samstag, dem 24.02.2024 um 12:32 +0100 schrieb Liliana Marie
Prikler:
Toggle quote (14 lines)
> Am Dienstag, dem 20.02.2024 um 08:44 +1100 schrieb Carlo Zancanaro:
> > I noticed that the home-page line snuck out of the first commit and
> > ended up in the second. This should be better.
> Hi, I just noticed that the prosody system test, as can be run
> through
>   make check-system TESTS=prosody
> appears to not be working.
>
> Now, it does print a warning
>   Prosody was unable to find lua-unbound
>   […]
> but I think you can ignore that.  What's worse is that despite
> seemingly having a timeout of one minute for its operations, it just…
> stalls.
Turns out I should have just waited longer. Both without and with your
patches, the failure is

Test begin:
test-name: "client-to-server communication"
source-file: "/gnu/store/wqrrwk1w5wn4hdniffj3gsb91h3fpirl-prosody-
builder"
source-line: 1
source-form: (test-assert "client-to-server communication" (let
((freetalk-bin (string-append
"/gnu/store/9zl6dl4s2b57qax0ablavxbpk1h0aq9h-freetalk-4.2" )
Test end:
result-kind: fail
actual-value: #f
actual-error: (misc-error #f "~A ~S" ("file didn't show up"
"/tmp/freetalk-witness") #f)

Cheers
C
C
Carlo Zancanaro wrote on 24 Feb 12:58 +0100
Re: [bug#69272] [PATCH v2 0/4] Refactor prosody modules, and add prosody-vcard-muc.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 69272@debbugs.gnu.org)
87plwmnkf1.fsf@zancanaro.id.au
Hi Liliana,

On Sat, Feb 24 2024, Liliana Marie Prikler wrote:
Toggle quote (4 lines)
> Hi, I just noticed that the prosody system test, as can be run through
> make check-system TESTS=prosody
> appears to not be working.

That is unfortunate, but seems unrelated to my patch. Running this test
without my changes also hangs.

Toggle quote (3 lines)
> You might want to fix that and also add a test for the vcard-muc you
> added.

Fixing this test is beyond the scope of this patch series, and as far as
I can tell there are no tests for other specific prosody modules. At the
moment I don't really have the time/inclination to add these things. If
that is a blocker for this patch series being accepted then I'll just
keep it in my own channel for now.

Carlo
L
L
Liliana Marie Prikler wrote on 2 Mar 07:42 +0100
Re: [PATCH v2 4/4] gnu: Add prosody-vcard-muc.
c7991e17029f37cf5b64a311a0047d0f52a2d4a4.camel@gmail.com
Hi,

Am Dienstag, dem 20.02.2024 um 08:44 +1100 schrieb Carlo Zancanaro:
Toggle quote (24 lines)
> * gnu/packages/messaging.scm (prosody-vcard-muc): New variable.
>
> Change-Id: I57eae8373369e7e954084803fd7b861ab85ce4ad
> ---
>  gnu/packages/messaging.scm | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
> index ef009577c4..421a7afd78 100644
> --- a/gnu/packages/messaging.scm
> +++ b/gnu/packages/messaging.scm
> @@ -1625,6 +1625,13 @@ (define-public prosody-smack
>  the client and server, it can allow clients to resume a disconnected
> session,
>  and prevent message loss.")))
>  
> +(define-public prosody-vcard-muc
> +  (package
> +    (inherit (prosody-module "mod_vcard_muc"))
> +    (synopsis "Support for MUC vCards and avatars")
> +    (description "This module adds the ability to set vCard for MUC
> rooms. One
> +of the most common use cases is to define avatars for MUC rooms.")))
> +
Trying to build this locally, I get a hash mismatch for the checkout.

expected hash: 142wrcism70nf8ffahhd961cqg2pi1h7ic8adfs3zwh0j3pnf41f
actual hash: 1nvka8s3zqs97jqsknhp2q956rrdga1qaxa1y3i0h8zx3g9vgdch

Do the hashes on prosody change that quickly?
C
C
Carlo Zancanaro wrote on 2 Mar 12:27 +0100
Re: [bug#69272] [PATCH v2 4/4] gnu: Add prosody-vcard-muc.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 69272@debbugs.gnu.org)
87v864j2kq.fsf@zancanaro.id.au
Hi Liliana,

On Sat, Mar 02 2024, Liliana Marie Prikler wrote:
Toggle quote (2 lines)
> Do the hashes on prosody change that quickly?

Nope! This is using a mercurial checkout, so the hashes shouldn't change
at all. I just made a mistake in my commits. Patch 3/4 in v2 updates the
changeset and revision, but not the expected hash. I'm not sure how I
messed this up, given patch 3/4 in v1 updated the hash.

The actual hash that you got is the same as my v1 patch:
1nvka8s3zqs97jqsknhp2q956rrdga1qaxa1y3i0h8zx3g9vgdch

I'll send through a v3 today.

Carlo

P.S. Apologies that you'll get this message twice. I forgot to Cc the
bug tracer on the first attempt.
C
C
Carlo Zancanaro wrote on 2 Mar 12:35 +0100
[PATCH v3 1/4] gnu: Extract prosody-module from existing prosody modules.
(address . 69272@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
cf3a556d4e292d48773aad25b5eac65674ca5d57.1709379315.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): New procedure.
(prosody-http-upload, prosody-smacks): Use it.

Change-Id: I55c69104460adbbd89c491b18f9f22681aefb92a
---
gnu/packages/messaging.scm | 69 ++++++++++++++++----------------------
1 file changed, 29 insertions(+), 40 deletions(-)

Toggle diff (104 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 98c1c9bf67..35e11fb5dc 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -40,6 +40,7 @@
;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2024 Carlo Zancanaro <carlo@zancanaro.id.au>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1577,11 +1578,18 @@ (define-public prosody
protocols.")
(license license:x11)))
-(define-public prosody-http-upload
+(define (prosody-module module-name)
(let ((changeset "765735bb590b")
- (revision "1"))
+ (revision "1")
+ (package-name (string-append
+ "prosody-"
+ (string-replace-substring
+ (if (string-prefix? "mod_" module-name)
+ (substring module-name 4)
+ module-name)
+ "_" "-"))))
(package
- (name "prosody-http-upload")
+ (name package-name)
(version (string-append "0-" revision "." (string-take changeset 7)))
(source (origin
(method hg-fetch)
@@ -1600,47 +1608,28 @@ (define-public prosody-http-upload
(use-modules (guix build utils))
(let ((out (assoc-ref %outputs "out"))
(source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source "mod_http_upload")
- (install-file "mod_http_upload.lua" out))
+ (with-directory-excursion (in-vicinity source module-name)
+ (install-file (string-append module-name ".lua") out))
#t))))
- (home-page "https://modules.prosody.im/mod_http_upload.html")
- (synopsis "XEP-0363: Allow clients to upload files over HTTP")
- (description "This module implements XEP-0363: it allows clients to
-upload files over HTTP.")
+ (home-page #f)
+ (synopsis #f)
+ (description #f)
(license (package-license prosody)))))
-(define-public prosody-smacks
- (let ((changeset "67f1d1f22625")
- (revision "1"))
- (package
- (name "prosody-smacks")
- (version (string-append "0-" revision "." (string-take changeset 7)))
- (source (origin
- (method hg-fetch)
- (uri (hg-reference
- (url "https://hg.prosody.im/prosody-modules/")
- (changeset changeset)))
- (file-name (string-append name "-" version "-checkout"))
- (sha256
- (base32
- "020ngpax30fgarah98yvlj0ni8rcdwq60if03a9hqdw8mic0nxxs"))))
- (build-system trivial-build-system)
- (arguments
- '(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((out (assoc-ref %outputs "out"))
- (source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source "mod_smacks")
- (install-file "mod_smacks.lua" out))
- #t))))
- (home-page "https://modules.prosody.im/mod_smacks.html")
- (synopsis "XEP-0198: Reliability and fast reconnects for XMPP")
- (description "This module implements XEP-0198: when supported by both
+(define-public prosody-http-upload
+ (package
+ (inherit (prosody-module "mod_http_upload"))
+ (synopsis "XEP-0363: Allow clients to upload files over HTTP")
+ (description "This module implements XEP-0363: it allows clients to
+upload files over HTTP.")))
+
+(define-public prosody-smack
+ (package
+ (inherit (prosody-module "mod_smacks"))
+ (synopsis "XEP-0198: Reliability and fast reconnects for XMPP")
+ (description "This module implements XEP-0198: when supported by both
the client and server, it can allow clients to resume a disconnected session,
-and prevent message loss.")
- (license (package-license prosody)))))
+and prevent message loss.")))
(define-public libtoxcore
(let ((revision "2")

base-commit: 4a0549be52f3f46fbce61342d8de30f7b83130c5
--
2.41.0
C
C
Carlo Zancanaro wrote on 2 Mar 12:35 +0100
[PATCH v3 2/4] gnu: Use copy-build-system for prosody modules.
(address . 69272@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
027b22fdcfe21c50a3870c94a3b0e1f61fb4ea9e.1709379315.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): Use copy-build system.

Change-Id: I6de2827c63cb454d80b20f3af84fa610a75172f4
---
gnu/packages/messaging.scm | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 35e11fb5dc..3dd1e66e81 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -144,6 +144,7 @@ (define-module (gnu packages messaging)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system go)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system gnu)
@@ -1600,18 +1601,11 @@ (define (prosody-module module-name)
(sha256
(base32
"142wrcism70nf8ffahhd961cqg2pi1h7ic8adfs3zwh0j3pnf41f"))))
- (build-system trivial-build-system)
+ (build-system copy-build-system)
(arguments
- '(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((out (assoc-ref %outputs "out"))
- (source (assoc-ref %build-inputs "source")))
- (with-directory-excursion (in-vicinity source module-name)
- (install-file (string-append module-name ".lua") out))
- #t))))
- (home-page #f)
+ `(#:install-plan '((,(string-append module-name "/") "."))))
+ (home-page (string-append "https://modules.prosody.im/"
+ module-name ".html"))
(synopsis #f)
(description #f)
(license (package-license prosody)))))
--
2.41.0
C
C
Carlo Zancanaro wrote on 2 Mar 12:35 +0100
[PATCH v3 3/4] gnu: Update prosody modules to the newest revision.
(address . 69272@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
129fe7a78ae6fb061ff63761e1f987d2e4b0374d.1709379315.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-module): Update to fba64b043c52.

Change-Id: I012c2f661200cc59ae088e522ac233c09d77d2af
---
gnu/packages/messaging.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 3dd1e66e81..2e665f47e3 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1580,8 +1580,8 @@ (define-public prosody
(license license:x11)))
(define (prosody-module module-name)
- (let ((changeset "765735bb590b")
- (revision "1")
+ (let ((changeset "fba64b043c52")
+ (revision "2")
(package-name (string-append
"prosody-"
(string-replace-substring
@@ -1600,7 +1600,7 @@ (define (prosody-module module-name)
(file-name (string-append name "-" version "-checkout"))
(sha256
(base32
- "142wrcism70nf8ffahhd961cqg2pi1h7ic8adfs3zwh0j3pnf41f"))))
+ "1nvka8s3zqs97jqsknhp2q956rrdga1qaxa1y3i0h8zx3g9vgdch"))))
(build-system copy-build-system)
(arguments
`(#:install-plan '((,(string-append module-name "/") "."))))
--
2.41.0
C
C
Carlo Zancanaro wrote on 2 Mar 12:35 +0100
[PATCH v3 4/4] gnu: Add prosody-vcard-muc.
(address . 69272@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
99747d7eb10ade26e39478f8e0cdfb03f20fc593.1709379315.git.carlo@zancanaro.id.au
* gnu/packages/messaging.scm (prosody-vcard-muc): New variable.

Change-Id: I57eae8373369e7e954084803fd7b861ab85ce4ad
---
gnu/packages/messaging.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 2e665f47e3..aa9feffb97 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1625,6 +1625,13 @@ (define-public prosody-smack
the client and server, it can allow clients to resume a disconnected session,
and prevent message loss.")))
+(define-public prosody-vcard-muc
+ (package
+ (inherit (prosody-module "mod_vcard_muc"))
+ (synopsis "Support for MUC vCards and avatars")
+ (description "This module adds the ability to set vCard for MUC rooms. One
+of the most common use cases is to define avatars for MUC rooms.")))
+
(define-public libtoxcore
(let ((revision "2")
(commit "bf69b54f64003d160d759068f4816b2d9b2e1e21"))
--
2.41.0
L
L
Liliana Marie Prikler wrote on 2 Mar 14:00 +0100
Re: [bug#69272] [PATCH v2 4/4] gnu: Add prosody-vcard-muc.
(name . Carlo Zancanaro)(address . carlo@zancanaro.id.au)(address . 69272-done@debbugs.gnu.org)
c90b839bacd2035585e61a22f807e01b84d75404.camel@gmail.com
Am Samstag, dem 02.03.2024 um 22:27 +1100 schrieb Carlo Zancanaro:
Toggle quote (2 lines)
> P.S. Apologies that you'll get this message twice. I forgot to Cc the
> bug tracer on the first attempt.
Apologies from me for not checking earlier.

Pushed now, thanks!
Closed
C
C
Carlo Zancanaro wrote on 3 Mar 05:07 +0100
Re: bug#69272: [PATCH v2 4/4] gnu: Add prosody-vcard-muc.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 69272@debbugs.gnu.org)
87a5ngez52.fsf@zancanaro.id.au
On Sat, Mar 02 2024, Liliana Marie Prikler wrote:
Toggle quote (2 lines)
> Pushed now, thanks!

Unfortunately I've discovered another silly mistake:
bca48fdef48150a3c4e96e3941feb1986ea3e631 refactored things, but
accidentally changed the "prosody-smacks" package's variable name to
"prosody-smack".

I can put together a patch to change this back, but I don't have time to
do so right now. If anyone else gets to it before me then please feel
free to fix it! ?

Carlo
?
Your comment

This issue is archived.

To comment on this conversation send an email to 69272@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69272
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch