guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.


From: Ludovic Courtès
Subject: Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.
Date: Sun, 11 Jan 2015 11:59:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Federico Beffa <address@hidden> skribis:

> On Sat, Jan 10, 2015 at 10:13 PM, Ludovic Courtès <address@hidden> wrote:
>>> +          (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"
>>> +                              "        }")))))
>>
>> Why not just:
>>
>>   (string-append "return \"" sounds "\";")
>>
>> ?
>
> The first "return" is used in an "if" clause that checks that
> XDG_DATA_DIRS is either empty, or not defined.  The variable "g" is a
> pointer to a string contains the value of XDG_DATA_DIRS. I'm adding an
> "else" with a second "return" to add the sounds directory even when
> XDG_DATA_DIRS is defined (the unpatched program does returns "g" in
> this case and therefore the sounds would not be found).

Hmm OK.

I’m a bit concerned about readability.  What about doing it this way:

  1. Make an actual patch for libcanberra, with @SOUND_THEME_DIRECTORY@
     as a placeholder for the sound-theme-freedesktop directory.

  2. Add this patch to libcanberra’s ‘patches’ field.

  3. Add a phase that replaces @SOUND_THEME_DIRECTORY@ with the actual
     directory.

?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]