all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: 69272@debbugs.gnu.org
Cc: Liliana Marie Prikler <liliana.prikler@gmail.com>
Subject: [bug#69272] [PATCH v3 1/4] gnu: Extract prosody-module from existing prosody modules.
Date: Sat,  2 Mar 2024 22:35:12 +1100	[thread overview]
Message-ID: <cf3a556d4e292d48773aad25b5eac65674ca5d57.1709379315.git.carlo@zancanaro.id.au> (raw)
In-Reply-To: <87v864j2kq.fsf@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(-)

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





  reply	other threads:[~2024-03-02 11:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 12:31 [bug#69272] [PATCH 0/4] Refactor prosody modules, and add prosody-vcard-muc Carlo Zancanaro
2024-02-19 12:34 ` [bug#69272] [PATCH 1/4] gnu: Extract prosody-module from existing prosody modules Carlo Zancanaro
2024-02-19 12:34 ` [bug#69272] [PATCH 2/4] gnu: Use copy-build-system for " Carlo Zancanaro
2024-02-19 12:34 ` [bug#69272] [PATCH 3/4] gnu: Update prosody modules to the newest revision Carlo Zancanaro
2024-02-19 12:34 ` [bug#69272] [PATCH 4/4] gnu: Add prosody-vcard-muc Carlo Zancanaro
2024-02-19 21:44 ` [bug#69272] [PATCH v2 0/4] Refactor prosody modules, and add prosody-vcard-muc Carlo Zancanaro
2024-02-24 11:32   ` Liliana Marie Prikler
2024-02-24 11:58     ` Carlo Zancanaro
2024-02-24 12:50       ` Liliana Marie Prikler
2024-02-24 12:44     ` Liliana Marie Prikler
2024-02-19 21:44 ` [bug#69272] [PATCH v2 1/4] gnu: Extract prosody-module from existing prosody modules Carlo Zancanaro
2024-02-19 21:44 ` [bug#69272] [PATCH v2 2/4] gnu: Use copy-build-system for " Carlo Zancanaro
2024-02-19 21:44 ` [bug#69272] [PATCH v2 3/4] gnu: Update prosody modules to the newest revision Carlo Zancanaro
2024-02-19 21:44 ` [bug#69272] [PATCH v2 4/4] gnu: Add prosody-vcard-muc Carlo Zancanaro
2024-03-02  6:42   ` Liliana Marie Prikler
2024-03-02 11:27     ` Carlo Zancanaro
2024-03-02 11:35       ` Carlo Zancanaro [this message]
2024-03-02 11:35       ` [bug#69272] [PATCH v3 2/4] gnu: Use copy-build-system for prosody modules Carlo Zancanaro
2024-03-02 11:35       ` [bug#69272] [PATCH v3 3/4] gnu: Update prosody modules to the newest revision Carlo Zancanaro
2024-03-02 11:35       ` [bug#69272] [PATCH v3 4/4] gnu: Add prosody-vcard-muc Carlo Zancanaro
2024-03-02 13:00       ` bug#69272: [PATCH v2 " Liliana Marie Prikler
2024-03-03  4:07         ` [bug#69272] " Carlo Zancanaro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf3a556d4e292d48773aad25b5eac65674ca5d57.1709379315.git.carlo@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=69272@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.