From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Specifying package patches in a more convenient form Date: Thu, 07 Apr 2016 12:52:18 +0300 Message-ID: <87wpo9zqy5.fsf_-_@gmail.com> References: <1459917181-19626-1-git-send-email-ericbavier@openmailbox.org> <87wpobvssk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao6bt-0003h2-JL for guix-devel@gnu.org; Thu, 07 Apr 2016 05:52:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ao6bq-0007DA-DH for guix-devel@gnu.org; Thu, 07 Apr 2016 05:52:21 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:35683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao6bq-0007D6-5r for guix-devel@gnu.org; Thu, 07 Apr 2016 05:52:18 -0400 Received: by mail-lf0-x242.google.com with SMTP id o124so6945979lfb.2 for ; Thu, 07 Apr 2016 02:52:17 -0700 (PDT) In-Reply-To: (Eric Bavier's message of "Wed, 06 Apr 2016 09:57:59 -0500") 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: Eric Bavier Cc: guix-devel@gnu.org Eric Bavier (2016-04-06 17:57 +0300) wrote: > On Wed, 06 Apr 2016 15:13:47 +0300 > Alex Kost wrote: [...] >> > + "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4")) >> > + (patches (map search-patch '("ttfautohint-source-date-epoch.patch"))))) >> >> Since it's just a single patch, I don't see a reason to use 'map' here. > > Just that it's less to change if more patches are added later. The > same has been used in other packages. I strongly disagree with this policy. More patches may never be added, but mapping through a list of a single element looks redundant for me. 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") If it is acceptable, I can make patches to add this macro and to change package recipes to use it. P.S. Actually, I don't like 'search-patches' name. Better ideas? -- Alex