From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Specifying package patches in a more convenient form Date: Sat, 09 Apr 2016 11:22:08 +0300 Message-ID: <8760vrtcnj.fsf@gmail.com> References: <1459917181-19626-1-git-send-email-ericbavier@openmailbox.org> <87wpobvssk.fsf@gmail.com> <87wpo9zqy5.fsf_-_@gmail.com> <87wpo96q52.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]:51729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoo9k-0005Wt-ND for guix-devel@gnu.org; Sat, 09 Apr 2016 04:22:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoo9h-0005yK-Go for guix-devel@gnu.org; Sat, 09 Apr 2016 04:22:12 -0400 In-Reply-To: <87wpo96q52.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 07 Apr 2016 23:54:49 +0200") 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" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s (2016-04-08 00:54 +0300) wrote: > Alex Kost skribis: [...] >> Talking about how we specify package patches currently, I think it would >> be better to do it in a more clean and general way. What about adding >> the following macro to (gnu packages)? >> >> (define-syntax-rule (search-patches file-name ...) >> "Return a list of patches for each FILE-NAME." >> (list (search-patch file-name) ...)) >> >> So instead of things like this: >> >> (list (search-patch "foo.patch") >> (search-patch "bar.patch")) >> >> or this: >> >> (map search-patch '("foo.patch" >> "bar.patch")) >> >> we'll have: >> >> (search-patches "foo.patch" >> "bar.patch") > > I like it! OK, I've sent the patches for this change. > Andy Wingo skribis: > >> What if the "patches" field just applied `search-path' to each of the >> items in the list if the path is not absolute? Use >> `absolute-file-name?' to check if this is needed or not. > > FWIW I have a preference for keeping things explicit. Another argument is 'glibc-locales' packages which has: (patches (cons (search-patch "glibc-locales.patch") (origin-patches (package-source glibc)))) --=20 Alex