From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: New build-system quest (premake4 t-engine) Date: Wed, 26 Jul 2017 10:51:49 +0200 Message-ID: <878tjb7f8a.fsf@elephly.net> References: <87shi6fxf0.fsf@gmail.com> <878tjjfe82.fsf@elephly.net> <87fudllezz.fsf@gmail.com> <87fudk6wrb.fsf@elephly.net> <8760efiuk8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daI34-0006Ja-1P for guix-devel@gnu.org; Wed, 26 Jul 2017 04:52:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daI2z-00007m-5R for guix-devel@gnu.org; Wed, 26 Jul 2017 04:52:06 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1daI2y-000079-Sp for guix-devel@gnu.org; Wed, 26 Jul 2017 04:52:01 -0400 In-reply-to: <8760efiuk8.fsf@gmail.com> 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: Oleg Pykhalov Cc: guix-devel@gnu.org, =?utf-8?Q?Sol=C3=A8ne?= Rapenne Oleg Pykhalov writes: > I'm a little bit confusing about kinda patching in “snippet” vs “phase”. > After I made both in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27691 > I thought maybe I could move “snippet” to “phase”. What is the > difference? > > Right now I think that “snippet” is for patching and “phase” > modification is for “make” modification. Could be both I guess, but > what about best practice? Snippets modify the sources that are provided to users when they run “guix build -S the-package”. We usually do this in cases where the original sources contain non-free software, or when the patching is not Guix-specific (though we tend to use the “patches” field for the latter case). In cases where the modifications are only needed to build the thing on Guix and it’s better to keep the original soruces unchanged for users who want to inspect them we use build phases instead. > (snippet > '(for-each (lambda (file) > (substitute* file > (("#elif defined(__FreeBSD__)" line) > (string-append > line " || defined(__GNUC__)")))) > '("src/music.h" "src/tSDL.h"))) Note that “substitute*” can take a list of files, so the above can be written as: (substitute* '("src/music.h" "src/tSDL.h") (("#elif defined(__FreeBSD__)" line) (string-append line " || defined(__GNUC__)"))) -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net