GNU bug report logs - #26558
Opening URLs with xdg-open fails (eg. Gajim, Pumpa)

Previous Next

Package: guix;

Reported by: Ben Sturmfels <ben <at> stumbles.id.au>

Date: Wed, 19 Apr 2017 00:30:02 UTC

Severity: normal

Done: Marius Bakke <mbakke <at> fastmail.com>

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 26558 in the body.
You can then email your comments to 26558 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 bug-guix <at> gnu.org:
bug#26558; Package guix. (Wed, 19 Apr 2017 00:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ben Sturmfels <ben <at> stumbles.id.au>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 19 Apr 2017 00:30:02 GMT) Full text and rfc822 format available.

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

From: Ben Sturmfels <ben <at> stumbles.id.au>
To: bug-guix <at> gnu.org
Subject: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Wed, 19 Apr 2017 10:28:36 +1000
Hi Folks,

When I click an embedded URL within Gajim or Pumpa, I'm expecting a
browser window to pop up, but nothing happens and I get an error on the
command line:

  /home/ben/.guix-profile/bin/xdg-open: line 341: gnome-open: command
  not found

The same error shows up if you attempt try the URL with xdg-open
directly:

  $ xdg-open https://www.gnu.org/software/guix/
  /home/ben/.guix-profile/bin/xdg-open: line 341: gnome-open: command not
  found

As this message suggests, "gnome-open" is hard-coded into the "xdg-open"
script on line 341.

In Trisquel 7 and Debian Unstable the "gnome-open" executable is
included in the "libgnome2-bin" package, which I gather is deprecated.
Some quick searching around suggests that "gvfs-open" might be the the
appropriate replacement for "gnome-open":

  https://askubuntu.com/questions/101965/what-is-the-replacement-for-gnome-open-in-gnome
  https://wiki.gnome.org/Initiatives/GnomeGoals/RemoveGnomeOpenGnomeHelp?highlight=%28gnome-open%29
  https://wiki.gnome.org/Attic/LibgnomeMustDie?highlight=%28gnome-open%29

I assume that means either:

  a. packaging the deprecated gnome-open,
  b. modifying xdg-open to use gvfs-open instead of gnome-open, or
  c. in Gajim's case, possibly using "gtk_show_uri"?

Cheers,
Ben




Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Wed, 19 Apr 2017 17:00:03 GMT) Full text and rfc822 format available.

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

From: Mekeor Melire <mekeor.melire <at> gmail.com>
To: Ben Sturmfels <ben <at> stumbles.id.au>
Cc: 26558 <at> debbugs.gnu.org
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Wed, 19 Apr 2017 18:59:02 +0200
Ben Sturmfels <ben <at> stumbles.id.au> writes:

> When I click an embedded URL within Gajim or Pumpa, I'm expecting a
> browser window to pop up, but nothing happens and I get an error on the
> command line:
>
>   /home/ben/.guix-profile/bin/xdg-open: line 341: gnome-open: command
>   not found
>
> The same error shows up if you attempt try the URL with xdg-open
> directly:
>
>   $ xdg-open https://www.gnu.org/software/guix/
>   /home/ben/.guix-profile/bin/xdg-open: line 341: gnome-open: command not
>   found
>
> As this message suggests, "gnome-open" is hard-coded into the "xdg-open"
> script on line 341.

I don't think so because this is what I get when running xdg-open:

    # this does not work:
    $ xdg-open http://gnu.org
    /home/mekeor/.guix-profile/bin/xdg-open: line 369: firefox: command not found
    /home/mekeor/.guix-profile/bin/xdg-open: line 369: mozilla: command not found
    /home/mekeor/.guix-profile/bin/xdg-open: line 369: netscape: command not found
    xdg-open: no method available for opening 'http://gnu.org'

    # this works just fine:
    $ BROWSER="icecat" xdg-open http://gnu.org

As you might have guessed, I do not use GNOME.

Did you try to set BROWSER environment variable?

-- 
mekeor ~ EDD3 DFFA 76F6 11C0 145F 9A99 AC85 BAD8 A2F8 C868




Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Wed, 19 Apr 2017 19:07:02 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Mekeor Melire <mekeor.melire <at> gmail.com>
Cc: 26558 <at> debbugs.gnu.org, Ben Sturmfels <ben <at> stumbles.id.au>
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Thu, 20 Apr 2017 00:35:47 +0530
Thank you for the bug reports!

The Guix xdg-utils package is in need of an update. The latest release
is 1.1.1. Unlike the 1.0.2 release currently in Guix, the new release
has test cases, many of which currently fail in Guix. While trying to
get the tests to pass, I noticed that /usr/bin/file is hardcoded into
xdg-mime. That, I think, is at least part of the problem. I am working
on this, and will hopefully be done this weekend. We will revisit these
bugs after that.




Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Wed, 19 Apr 2017 19:23:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>,
 Mekeor Melire <mekeor.melire <at> gmail.com>
Cc: 26558 <at> debbugs.gnu.org, Ben Sturmfels <ben <at> stumbles.id.au>
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Wed, 19 Apr 2017 21:22:40 +0200
[Message part 1 (text/plain, inline)]
Arun Isaac <arunisaac <at> systemreboot.net> writes:

> Thank you for the bug reports!
>
> The Guix xdg-utils package is in need of an update. The latest release
> is 1.1.1. Unlike the 1.0.2 release currently in Guix, the new release
> has test cases, many of which currently fail in Guix. While trying to
> get the tests to pass, I noticed that /usr/bin/file is hardcoded into
> xdg-mime. That, I think, is at least part of the problem. I am working
> on this, and will hopefully be done this weekend. We will revisit these
> bugs after that.

Heh, I've had a WIP update for 1.1.1 for some time and decided to finish
it based on this discussion. This tries "gvfs-open" before "gnome-open".

@Ben (and others), can you try this patch and see if that works for you?

[0001-gnu-xdg-utils-Update-to-1.1.1.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Thu, 20 Apr 2017 05:08:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Mekeor Melire <mekeor.melire <at> gmail.com>,
 Arun Isaac <arunisaac <at> systemreboot.net>, 26558 <at> debbugs.gnu.org
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Thu, 20 Apr 2017 14:07:29 +0900
[Message part 1 (text/plain, inline)]
Hello Marius,

Marius Bakke <mbakke <at> fastmail.com> writes:

> Arun Isaac <arunisaac <at> systemreboot.net> writes:
>
>> Thank you for the bug reports!
>>
>> The Guix xdg-utils package is in need of an update. The latest release
>> is 1.1.1. Unlike the 1.0.2 release currently in Guix, the new release
>> has test cases, many of which currently fail in Guix. While trying to
>> get the tests to pass, I noticed that /usr/bin/file is hardcoded into
>> xdg-mime. That, I think, is at least part of the problem. I am working
>> on this, and will hopefully be done this weekend. We will revisit these
>> bugs after that.
>
> Heh, I've had a WIP update for 1.1.1 for some time and decided to finish
> it based on this discussion. This tries "gvfs-open" before "gnome-open".
>
> @Ben (and others), can you try this patch and see if that works for you?
>
> From 6ed7008561eea7b09085a17d6c443ee657a7fc2d Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke <at> fastmail.com>
> Date: Sat, 8 Apr 2017 03:46:15 +0200
> Subject: [PATCH] gnu: xdg-utils: Update to 1.1.1.
>
> * gnu/packages/freedesktop.scm (xdg-utils): Update to 1.1.1.
> [source]: Adjust file name.
> [native-inputs]: Add DOCBOOK-XSL, DOCBOOK-XML-4.1.2, LIBXSLT, W3M and XMLTO.
> [arguments]<#:phases>: Add 'patch-hardcoded-paths' and 'locate-catalog-files'
> phases. New parameter.
> [home-page]: Update to new home.
> ---
>  gnu/packages/freedesktop.scm | 50 +++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 45 insertions(+), 5 deletions(-)
>
> diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
> index b912ce026..85a6c8b26 100644
> --- a/gnu/packages/freedesktop.scm
> +++ b/gnu/packages/freedesktop.scm
> @@ -8,6 +8,7 @@
>  ;;; Copyright © 2016, 2017 Efraim Flashner <efraim <at> flashner.co.il>
>  ;;; Copyright © 2016 Kei Kebreau <kei <at> openmailbox.org>
>  ;;; Copyright © 2017 Mark H Weaver <mhw <at> netris.org>
> +;;; Copyright © 2017 Marius Bakke <mbakke <at> fastmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -55,6 +56,7 @@
>    #:use-module (gnu packages polkit)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages python)
> +  #:use-module (gnu packages w3m)
>    #:use-module (gnu packages xml)
>    #:use-module (gnu packages xdisorg)
>    #:use-module (gnu packages xorg))
> @@ -62,23 +64,61 @@
>  (define-public xdg-utils
>    (package
>      (name "xdg-utils")
> -    (version "1.0.2")
> +    (version "1.1.1")
>      (source
>        (origin
>          (method url-fetch)
>            (uri (string-append
>                   "https://portland.freedesktop.org/download/xdg-utils-"
> -                 version ".tgz"))
> +                 version ".tar.gz"))
>            (sha256
>              (base32
> -             "1b019d3r1379b60p33d6z44kx589xjgga62ijz9vha95dg8vgbi1"))))
> +             "09a1pk3ifsndc5qz2kcd1557i137gpgnv3d739pv22vfayi67pdh"))))
>      (build-system gnu-build-system)
> +    (native-inputs
> +     `(("docbook-xsl" ,docbook-xsl)
> +       ("docbook-xml" ,docbook-xml-4.1.2)
> +       ("libxslt" ,libxslt)
> +       ("w3m" ,w3m)
> +       ("xmlto" ,xmlto)))
>      (propagated-inputs
>       `(("xprop" ,xprop) ; for Xfce detecting
>         ("xset" ,xset))) ; for xdg-screensaver
>      (arguments
> -     `(#:tests? #f)) ; no check target
> -    (home-page "http://portland.freedesktop.org/")
> +     `(#:tests? #f   ; no check target
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch-hardcoded-paths
> +           (lambda _
> +             (substitute* "scripts/xdg-mime.in"
> +               (("/usr/bin/file") (which "file")))
> +             (substitute* "scripts/xdg-open.in"
> +               (("/usr/bin/printf") (which "printf")))
> +             #t))
> +         (add-before 'build 'locate-catalog-files
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml")
> +                                          "/xml/dtd/docbook"))
> +                   (xsldoc (string-append (assoc-ref inputs "docbook-xsl")
> +                                          "/xml/xsl/docbook-xsl-"
> +                                          ,(package-version docbook-xsl))))
> +               (for-each (lambda (file)
> +                           (substitute* file
> +                             (("http://.*/docbookx\\.dtd")
> +                              (string-append xmldoc "/docbookx.dtd"))))
> +                         (find-files "scripts/desc" "\\.xml$"))
> +               (substitute* "scripts/Makefile"
> +                 ;; Apparently `xmlto' does not bother to looks up the stylesheets
> +                 ;; specified in the XML, unlike the above substitition. Instead it
> +                 ;; uses a hard-coded URL. Work around it here, but if this is
> +                 ;; common perhaps we should hardcode this path in xmlto itself.
> +                 (("\\$\\(XMLTO\\) man")
> +                  (string-append "$(XMLTO) -x " xsldoc
> +                                 "/manpages/docbook.xsl man")))

Have you tried setting the XML_CATALOG_FILES variable? You might be able
to get rid of the substitutions by using it. You can simply add libxml2
as an input, which will define such variable for you (thanks to Ludovic
for pointing this out previously!).

> +               (setenv "STYLESHEET"
> +                       (string-append xsldoc "/html/docbook.xsl"))
> +               #t))))))
> +    (home-page "https://www.freedesktop.org/wiki/Software/xdg-utils/")
>      (synopsis "Freedesktop.org scripts for desktop integration")
>      (description "The xdg-utils package is a set of simple scripts that
>  provide basic desktop integration functions in the framework of the

Maxim
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Thu, 20 Apr 2017 05:17:02 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 26558 <at> debbugs.gnu.org
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Thu, 20 Apr 2017 10:46:04 +0530
> Heh, I've had a WIP update for 1.1.1 for some time and decided to finish
> it based on this discussion.

Oh, good! :-)

Your patch builds successfully. But, the new version has tests, and you
still need to package them. When I try to run the tests, a few
fail. Setting environment variables HOME and BROWSER makes some tests
pass. This is about as far as I got with my WIP patch.




Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Sat, 22 Apr 2017 10:17:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Mekeor Melire <mekeor.melire <at> gmail.com>,
 Arun Isaac <arunisaac <at> systemreboot.net>, 26558 <at> debbugs.gnu.org
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Sat, 22 Apr 2017 12:16:26 +0200
[Message part 1 (text/plain, inline)]
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> Hello Marius,
>
> Marius Bakke <mbakke <at> fastmail.com> writes:
>> [...]
>> +         (add-before 'build 'locate-catalog-files
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml")
>> +                                          "/xml/dtd/docbook"))
>> +                   (xsldoc (string-append (assoc-ref inputs "docbook-xsl")
>> +                                          "/xml/xsl/docbook-xsl-"
>> +                                          ,(package-version docbook-xsl))))
>> +               (for-each (lambda (file)
>> +                           (substitute* file
>> +                             (("http://.*/docbookx\\.dtd")
>> +                              (string-append xmldoc "/docbookx.dtd"))))
>> +                         (find-files "scripts/desc" "\\.xml$"))
>> +               (substitute* "scripts/Makefile"
>> +                 ;; Apparently `xmlto' does not bother to looks up the stylesheets
>> +                 ;; specified in the XML, unlike the above substitition. Instead it
>> +                 ;; uses a hard-coded URL. Work around it here, but if this is
>> +                 ;; common perhaps we should hardcode this path in xmlto itself.
>> +                 (("\\$\\(XMLTO\\) man")
>> +                  (string-append "$(XMLTO) -x " xsldoc
>> +                                 "/manpages/docbook.xsl man")))
>
> Have you tried setting the XML_CATALOG_FILES variable? You might be able
> to get rid of the substitutions by using it. You can simply add libxml2
> as an input, which will define such variable for you (thanks to Ludovic
> for pointing this out previously!).

I tried now to add libxml2, and also set XML_CATALOG_FILES manually (and
both :)), but no luck. Thanks for the tip, though. Would be good to find
out why it doesn't work for this case.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Sat, 22 Apr 2017 10:32:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>, 26558 <at> debbugs.gnu.org
Cc: Ben Sturmfels <ben <at> stumbles.id.au>
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Sat, 22 Apr 2017 12:31:02 +0200
[Message part 1 (text/plain, inline)]
Arun Isaac <arunisaac <at> systemreboot.net> writes:

>> Heh, I've had a WIP update for 1.1.1 for some time and decided to finish
>> it based on this discussion.
>
> Oh, good! :-)
>
> Your patch builds successfully. But, the new version has tests, and you
> still need to package them. When I try to run the tests, a few
> fail. Setting environment variables HOME and BROWSER makes some tests
> pass. This is about as far as I got with my WIP patch.

I had a go at this, and after adding some inputs and setting HOME only
four tests fail. Getting those to work in the build environment seems
pretty involved however (currently I'm starting xorg and adding a
"mimeapps.list"), so I shunted on this for now as it obscures the
update diff somewhat and is better suited as a separate patch.

IMO it's better to have a working package without tests, than a broken
package without tests ;-) Would be good to get it fixed though, will
give it a go at a later opportunity.

Ben: Can you confirm whether the latest xdg-utils work for you? It's in
'master' now so you should get it after a `guix pull` and update.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#26558; Package guix. (Sun, 23 Apr 2017 12:15:01 GMT) Full text and rfc822 format available.

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

From: Ben Sturmfels <ben <at> stumbles.id.au>
To: Marius Bakke <mbakke <at> fastmail.com>,
 Arun Isaac <arunisaac <at> systemreboot.net>, 26558 <at> debbugs.gnu.org
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Sun, 23 Apr 2017 22:14:41 +1000
[Message part 1 (text/plain, inline)]
On 22/04/17 20:31, Marius Bakke wrote:

> Ben: Can you confirm whether the latest xdg-utils work for you? It's in
> 'master' now so you should get it after a `guix pull` and update.

Thanks Marius, working beautifully now!

Regards,
Ben


[signature.asc (application/pgp-signature, attachment)]

Reply sent to Marius Bakke <mbakke <at> fastmail.com>:
You have taken responsibility. (Sun, 23 Apr 2017 23:01:01 GMT) Full text and rfc822 format available.

Notification sent to Ben Sturmfels <ben <at> stumbles.id.au>:
bug acknowledged by developer. (Sun, 23 Apr 2017 23:01:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Ben Sturmfels <ben <at> stumbles.id.au>, Arun Isaac <arunisaac <at> systemreboot.net>,
 26558-done <at> debbugs.gnu.org
Subject: Re: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Mon, 24 Apr 2017 01:00:28 +0200
[Message part 1 (text/plain, inline)]
Ben Sturmfels <ben <at> stumbles.id.au> writes:

> On 22/04/17 20:31, Marius Bakke wrote:
>
>> Ben: Can you confirm whether the latest xdg-utils work for you? It's in
>> 'master' now so you should get it after a `guix pull` and update.
>
> Thanks Marius, working beautifully now!

Yay, thanks for confirming! Closing this bug. :-)
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 May 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 86 days ago.

Previous Next


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