From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input. Date: Sat, 10 Jan 2015 22:13:56 +0100 Message-ID: <87fvbifiej.fsf@gnu.org> References: <87oaqxqn2h.fsf@gnu.org> <87zj9uz6z2.fsf@gnu.org> <87y4pd57o9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YA3M9-0002yq-T3 for guix-devel@gnu.org; Sat, 10 Jan 2015 16:14:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YA3M6-00087f-LT for guix-devel@gnu.org; Sat, 10 Jan 2015 16:14:01 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:35348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YA3M6-00087X-AR for guix-devel@gnu.org; Sat, 10 Jan 2015 16:13:58 -0500 In-Reply-To: (Federico Beffa's message of "Sat, 10 Jan 2015 12:15:56 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: Guix-devel Federico Beffa skribis: > On Thu, Jan 8, 2015 at 9:39 PM, Ludovic Court=C3=A8s 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. Yeah, but it=E2=80=99s in the same =E2=80=9Cspirit=E2=80=9D. :-) >> The reason I=E2=80=99m not thrilled by the use of =E2=80=98propagated-in= puts=E2=80=99 here is >> that that=E2=80=99s 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)? Yes, you=E2=80=99re right. But the difference is that in the use case we= =E2=80=99re discussing here, we know it would systematically collide. > 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. Very good! Could you add the story about XDG_DATA_DIRS vs. XDG_DATA_HOME as a comment above the phase? > + (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 =3D \":" > + sounds "\";\n" > + " size_t len =3D strlen(st= p) + " > + "strlen(g) + 1;\n" > + " " > + "char *g2 =3D (char*) malloc(len);\n" > + " return " > + "strcat(strcpy(g2, g), stp);\n" > + " }"))))) Why not just: (string-append "return \"" sounds "\";") ? Thanks, Ludo=E2=80=99.