From patchwork Sat Oct 30 20:25:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 34180 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 1678627BBE3; Sat, 30 Oct 2021 21:26:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 73C5B27BBE1 for ; Sat, 30 Oct 2021 21:26:10 +0100 (BST) Received: from localhost ([::1]:38094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mguvZ-0001WH-I4 for patchwork@mira.cbaines.net; Sat, 30 Oct 2021 16:26:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mguvS-0001UC-Gv for guix-patches@gnu.org; Sat, 30 Oct 2021 16:26:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mguvS-0005eF-8q for guix-patches@gnu.org; Sat, 30 Oct 2021 16:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mguvS-0001DV-6D for guix-patches@gnu.org; Sat, 30 Oct 2021 16:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51520] [PATCH 2/3] gnu: Add weechat-matrix. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 20:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51520 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51520@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 51520-submit@debbugs.gnu.org id=B51520.16356255284623 (code B ref 51520); Sat, 30 Oct 2021 20:26:02 +0000 Received: (at 51520) by debbugs.gnu.org; 30 Oct 2021 20:25:28 +0000 Received: from localhost ([127.0.0.1]:58505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mguun-0001CB-D0 for submit@debbugs.gnu.org; Sat, 30 Oct 2021 16:25:28 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:54820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mguuk-0001Bo-II for 51520@debbugs.gnu.org; Sat, 30 Oct 2021 16:25:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1ilCvKOl5rzwksZNFGH562embV0rIrstdDuzjv5Ee70=; b=PkRnSmpISjOJK3soUicNt8i4kD za0Mnxs8ZNik3QqwTvjqU10BOoqmn89mnKR7IZPmGTBzjd54/vbuToZamn6Wh72RwLtPTSI7Z9ry/ RnvqiAlvcSXhkMG0KHXphv4ZFeSPl/xVqqFl+OMjzi5N75Jxrc1UoAP+hngltOeMY9cHF8pFtPlIk He+3kTuhCbHINVvE0j3KNaDMpX6aHjGHHXWxV8jCWqHowNEHXsS+R17h3f7Y1BmG8FFhnJ1ilJHZ/ vHpZ/k3x/NPgVQVCvFI5v2Z2+ouDAzpK6FhjHZR/4edMFH5io2SjJrijKPNS48Lt6kptWEKAzZwRM ZdfkR6sQ==; Received: from [192.168.2.1] (port=59960 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1mguui-0003Cr-7N; Sun, 31 Oct 2021 01:55:16 +0530 From: Arun Isaac Date: Sun, 31 Oct 2021 01:55:13 +0530 Message-Id: <20211030202514.18639-2-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211030202514.18639-1-arunisaac@systemreboot.net> References: <20211030202514.18639-1-arunisaac@systemreboot.net> 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/messaging.scm (weechat-matrix): New variable. --- gnu/packages/messaging.scm | 69 +++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index d07c1c6566..e684c60c0c 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2016 Andy Patterson ;;; Copyright © 2016, 2017, 2018, 2019 Clément Lassieur ;;; Copyright © 2017 Mekeor Melire -;;; Copyright © 2017, 2018, 2020 Arun Isaac +;;; Copyright © 2017, 2018, 2020, 2021 Arun Isaac ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice ;;; Copyright © 2017 Theodoros Foradis ;;; Copyright © 2017, 2018, 2019 Rutger Helling @@ -2992,4 +2992,71 @@ (define-public matterbridge (home-page "https://github.com/42wim/matterbridge") (license license:asl2.0))) +(define-public weechat-matrix + (package + (name "weechat-matrix") + (version "0.3.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/poljar/weechat-matrix") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1iv55n4k05139f7jzkhczgw4qp6qwilrvfsy3c6v2m1kxffj12d3")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'build) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((weechat-python (string-append (assoc-ref outputs "out") + "/share/weechat/python"))) + ;; Avoid circular import by renaming the matrix module to + ;; weechat_matrix. + (substitute* (cons "main.py" + (append (find-files "matrix") + (find-files "tests"))) + (("from matrix") "from weechat_matrix") + (("import matrix") "import weechat_matrix")) + ;; Install python modules. + (invoke "make" "install-lib" + (string-append "INSTALLDIR=" + (site-packages inputs outputs) + "/weechat_matrix")) + ;; Extend PYTHONPATH to find installed python modules. + (add-installed-pythonpath inputs outputs) + ;; Augment sys.path so that dependencies are found. + (substitute* "main.py" + (("import os\n" all) + (apply string-append + all + "import sys\n" + (map (lambda (path) + (string-append "sys.path.append('" path "')\n")) + (string-split (getenv "PYTHONPATH") #\:))))) + ;; Install script. + (mkdir-p weechat-python) + (copy-file "main.py" + (string-append weechat-python "/matrix.py"))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest"))))))) + (inputs + `(("python-matrix-nio" ,python-matrix-nio) + ("python-pygments" ,python-pygments) + ("python-pyopenssl" ,python-pyopenssl) + ("python-webcolors" ,python-webcolors))) + (native-inputs + `(("python-pytest" ,python-pytest))) + (home-page "https://github.com/poljar/weechat-matrix") + (synopsis "Weechat Matrix protocol script") + (description "@code{weechat-matrix} is a Python plugin for Weechat that lets +Weechat communicate over the Matrix protocol.") + (license license:isc))) + ;;; messaging.scm ends here