unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Federico Beffa <beffa@ieee.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.
Date: Sat, 10 Jan 2015 12:15:56 +0100	[thread overview]
Message-ID: <CAKrPhPPyCyyxpc6ZMWNbXJxdmrrLVq0N1yztKujJ3CW4D4r8wA@mail.gmail.com> (raw)
In-Reply-To: <87y4pd57o9.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]

On Thu, Jan 8, 2015 at 9:39 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> That said, this kind of patch is not very different from the automated
> shebang patching that we do, IMO.

I do not see it this way because the shebang concept is fully
standardized, while here we are patching a "random" piece of code.

> The reason I’m not thrilled by the use of ‘propagated-inputs’ here is
> that that’s not what they were designed for at the beginning.
>
> It may also lead to usability problems.  Remember that when A is a
> propagated input of B, installing B in a profile also installs A in that
> profile.  So, if each GTKish package propagates sound-theme-freedesktop,
> then installing several such packages in the same profile is likely to
> lead to collisions just because the themes differ (those collisions may
> be harmless, but they will at least trigger a bunch of warnings every
> time the user operates on their profile, which is not desirable.)

Thanks for explaining your concern. But doesn't this problem exist
with most uses of propagated-inputs? As one example libssh2 propagates
libgcrypt. If the user installs a different version of libgcrypt (with
a possibly different ABI), doesn't this causes problems (required
version not found, or worse)?

In any case I've updated libcanberra with a patch to find the default
sounds without the need for propagated-inputs. Differently from your
suggested patch I'm proposing to add the default sounds store
directory to the code dealing with XDG_DATA_DIRS. This is because
XDG_DATA_HOME can only be a single directory and is inspected first.
XDG_DATA_DIRS can list an arbitrary number of directories and is only
inspected later. This is designed to allows the user to modify any
theme at his pleasure.

Regards,
Fede

[-- Attachment #2: 0003-gnu-libcanberra-Add-default-sounds-support.patch --]
[-- Type: text/x-patch, Size: 2480 bytes --]

From a1d7a5b9ed1392d8c5c1a8561357b72e48253ccf Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Thu, 18 Dec 2014 21:32:34 +0100
Subject: [PATCH 3/4] gnu: libcanberra: Add default sounds support.

* gnu/packages/libcanberra.scm (libcanberra): Add input
  'sound-theme-freedesktop'.  Add phase 'patch-default-sounds-directory to
  patch the default sounds directory.
---
 gnu/packages/libcanberra.scm | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/libcanberra.scm b/gnu/packages/libcanberra.scm
index 764c327..91760d8 100644
--- a/gnu/packages/libcanberra.scm
+++ b/gnu/packages/libcanberra.scm
@@ -55,9 +55,36 @@
        ("libtool" ,libtool)
        ("libvorbis" ,libvorbis)
        ("pulseaudio" ,pulseaudio)
-       ("udev" ,eudev)))
+       ("udev" ,eudev)
+       ("sound-theme-freedesktop" ,sound-theme-freedesktop)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
+    ;; "sound-theme-freedesktop" is the default and fall-back sound theme for
+    ;; XDG desktops and should always be present.
+    ;; http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/
+    ;; We make sure libcanberra will find it.
+    (arguments
+     `(#:phases 
+       (alist-cons-before
+        'build 'patch-default-sounds-directory
+        (lambda* (#:key inputs #:allow-other-keys)
+          (let ((sounds (string-append
+                         (assoc-ref inputs "sound-theme-freedesktop")
+                         "/share")))
+            (substitute* "src/sound-theme-spec.c"
+              (("return \"/usr/local/share:/usr/share\";")
+               (string-append "return \"" sounds "\";\n"
+                              "             else {\n"
+                              "                const char *stp = \":"
+                              sounds "\";\n"
+                              "                size_t len =  strlen(stp) + "
+                              "strlen(g) + 1;\n"
+                              "                "
+                              "char *g2 = (char*) malloc(len);\n"
+                              "                return "
+                              "strcat(strcpy(g2, g), stp);\n"
+                              "        }")))))
+          %standard-phases)))
     (home-page "http://0pointer.de/lennart/projects/libcanberra/")
     (synopsis
      "Implementation of the XDG Sound Theme and Name Specifications")
-- 
1.8.4


  reply	other threads:[~2015-01-10 11:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 21:14 [PATCH 3/4] gnu: libcanberra: Add propagated-input Federico Beffa
2014-12-21 11:06 ` Ludovic Courtès
2014-12-21 15:33   ` Federico Beffa
2015-01-07 17:20     ` Federico Beffa
2015-01-07 20:11     ` Ludovic Courtès
2015-01-08 17:08       ` Federico Beffa
2015-01-08 20:39         ` Ludovic Courtès
2015-01-10 11:15           ` Federico Beffa [this message]
2015-01-10 21:13             ` Ludovic Courtès
2015-01-11  8:34               ` Federico Beffa
2015-01-11 10:59                 ` Ludovic Courtès
2015-01-11 13:04                   ` Federico Beffa
2015-01-11 13:34                     ` Federico Beffa
2015-01-12  9:22                       ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=CAKrPhPPyCyyxpc6ZMWNbXJxdmrrLVq0N1yztKujJ3CW4D4r8wA@mail.gmail.com \
    --to=beffa@ieee.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).