From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:35299) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmOy3-0006Br-T1 for guix-patches@gnu.org; Sat, 13 Jul 2019 16:50:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmOy2-0007cD-QA for guix-patches@gnu.org; Sat, 13 Jul 2019 16:50:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34636) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmOy2-0007bo-M4 for guix-patches@gnu.org; Sat, 13 Jul 2019 16:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmOy2-0006Ta-I6 for guix-patches@gnu.org; Sat, 13 Jul 2019 16:50:02 -0400 Subject: [bug#36563] [PATCH] guix: Add directory to channel. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <878st7dn7b.fsf@gnu.org> <87lfx29qjq.fsf@gnu.org> <87ef2ukkt8.fsf@gnu.org> Date: Sat, 13 Jul 2019 22:49:36 +0200 In-Reply-To: <87ef2ukkt8.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Sat, 13 Jul 2019 17:37:07 +0200") Message-ID: <875zo58xsv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Jan Nieuwenhuizen Cc: 36563@debbugs.gnu.org Jan Nieuwenhuizen skribis: > Yes, I agree that this should be the first option to support. Attached > is a second attempt: I removed the FIXME and moved `directory' to > channel-metadata. That was fast! > A downside could be that this could make a channel user dependent on > upstream to provide this `.guix-channel' file; probably best to worry > about that when the need arises :) If upstream doesn=E2=80=99t provide this file, then the channel is effectiv= ely unusable because of a file name/module name mismatch, no? > From 5d78a7eab391ea93c044d85736706b333c2dfee8 Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sat, 13 Jul 2019 16:31:50 +0200 > Subject: [PATCH] channels: Add optional directory to channel metadata. > > * guix/channels.scm (): Add directory slot. Update use= rs. > (read-channel-metadata-from-source): New function. > (standard-module-derivation): Use it. > * doc/guix.texi (Package Modules in a Subdirectory): New subsection. [...] > +@cindex subdirectory, channels > +@subsection Package Modules in a Subdirectory > + > +A developer may include a @file{guix} subdirectory in their upstream sou= rce > +that contains additional or modified Guix package descriptions. Typical= ly, > +their toplevel @file{guix.scm} then uses those package definitions: What about framing it along these lines: As a channel author, you may want to keep your channel modules in a sub-directory. In that case, blah=E2=80=A6 ? > +By adding a meta-data file @file{.guix-channel} that specifies the > +subdirectory that contains the Guix package descriptions it can be used > +directly as a channel: > + > +@lisp > +(channel > + (directory "guix")) It should be: (channel (version 0) (directory "something")) (=E2=80=98read-channel-metadata=E2=80=99 currently ignores =E2=80=98version= =E2=80=99, but that=E2=80=99s a bug that we should fix afterwards, IMO.) > + (let* ((subdir (if #$directory > + (string-append "/" #$directory) > + "")) > + (dir (string-append #$source subdir))) Maybe s/dir/source/? Otherwise LGTM! Thanks, Ludo=E2=80=99.