From: ludo@gnu.org (Ludovic Courtès)
To: Federico Beffa <beffa@ieee.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.
Date: Sun, 11 Jan 2015 11:59:25 +0100 [thread overview]
Message-ID: <87zj9pbn1u.fsf@gnu.org> (raw)
In-Reply-To: <CAKrPhPOUKXOBkfOkS5ZcCSeFLm6KDn30nNrtTwyde-cb2Ti51w@mail.gmail.com> (Federico Beffa's message of "Sun, 11 Jan 2015 09:34:38 +0100")
Federico Beffa <beffa@ieee.org> skribis:
> On Sat, Jan 10, 2015 at 10:13 PM, Ludovic Courtès <ludo@gnu.org> 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’.
next prev parent reply other threads:[~2015-01-11 10:59 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
2015-01-10 21:13 ` Ludovic Courtès
2015-01-11 8:34 ` Federico Beffa
2015-01-11 10:59 ` Ludovic Courtès [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zj9pbn1u.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=beffa@ieee.org \
--cc=guix-devel@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 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.