all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Arun Isaac <arunisaac@systemreboot.net>,
	Mekeor Melire <mekeor.melire@gmail.com>
Cc: 26558@debbugs.gnu.org
Subject: bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa)
Date: Wed, 19 Apr 2017 21:22:40 +0200	[thread overview]
Message-ID: <874lxkurr3.fsf@fastmail.com> (raw)
In-Reply-To: <5c8ca67b.AEMAJYZoETwAAAAAAAAAAAO2XMEAAAACwQwAAAAAAAW9WABY97Uk@mailjet.com>


[-- Attachment #1.1: Type: text/plain, Size: 761 bytes --]

Arun Isaac <arunisaac@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?


[-- Attachment #1.2: 0001-gnu-xdg-utils-Update-to-1.1.1.patch --]
[-- Type: text/x-patch, Size: 4596 bytes --]

From 6ed7008561eea7b09085a17d6c443ee657a7fc2d Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@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@flashner.co.il>
 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
 ;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2017 Marius Bakke <mbakke@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")))
+               (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
-- 
2.12.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2017-04-19 19:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19  0:28 bug#26558: Opening URLs with xdg-open fails (eg. Gajim, Pumpa) Ben Sturmfels
2017-04-19 16:59 ` Mekeor Melire
2017-04-19 19:05   ` Arun Isaac
2017-04-19 19:22     ` Marius Bakke [this message]
2017-04-20  5:07       ` Maxim Cournoyer
2017-04-22 10:16         ` Marius Bakke
2017-04-20  5:16       ` Arun Isaac
2017-04-22 10:31         ` Marius Bakke
2017-04-23 12:14           ` Ben Sturmfels
2017-04-23 23:00             ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lxkurr3.fsf@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=26558@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    --cc=mekeor.melire@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.