GNU bug report logs - #33386
Gajim plugins

Previous Next

Package: guix-patches;

Reported by: Clément Lassieur <clement <at> lassieur.org>

Date: Wed, 14 Nov 2018 19:55:01 UTC

Severity: normal

Done: Clément Lassieur <clement <at> lassieur.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33386 in the body.
You can then email your comments to 33386 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Wed, 14 Nov 2018 19:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Clément Lassieur <clement <at> lassieur.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 14 Nov 2018 19:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: guix-patches <at> gnu.org
Subject: Gajim plugins
Date: Wed, 14 Nov 2018 20:54:38 +0100
Hi,

The first patch allow one to package Gajim plugins.  It also removes two
inputs that were added for the OMEMO plugin.

The second add the OMEMO plugin.

Thanks,
Clément




Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Wed, 14 Nov 2018 19:57:01 GMT) Full text and rfc822 format available.

Message #8 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: 33386 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: gajim: Add support for Guix packaged plugins.
Date: Wed, 14 Nov 2018 20:55:52 +0100
* gnu/packages/messaging.scm (gajim)[arguments]: Add an 'add-plugin-dirs'
phase.  Export PYTHONPATH in the wrapper.
[inputs]: Remove python-axolotl and python-qrcode.
---
 gnu/packages/messaging.scm | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index c22cacfd3..f68b7e4eb 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -588,15 +588,29 @@ was initially a fork of xmpppy, but uses non-blocking sockets.")
      `(#:test-target "test_nogui"
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'add-plugin-dirs
+           (lambda _
+             (substitute* "gajim/common/configpaths.py"
+               (("_paths\\['PLUGINS_USER'\\]")
+                (string-append
+                 "_paths['PLUGINS_USER'],os.path.expanduser"
+                 "('~/.guix-profile/share/gajim/plugins')")))
+             #t))
          (add-after 'install 'wrap-program
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (for-each
                 (lambda (name)
                   (let ((file (string-append out "/bin/" name))
-                        (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+                        (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
+                        (pythonpath (string-append
+                                     "$HOME/.guix-profile/lib/python"
+                                     ,(version-major+minor
+                                       (package-version python))
+                                     "/site-packages")))
                     (wrap-program file
-                      `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))
+                      `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
+                      `("PYTHONPATH" ":" prefix (,pythonpath)))))
                 '("gajim" "gajim-remote" "gajim-history-manager")))
              #t))
          (add-after 'install 'install-icons
@@ -636,7 +650,6 @@ was initially a fork of xmpppy, but uses non-blocking sockets.")
        ("gtkspell3" ,gtkspell3)
        ("hicolor-icon-theme" ,hicolor-icon-theme)
        ("libsecret" ,libsecret)
-       ("python-axolotl" ,python-axolotl)
        ("python-cssutils" ,python-cssutils)
        ("python-dbus" ,python-dbus)
        ("python-gnupg" ,python-gnupg)
@@ -646,8 +659,7 @@ was initially a fork of xmpppy, but uses non-blocking sockets.")
        ("python-precis-i18n" ,python-precis-i18n)
        ("python-pycairo" ,python-pycairo)
        ("python-pygobject" ,python-pygobject)
-       ("python-pyopenssl" ,python-pyopenssl)
-       ("python-qrcode" ,python-qrcode)))
+       ("python-pyopenssl" ,python-pyopenssl)))
     (home-page "https://gajim.org/")
     (synopsis "Jabber (XMPP) client")
     (description "Gajim is a feature-rich and easy to use Jabber/XMPP client.
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Wed, 14 Nov 2018 19:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: 33386 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: Add gajim-omemo.
Date: Wed, 14 Nov 2018 20:55:53 +0100
* gnu/packages/messaging.scm (gajim-omemo): New variable.
[propagated-inputs]: Add python-axolotl and python-qrcode.
---
 gnu/packages/messaging.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index f68b7e4eb..7be0fcc1b 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -93,6 +93,7 @@
   #:use-module (guix build-system meson)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system trivial)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -669,6 +670,42 @@ transformation; audio and video conferences; file transfer; TLS, GPG and
 end-to-end encryption support; XML console.")
     (license license:gpl3)))
 
+(define-public gajim-omemo
+  (package
+    (name "gajim-omemo")
+    (version "2.6.23")
+    (source (origin
+              (method url-fetch/zipbomb)
+              (uri (string-append
+                    "https://ftp.gajim.org/plugins_releases/omemo_"
+                    version ".zip"))
+              (sha256
+               (base32
+                "134zbscbcnhx4smad0ryvx3ngkqlsspafqf0kk8y2d3vcd9bf3pa"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let* ((out (assoc-ref %outputs "out"))
+                (share (in-vicinity out "share/gajim/plugins"))
+                (source (assoc-ref %build-inputs "source")))
+           (mkdir-p share)
+           (copy-recursively source share)
+           #t))))
+    (propagated-inputs
+     `(("python-axolotl" ,python-axolotl)
+       ("python-qrcode" ,python-qrcode)))
+    (home-page
+     "https://dev.gajim.org/gajim/gajim-plugins/wikis/OmemoGajimPlugin")
+    (synopsis "Gajim OMEMO plugin")
+    (description
+     "This package provides the Gajim OMEMO plugin.  OMEMO is an XMPP
+Extension Protocol (XEP) for secure multi-client end-to-end encryption based
+on Axolotl and PEP.")
+    (license license:gpl3+)))
+
 (define-public dino
   ;; The only release tarball is for version 0.0, but it is very old and fails
   ;; to build.
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Wed, 14 Nov 2018 19:59:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: guix-patches <at> gnu.org
Subject: Re: Gajim plugins
Date: Wed, 14 Nov 2018 20:57:39 +0100
Clément Lassieur <clement <at> lassieur.org> writes:

> Hi,
>
> The first patch allow one to package Gajim plugins.  It also removes two
allows
> inputs that were added for the OMEMO plugin.
>
> The second add the OMEMO plugin.
adds

I must be tired ;)
>
> Thanks,
> Clément





Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Thu, 15 Nov 2018 18:20:02 GMT) Full text and rfc822 format available.

Message #17 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 33386 <at> debbugs.gnu.org
Subject: Re: [bug#33386] [PATCH 1/2] gnu: gajim: Add support for Guix
 packaged plugins.
Date: Thu, 15 Nov 2018 19:19:03 +0100
[Message part 1 (text/plain, inline)]
Hi Clément,

On Wed, 14 Nov 2018 20:55:52 +0100
Clément Lassieur <clement <at> lassieur.org> wrote:

>+         (add-after 'unpack 'add-plugin-dirs
>+           (lambda _
>+             (substitute* "gajim/common/configpaths.py"
>+               (("_paths\\['PLUGINS_USER'\\]")
>+                (string-append
>+                 "_paths['PLUGINS_USER'],os.path.expanduser"
>+                 "('~/.guix-profile/share/gajim/plugins')")))
>+             #t))

[...]

> +                        (pythonpath (string-append
> +                                     "$HOME/.guix-profile/lib/python"
> +                                     ,(version-major+minor
> +                                       (package-version python))
> +                                     "/site-packages")))


Hmm, don't both of these hard-code one profile?  I thought one can use
any number of profiles - and this patch could definitely pick from the
wrong one.  Why isn't the PLUGINS_USER setting enough?  Can't it be
provided via environment variables?  (set by the profile)

Also, shouldn't PYTHONPATH already have been set by the profile?  For me,
it is set (to ~/.guix-profile/lib/python3.6/site-packages) when I log in.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Fri, 16 Nov 2018 10:15:01 GMT) Full text and rfc822 format available.

Message #20 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 33386 <at> debbugs.gnu.org
Subject: Re: [bug#33386] [PATCH 1/2] gnu: gajim: Add support for Guix packaged
 plugins.
Date: Fri, 16 Nov 2018 11:13:58 +0100
Hi Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> writes:

> Hi Clément,
>
> On Wed, 14 Nov 2018 20:55:52 +0100
> Clément Lassieur <clement <at> lassieur.org> wrote:
>
>>+         (add-after 'unpack 'add-plugin-dirs
>>+           (lambda _
>>+             (substitute* "gajim/common/configpaths.py"
>>+               (("_paths\\['PLUGINS_USER'\\]")
>>+                (string-append
>>+                 "_paths['PLUGINS_USER'],os.path.expanduser"
>>+                 "('~/.guix-profile/share/gajim/plugins')")))
>>+             #t))
>
> [...]
>
>> +                        (pythonpath (string-append
>> +                                     "$HOME/.guix-profile/lib/python"
>> +                                     ,(version-major+minor
>> +                                       (package-version python))
>> +                                     "/site-packages")))
>
>
> Hmm, don't both of these hard-code one profile?

I don't understand what this means.

> I thought one can use any number of profiles - and this patch could
> definitely pick from the wrong one.

What do you mean?  This patch just adds the Guix packaged plugins to the
list of plugin dirs.

> Why isn't the PLUGINS_USER setting enough?

Because it doens't know about Guix installed plugins.  It doesn't look
in ~/.guix-profile/whatever.  Only at /gnu/store/...-gajim/something and
~/.local/share/gajim/something.

> Can't it be provided via environment variables?  (set by the profile)

Gajim doesn't seem to support customizing plugin dirs through
environment variables, which is why I edited its code.

> Also, shouldn't PYTHONPATH already have been set by the profile?  For
> me, it is set (to ~/.guix-profile/lib/python3.6/site-packages) when I
> log in.

It shouldn't be in the profile if python isn't installed.

Clément




Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Sun, 18 Nov 2018 23:17:01 GMT) Full text and rfc822 format available.

Message #23 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 33386 <at> debbugs.gnu.org
Subject: Re: [bug#33386] [PATCH 1/2] gnu: gajim: Add support for Guix
 packaged plugins.
Date: Mon, 19 Nov 2018 00:15:55 +0100
[Message part 1 (text/plain, inline)]
Hi Clément,

> I don't understand what this means.
> > I thought one can use any number of profiles - and this patch could
> > definitely pick from the wrong one.  
> 
> What do you mean?  This patch just adds the Guix packaged plugins to the
> list of plugin dirs.

guix supports any number of profiles as one user, the ~/.guix-profile one is just
the default, you can create and select profiles at will.

You can specify any profile you want using the option "-p" to "guix package" -
also, "guix environment" will create a custom profile.

However, your patch hardcodes ~/.guix-profile which is in general not what a user
using "-p" would want.  I agree that it makes sense to search for the plugins in
the current profile, but it's not clear to me that ~/.guix-profile is always
guaranteed to BE the current profile.  Is it?

According to https://www.gnu.org/software/guix/manual/en/html_node/Invoking-guix-environment.html#FOOT16 ,
fontconfig already hardcodes ~/.guix-profile and "guix environment" has a
special flag to fake it, so maybe (probably?) it's OK to use it after all.

I hope someone else can chime in - but this is what immediately caught my
eye because what's the use of all these environment variables if one
hard-codes ~/.guix-profile anyway - could have hard-coded it in all packages,
then...

> > Why isn't the PLUGINS_USER setting enough?  
> 
> Because it doens't know about Guix installed plugins.  It doesn't look
> in ~/.guix-profile/whatever.  Only at /gnu/store/...-gajim/something and
> ~/.local/share/gajim/something.
> 
> > Can't it be provided via environment variables?  (set by the profile)  
> 
> Gajim doesn't seem to support customizing plugin dirs through
> environment variables, which is why I edited its code.

In general that's OK.

> > Also, shouldn't PYTHONPATH already have been set by the profile?  For
> > me, it is set (to ~/.guix-profile/lib/python3.6/site-packages) when I
> > log in.  
> 
> It shouldn't be in the profile if python isn't installed.

Oh, makes sense.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Mon, 19 Nov 2018 16:02:02 GMT) Full text and rfc822 format available.

Message #26 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: 33386 <at> debbugs.gnu.org
Subject: [PATCH] gnu: gajim: Add support for Guix packaged plugins.
Date: Mon, 19 Nov 2018 17:01:40 +0100
* gnu/packages/messaging.scm (gajim)[inputs]: Remove python-axolotl.
[arguments]: Add an 'add-plugin-dirs' phase.
[native-search-paths]: New field.
---
 gnu/packages/messaging.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index c22cacfd3..4aea1fd7d 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -588,6 +588,12 @@ was initially a fork of xmpppy, but uses non-blocking sockets.")
      `(#:test-target "test_nogui"
        #: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')"))
+             #t))
          (add-after 'install 'wrap-program
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
@@ -625,6 +631,18 @@ was initially a fork of xmpppy, but uses non-blocking sockets.")
                  (,(string-append (assoc-ref inputs "gtk+")
                                   "/share/glib-2.0/schemas"))))
              #t)))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "GAJIM_PLUGIN_PATH")
+            (separator #f)              ;single entry
+            (files '("share/gajim/plugins")))
+           ;; Gajim needs to use the propagated inputs of its plugins.
+           (search-path-specification
+            (variable "PYTHONPATH")
+            (files (list (string-append
+                          "lib/python"
+                          (version-major+minor (package-version python))
+                          "/site-packages"))))))
     (native-inputs
      `(("intltool" ,intltool)
        ("python-docutils" ,python-docutils)
@@ -636,7 +654,6 @@ was initially a fork of xmpppy, but uses non-blocking sockets.")
        ("gtkspell3" ,gtkspell3)
        ("hicolor-icon-theme" ,hicolor-icon-theme)
        ("libsecret" ,libsecret)
-       ("python-axolotl" ,python-axolotl)
        ("python-cssutils" ,python-cssutils)
        ("python-dbus" ,python-dbus)
        ("python-gnupg" ,python-gnupg)
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33386; Package guix-patches. (Mon, 19 Nov 2018 16:03:02 GMT) Full text and rfc822 format available.

Message #29 received at 33386 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 33386 <at> debbugs.gnu.org
Subject: Re: [bug#33386] [PATCH 1/2] gnu: gajim: Add support for Guix packaged
 plugins.
Date: Mon, 19 Nov 2018 17:02:36 +0100
Danny Milosavljevic <dannym <at> scratchpost.org> writes:

> Hi Clément,
>
>> I don't understand what this means.
>> > I thought one can use any number of profiles - and this patch could
>> > definitely pick from the wrong one.  
>> 
>> What do you mean?  This patch just adds the Guix packaged plugins to the
>> list of plugin dirs.
>
> guix supports any number of profiles as one user, the ~/.guix-profile one is just
> the default, you can create and select profiles at will.
>
> You can specify any profile you want using the option "-p" to "guix package" -
> also, "guix environment" will create a custom profile.
>
> However, your patch hardcodes ~/.guix-profile which is in general not what a user
> using "-p" would want.  I agree that it makes sense to search for the plugins in
> the current profile, but it's not clear to me that ~/.guix-profile is always
> guaranteed to BE the current profile.  Is it?
>
> According to https://www.gnu.org/software/guix/manual/en/html_node/Invoking-guix-environment.html#FOOT16 ,
> fontconfig already hardcodes ~/.guix-profile and "guix environment" has a
> special flag to fake it, so maybe (probably?) it's OK to use it after all.
>
> I hope someone else can chime in - but this is what immediately caught my
> eye because what's the use of all these environment variables if one
> hard-codes ~/.guix-profile anyway - could have hard-coded it in all packages,
> then...

Understood, thanks for this nice explanation!

I attached a new patch.  What do you think?

Thanks,
Clément




Reply sent to Clément Lassieur <clement <at> lassieur.org>:
You have taken responsibility. (Tue, 11 Dec 2018 10:23:01 GMT) Full text and rfc822 format available.

Notification sent to Clément Lassieur <clement <at> lassieur.org>:
bug acknowledged by developer. (Tue, 11 Dec 2018 10:23:02 GMT) Full text and rfc822 format available.

Message #34 received at 33386-done <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 33386-done <at> debbugs.gnu.org
Subject: Re: [bug#33386] [PATCH 1/2] gnu: gajim: Add support for Guix packaged
 plugins.
Date: Tue, 11 Dec 2018 11:22:14 +0100
Clément Lassieur <clement <at> lassieur.org> writes:

> Danny Milosavljevic <dannym <at> scratchpost.org> writes:
>
>> Hi Clément,
>>
>>> I don't understand what this means.
>>> > I thought one can use any number of profiles - and this patch could
>>> > definitely pick from the wrong one.  
>>> 
>>> What do you mean?  This patch just adds the Guix packaged plugins to the
>>> list of plugin dirs.
>>
>> guix supports any number of profiles as one user, the ~/.guix-profile one is just
>> the default, you can create and select profiles at will.
>>
>> You can specify any profile you want using the option "-p" to "guix package" -
>> also, "guix environment" will create a custom profile.
>>
>> However, your patch hardcodes ~/.guix-profile which is in general not what a user
>> using "-p" would want.  I agree that it makes sense to search for the plugins in
>> the current profile, but it's not clear to me that ~/.guix-profile is always
>> guaranteed to BE the current profile.  Is it?
>>
>> According to https://www.gnu.org/software/guix/manual/en/html_node/Invoking-guix-environment.html#FOOT16 ,
>> fontconfig already hardcodes ~/.guix-profile and "guix environment" has a
>> special flag to fake it, so maybe (probably?) it's OK to use it after all.
>>
>> I hope someone else can chime in - but this is what immediately caught my
>> eye because what's the use of all these environment variables if one
>> hard-codes ~/.guix-profile anyway - could have hard-coded it in all packages,
>> then...
>
> Understood, thanks for this nice explanation!
>
> I attached a new patch.  What do you think?

I pushed it.  I'll be happy to improve it if you have other comments.

Thanks,
Clément




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 08 Jan 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.