From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qLHZJp8Kt1/mKgAA0tVLHw (envelope-from ) for ; Fri, 20 Nov 2020 00:15:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UCmbIp8Kt19GEQAAbx9fmQ (envelope-from ) for ; Fri, 20 Nov 2020 00:15:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ECE2A940484 for ; Fri, 20 Nov 2020 00:15:26 +0000 (UTC) Received: from localhost ([::1]:44796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfu5E-0004to-6w for larch@yhetil.org; Thu, 19 Nov 2020 19:15:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfu4t-0004q6-CS for guix-patches@gnu.org; Thu, 19 Nov 2020 19:15:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfu4s-0000Hr-Vo for guix-patches@gnu.org; Thu, 19 Nov 2020 19:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfu4s-0004fO-Qt for guix-patches@gnu.org; Thu, 19 Nov 2020 19:15:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44730] [GAJIM]: Fix loading of installed plugins Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Nov 2020 00:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44730 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Tobias Geerinckx-Rice Cc: julien@lepiller.eu, 44730@debbugs.gnu.org X-Debbugs-Original-Cc: Julien Lepiller , 44730@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by 44730-submit@debbugs.gnu.org id=B44730.160583124417824 (code B ref 44730); Fri, 20 Nov 2020 00:15:02 +0000 Received: (at 44730) by debbugs.gnu.org; 20 Nov 2020 00:14:04 +0000 Received: from localhost ([127.0.0.1]:41342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfu3s-0004cW-Aa for submit@debbugs.gnu.org; Thu, 19 Nov 2020 19:14:04 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:47681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfqtO-00066k-MS for 44730@debbugs.gnu.org; Thu, 19 Nov 2020 15:51:02 -0500 X-Originating-IP: 174.89.21.249 Received: from [192.168.2.62] (bras-vprn-ckvlon0125w-lp130-03-174-89-21-249.dsl.bell.ca [174.89.21.249]) (Authenticated sender: rg@raghavgururajan.name) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 79C591BF205; Thu, 19 Nov 2020 20:50:51 +0000 (UTC) References: <101c1bb4-2513-b1de-2962-436b4431f836@raghavgururajan.name> <87eekp76eo.fsf@nckx> From: Raghav Gururajan Autocrypt: addr=rg@raghavgururajan.name; keydata= xjMEX2ZCJBYJKwYBBAHaRw8BAQdAdiUK33kml2dYjrWidlr4/v0pmjpUv7hOsBN/oSl5wx7N L1JhZ2hhdiBHdXJ1cmFqYW4gKFJHKSA8cmdAcmFnaGF2Z3VydXJhamFuLm5hbWU+wpMEExYI ADsCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUC X28v0AIZAQAKCRBfWBZkf4vlUQf2AQD63gsdJzk0w6Gy0AzpJtMa63mbVRAh4xfnxsRNu6Sb GQD/UDytGjwnQ4nKYsGdoCcA7LM64EkknDvI3ZmlqG7Xuw/OOARfZkIkEgorBgEEAZdVAQUB AQdAZgiqc2NhH/myrCCan9x7gKI6QBPZ/1b+Bz/f3n95ozkDAQgHwngEGBYIACAWIQTNLV6q qYzLN9qR1rBfWBZkf4vlUQUCX2ZCJAIbDAAKCRBfWBZkf4vlUV/OAQD+tMNgmddPSchLpaDP psdDhpvra2uTonNUmnfbTvPgpQD/dG72NCT8hBUVqtzxwQmBrXY/nPEUxctYuvu3unUmzQU= Message-ID: Date: Thu, 19 Nov 2020 15:50:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Icedove/78.4.0 MIME-Version: 1.0 In-Reply-To: <87eekp76eo.fsf@nckx> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3txxYeoFzss4pOKXkdpeNY5kYi7zWvvg7" X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Thu, 19 Nov 2020 19:13:59 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: l+EfAyzn8f/X This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3txxYeoFzss4pOKXkdpeNY5kYi7zWvvg7 Content-Type: multipart/mixed; boundary="r4zaxWg0rxaQLMSnblHU3XbNIx0WAHhwI"; protected-headers="v1" From: Raghav Gururajan To: Tobias Geerinckx-Rice Cc: 44730@debbugs.gnu.org, Julien Lepiller , guix-patches@gnu.org Message-ID: Subject: Re: [bug#44730] [GAJIM]: Fix loading of installed plugins References: <101c1bb4-2513-b1de-2962-436b4431f836@raghavgururajan.name> <87eekp76eo.fsf@nckx> In-Reply-To: <87eekp76eo.fsf@nckx> --r4zaxWg0rxaQLMSnblHU3XbNIx0WAHhwI Content-Type: multipart/mixed; boundary="------------8AC81E65B183FE72C74969B7" Content-Language: en-CA This is a multi-part message in MIME format. --------------8AC81E65B183FE72C74969B7 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hello Tobias! > Thanks for taking care of Gajim. Anytime! :-) > Raghav Gururajan =E5=86=99=E9=81=93=EF=BC=9A >> fix plugins issue in Gajim. >=20 > Please provide more information: what was wrong with the original code,= =20 > and why and how will your patch fix it?=C2=A0 It's better to put this i= n the=20 > commit message itself (above the change log), not just the cover letter= =20 > (your mail).=C2=A0 No more than a few lines. >=20 > The more clear your explanation, the faster the fix can be reviewed and= =20 > merged. I keep doing this, my apologies. I have included comment in commit=20 message of revised patch. > I assume that the problem is the empty =E2=80=98Plugins=E2=80=99 list w= hen I run: >=20 > =C2=A0$ guix environment guix \ > =C2=A0=C2=A0 -- ./pre-inst-env guix environment \ > =C2=A0=C2=A0 --pure --ad-hoc gajim{,-openpgp,-omemo} \ > =C2=A0=C2=A0 -- gajim Yes! > However, the fix doesn't look right to me. >=20 > After applying your patch, Gajim is broken.=C2=A0 Menus don't work. >=20 > --8<---------------cut here---------------start------------->8--- > Traceback (most recent call last): > =C2=A0File=20 > =C2=A0"/gnu/store/zd02xplbafrmzs2swrj3r3zx1hrsvg4y-gajim-1.2.2/lib/pyt= hon3.8/site-packages/gajim/application.py", =C2=A0line 222, in _activate > =C2=A0=C2=A0 self.interface.run(self) > =C2=A0File=20 > =C2=A0"/gnu/store/zd02xplbafrmzs2swrj3r3zx1hrsvg4y-gajim-1.2.2/lib/pyt= hon3.8/site-packages/gajim/gui_interface.py", =C2=A0line 1965, in run > =C2=A0=C2=A0 app.plugin_manager =3D plugins.PluginManager() > =C2=A0File=20 > =C2=A0"/gnu/store/zd02xplbafrmzs2swrj3r3zx1hrsvg4y-gajim-1.2.2/lib/pyt= hon3.8/site-packages/gajim/common/helpers.py", =C2=A0line 1002, in __call= __ > =C2=A0=C2=A0 cls._instances[cls] =3D super(Singleton, cls).__call__( > =C2=A0File=20 > =C2=A0"/gnu/store/zd02xplbafrmzs2swrj3r3zx1hrsvg4y-gajim-1.2.2/lib/pyt= hon3.8/site-packages/gajim/plugins/pluginmanager.py", =C2=A0line 224, in = __init__ > =C2=A0=C2=A0 self._load_plugins() > =C2=A0File=20 > =C2=A0"/gnu/store/zd02xplbafrmzs2swrj3r3zx1hrsvg4y-gajim-1.2.2/lib/pyt= hon3.8/site-packages/gajim/plugins/pluginmanager.py", =C2=A0line 668, in = _load_plugins > =C2=A0=C2=A0 for plugin_dir in configpaths.get_plugin_dirs(): > =C2=A0File=20 > =C2=A0"/gnu/store/zd02xplbafrmzs2swrj3r3zx1hrsvg4y-gajim-1.2.2/lib/pyt= hon3.8/site-packages/gajim/common/configpaths.py", =C2=A0line 50, in get_= plugin_dirs > =C2=A0=C2=A0 Path(os.getenv['PLUGINS_OS']), > --8<---------------cut here---------------end--------------->8--- Sorry, I was misled by a dev. I tries your patch instead now. > I wrote my own patch (attached; no, I don't speak much Python).=C2=A0 I= think=20 > it fixes the problem but I can't test it. Thanks! I just tested it. It works. :-) > The plug-ins are found, but won't load with my version of Gajim. >=20 > --8<---------------cut here---------------start------------->8--- > 11/19/20 15:10:01 (W) gajim.plugin_system=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 Plugin omemo not=20 > loaded, newer version of gajim required: 1.2.91 <=3D 1.2.2 <=3D 1.3.90 > 11/19/20 15:10:01 (W) gajim.plugin_system=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 Plugin openpgp not=20 > loaded, newer version of gajim required: 1.2.91 <=3D 1.2.2 <=3D 1.3.90 > --8<---------------cut here---------------end--------------->8--- >=20 > This is on current master.=C2=A0 How are these plug-ins expected to be = used? I think you installed plugins, both via guix and via gajim's plugin=20 installer. You should remove one of them. >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (variable "GAJIM_PLUGIN_PATH") >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (variable "PLUGINS_OS") >=20 > This doesn't look related to the fix at hand. >=20 > Why remove GAJIM_? > Why rename _PATH? > TBH, both strike me as unnecessary regressions. I was discussing with a Gajim Dev. They agreed to merge our patch in=20 Gajim's upstream. So it can be useful for other non-conventional distros = as well. Regards, RG. --------------8AC81E65B183FE72C74969B7 Content-Type: text/x-patch; charset=UTF-8; name="0001-gnu-gajim-Fix-loading-of-os-installed-plugins.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-gnu-gajim-Fix-loading-of-os-installed-plugins.patch" =46rom e102e488114673069f879afb3796a8e6fb69aaf4 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Thu, 19 Nov 2020 15:36:48 -0500 Subject: [PATCH] gnu: gajim: Fix loading of os-installed plugins. * gnu/packages/messaging.scm (gajim) [patches]: Add gajim-plugins-os.patc= h. [arguments]<#:phases>['add-plugins-dir]: Remove phase. [native-search-paths]: Modify. * gnu/packages/patches/gajim-plugins-os.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. [1] The 'add-plugins-dir phase does not work for version 1.2.2, so this patch is a work-around. [2] The variable name is changed from GAJIM_PLUGINS_PATH to PLUGINS_OS, to resonate close with variable names PLUGINS_BASE and PLUGINS_USER, as this patch is planned to be merged in gajim's upstream. --- gnu/local.mk | 1 + gnu/packages/messaging.scm | 16 ++++--------- gnu/packages/patches/gajim-plugins-os.patch | 25 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 gnu/packages/patches/gajim-plugins-os.patch diff --git a/gnu/local.mk b/gnu/local.mk index 217c05eab6..7fd98876d7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -991,6 +991,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/freedink-engine-fix-sdl-hints.patch \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ + %D%/packages/patches/gajim-plugins-os.patch \= %D%/packages/patches/ganeti-deterministic-manual.patch \ %D%/packages/patches/ganeti-disable-version-symlinks.patch \ %D%/packages/patches/ganeti-drbd-compat.patch \ diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 624ad72c23..09834bfe63 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -743,7 +743,9 @@ of xmpppy.") (version-major+minor version) "/gajim-" version ".tar.gz")) (sha256 - (base32 "1gfcp3b5nq43xxz5my8vfhfxnnli726j3hzcgwh9fzrzzd9ic3gx"))= )) + (base32 "1gfcp3b5nq43xxz5my8vfhfxnnli726j3hzcgwh9fzrzzd9ic3gx"))= + (patches + (search-patches "gajim-plugins-os.patch")))) (build-system python-build-system) (arguments `(#:imported-modules @@ -756,16 +758,6 @@ of xmpppy.") (guix build utils)) #:phases (modify-phases %standard-phases - (add-after 'unpack 'add-plugin-dirs - (lambda _ - (substitute* "gajim/common/configpaths.py" - (("_paths\\['PLUGINS_USER'\\]\\]") - "_paths['PLUGINS_USER']] + \ -([os.getenv('GAJIM_PLUGIN_PATH')] \ -if os.getenv('GAJIM_PLUGIN_PATH') \ -and Path(os.getenv('GAJIM_PLUGIN_PATH')).is_dir() \ -else [])")) - #t)) (replace 'check (lambda _ ;; Tests require a running X server. @@ -795,7 +787,7 @@ else [])")) (native-search-paths (list (search-path-specification - (variable "GAJIM_PLUGIN_PATH") + (variable "PLUGINS_OS") (separator #f) ;single entry (files (list diff --git a/gnu/packages/patches/gajim-plugins-os.patch b/gnu/packages/p= atches/gajim-plugins-os.patch new file mode 100644 index 0000000000..80a0dfacaf --- /dev/null +++ b/gnu/packages/patches/gajim-plugins-os.patch @@ -0,0 +1,25 @@ +From c8e8d29243222e52bb30e123f2c7321a9f418995 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Thu, 19 Nov 2020 15:20:38 -0500 +Subject: [PATCH 3/3] [PATCH]: Fix loading of OS-installed plugins. + +--- + gajim/common/configpaths.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gajim/common/configpaths.py b/gajim/common/configpaths.py +index 0ac879314..f4418b020 100644 +--- a/gajim/common/configpaths.py ++++ b/gajim/common/configpaths.py +@@ -47,7 +47,7 @@ def get_plugin_dirs() -> List[Path]: + return [Path(_paths['PLUGINS_BASE']), + Path('/app/plugins')] + return [Path(_paths['PLUGINS_BASE']), +- Path(_paths['PLUGINS_USER'])] ++ Path(_paths['PLUGINS_USER'])] + ([Path(os.getenv('PLUGINS_O= S'))] if os.getenv('PLUGINS_OS') and Path(os.getenv('PLUGINS_OS')).is_dir= () else []) +=20 +=20 + def get_paths(type_: PathType) -> Generator[Path, None, None]: +--=20 +2.29.2 + --=20 2.29.2 --------------8AC81E65B183FE72C74969B7-- --r4zaxWg0rxaQLMSnblHU3XbNIx0WAHhwI-- --3txxYeoFzss4pOKXkdpeNY5kYi7zWvvg7 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCX7baqQUDAAAAAAAKCRBfWBZkf4vlUTtC AP99Ka8CzFdCjRMNUgrVssoCJ25i5sKgD1oXyaT7mC6k1wD/XGtz5NFXp4cWojMDhaDoBuYni4+U E/WqqYevVbxExg4= =eaAE -----END PGP SIGNATURE----- --3txxYeoFzss4pOKXkdpeNY5kYi7zWvvg7--