From patchwork Mon Aug 5 10:45:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Igor Goryachev X-Patchwork-Id: 66771 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BFED327BBE9; Mon, 5 Aug 2024 11:48:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 034EC27BBE2 for ; Mon, 5 Aug 2024 11:48:00 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1savEs-0001Fv-1t; Mon, 05 Aug 2024 06:46:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1savEp-0001BU-3n for guix-patches@gnu.org; Mon, 05 Aug 2024 06:46:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1savEo-0000VT-R8 for guix-patches@gnu.org; Mon, 05 Aug 2024 06:46:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Ucc9vDe+LP/dM/kvpH9/9SUeQB8P34WthI8z27xb8QI=; b=cLWnGS0F3BMz8zuapORurIMXk0SulEdwfWk8jggcE4nNxxFmIc2f1fYSGYlhXn6gktCL3/Df1V2SOb9K24uAX5HSydSGhmammiX1WMc4h0cP9IoAPdEIreHpf5hhl6GECfQrnUP/VO6bUuvNkJMKja/qoOUBa1GMbrIFlWhUgGaTsjwXF1x2tbSitm7at+lws9rjsXxaX5pL3HYHZ8KvHw6YrjNNIGZOOl4ETajZzYZqG+4LI051jtDZ1/4tgQmlDnQtLYDWkWCxjN1z1TixBovbblgr9v6ezAeEhQnuSziXrcIuzXDkso1+LkXHDOnhMttSalMZ9K41FGh4Ubiy5g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1savFB-0000J4-2E for guix-patches@gnu.org; Mon, 05 Aug 2024 06:47:13 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72474] [PATCH 30/30] gnu: Add ejabberd. Resent-From: Igor Goryachev Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Aug 2024 10:47:13 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72474 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72474@debbugs.gnu.org Cc: Igor Goryachev , Andrew Tropin Received: via spool by 72474-submit@debbugs.gnu.org id=B72474.1722854800902 (code B ref 72474); Mon, 05 Aug 2024 10:47:13 +0000 Received: (at 72474) by debbugs.gnu.org; 5 Aug 2024 10:46:40 +0000 Received: from localhost ([127.0.0.1]:58059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1savEd-0000EL-3P for submit@debbugs.gnu.org; Mon, 05 Aug 2024 06:46:39 -0400 Received: from mail.goryachev.org ([178.62.244.128]:39144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1savEV-00009W-OS for 72474@debbugs.gnu.org; Mon, 05 Aug 2024 06:46:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=dkim; bh=tNV/T/e7TaYsFSv RkjmWGMmexQ7n89OelNhHaKoGVdc=; h=references:in-reply-to:date:subject: cc:to:from; d=goryachev.org; b=bNzkfzWb7pdwx1AK5VjZFkFOtcTuGkrrL4AlBZ7 Mb+cFNIxXsY3AikoOnFyPGWkymbfZjJkq9w11wcAJWVm1Gj41d7KVBkP1RkxLaMLY/O2SF BvOLvt3Hs2G3Drm+INgLhvWbr4amrZXe7uHLwVmuljqGnD6k+5xH8KvnEDx97w= Received: by mail.goryachev.org (OpenSMTPD) with ESMTPSA id 1a1e9c28 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 5 Aug 2024 10:46:04 +0000 (UTC) Date: Mon, 5 Aug 2024 13:45:03 +0300 Message-ID: <771ba2c109b39bc9419cb3bb3e2d5efed6c24184.1722851684.git.igor@goryachev.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Igor Goryachev X-ACL-Warn: , Igor Goryachev via Guix-patches X-Patchwork-Original-From: Igor Goryachev via Guix-patches via From: Igor Goryachev Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/messaging.scm (ejabberd): New variable. Change-Id: Ia2d5201f02205debfcbf1eebf24761c0c5fceae6 --- gnu/packages/messaging.scm | 134 +++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 7dd1c3765a..92e327d507 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -43,6 +43,7 @@ ;;; Copyright © 2024 Carlo Zancanaro ;;; Copyright © 2024 Wilko Meyer ;;; Copyright © 2024 Ashish SHUKLA +;;; Copyright © 2024 Igor Goryachev ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,8 @@ (define-module (gnu packages messaging) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) #:use-module (gnu packages enchant) + #:use-module (gnu packages erlang) + #:use-module (gnu packages erlang-xyz) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gettext) @@ -157,6 +160,7 @@ (define-module (gnu packages messaging) #:use-module (guix build-system perl) #:use-module (guix build-system python) #:use-module (guix build-system pyproject) + #:use-module (guix build-system rebar) #:use-module (guix build-system qt) #:use-module (guix build-system trivial) #:use-module (guix download) @@ -3627,4 +3631,134 @@ (define-public senpai "@code{senpai} is an IRC client that works best with bouncers.") (license license:isc))) +(define-public ejabberd + (package + (name "ejabberd") + (version "24.07") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/processone/ejabberd") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0d5i9skgfjzs2100k0g99sigc2w61480ysz3va6pmb4nx43100g3")))) + (build-system rebar-build-system) + (native-inputs + (list autoconf + automake + erlang-base64url + erlang-cache-tab + erlang-eimp + erlang-epam + erlang-eredis + erlang-esip + erlang-ezlib + erlang-fast-tls + erlang-fast-xml + erlang-fast-yaml + erlang-idna + erlang-jiffy + erlang-jose + erlang-luerl + erlang-mqtree + erlang-p1-acme + erlang-p1-mysql + erlang-p1-oauth2 + erlang-p1-pgsql + erlang-p1-utils + erlang-pc + erlang-pkix + erlang-provider-asn1 + erlang-stringprep + erlang-stun + erlang-sqlite3 + erlang-unicode-util-compat + erlang-xmpp + erlang-yconf)) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-environment + (lambda _ + (setenv "HOME" "/tmp") + (setenv "CC" "gcc"))) + (add-after 'unpack 'bootstrap + (lambda _ + (invoke "aclocal" "-I" "m4") + (invoke "autoconf" "-f"))) + (add-after 'bootstrap 'make-various-fixes + (lambda* (#:key inputs #:allow-other-keys) + (let ((sh (search-input-file inputs "/bin/sh"))) + ;; Fix shell locations. + (substitute* "configure" (("/bin/sh") sh)) + (substitute* "rebar.config.script" + (("sh -c '") (string-append sh " -c '"))) + ;; Do not recompile dependences. + (substitute* "rebar.config" + (("\\[\\{\"eimp\", \\[\\]\\},") "[]}.\n{nop, [")) + ;; Do not include source files into release. + (substitute* "rebar.config" + (("\\{include_src, true\\},") "{include_src, false},")) + ;; Do not install erl wrapper, we will do it ourselves. + (substitute* "rebar.config" + (("\\{copy, \"rel/files/erl\",") + "%{copy, \"rel/files/erl\",")) + ;; Unpin pinned dependences. + (substitute* "rebar.lock" + ((",1\\}") ",0}")) + ;; Set proper paths. + (substitute* "vars.config.in" + (("\\{sysconfdir, \".*\"\\}\\.") + "{sysconfdir, \"/etc\"}.")) + (substitute* "vars.config.in" + (("\\{localstatedir, \".*\"\\}\\.") + "{sysconfdir, \"/var\"}.")) + (substitute* "vars.config.in" + (("\\{config_dir, \".*\"\\}\\.") + "{config_dir, \"/etc/ejabberd\"}.")) + (substitute* "vars.config.in" + (("\\{logs_dir, \".*\"\\}\\.") + "{logs_dir, \"/var/log/ejabberd\"}.")) + (substitute* "vars.config.in" + (("\\{spool_dir, \".*\"\\}\\.") + "{spool_dir, \"/var/lib/ejabberd\"}."))))) + (add-after 'make-various-fixes 'configure + (lambda _ + (invoke "./configure" + (string-append "--prefix=" #$output)))) + (replace 'build + (lambda _ + (invoke "make" "rel"))) + (replace 'install + (lambda _ + (let ((ejabberd "_build/prod/rel/ejabberd")) + (copy-recursively + (string-append ejabberd "/conf") + (string-append ejabberd "/share/doc/ejabberd-" + #$version "/examples")) + (for-each + (lambda (rmdir) + (delete-file-recursively + (string-append ejabberd "/" rmdir))) + '("conf" "database" "logs")) + (delete-file + (string-append (string-append ejabberd "/ejabberd-" + #$version ".tar.gz"))) + (let ((erts (car (find-files ejabberd "erts-.*" + #:directories? #t)))) + (delete-file (string-append erts "/bin/erl")) + (install-file "rel/files/erl" + (string-append erts "/bin"))) + (chmod (string-append ejabberd + "/bin/install_upgrade.escript") #o755) + (copy-recursively ejabberd #$output))))))) + (synopsis "Robust, Ubiquitous and Massively Scalable Messaging Platform") + (description "This package provides Ejabberd -- Robust, Ubiquitous and +Massively Scalable Messaging Platform. It supports XMPP, MQTT and SIP protocols.") + (home-page "https://www.ejabberd.im") + (license license:gpl2+))) + ;;; messaging.scm ends here