guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New build-system quest (premake4 t-engine)


From: Oleg Pykhalov
Subject: Re: New build-system quest (premake4 t-engine)
Date: Wed, 26 Jul 2017 15:54:11 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Ricardo Wurmus <address@hidden> writes:

> Oleg Pykhalov <address@hidden> 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.

OK.  In my case I think snippet is more proper solution, because I used
this patch befoure I come to GuixSD to build it on GNU+Linux distroes.
Probably I need to send it to upsteam for future release.

>> (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__)")))

Thanks!  I applied this.

>From 3fee4fd0035e6fa2175e92b0c381a61d8d27928a Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <address@hidden>
Date: Wed, 26 Jul 2017 15:48:12 +0300
Subject: [PATCH] tome4: Apply Ricardo suggestions.

---
 gnu/packages/games.scm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 41084a2f2..2bd7b25cf 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -4595,12 +4595,10 @@ Crowther & Woods, its original authors, in 1995.  It 
has been known as
          "0v2qgdfpvdzd1bcbp9v8pfahj1bgczsq2d4xfhh5wg11jgjcwz03"))
        (modules '((guix build utils)))
        (snippet
-        '(for-each (lambda (file)
-                     (substitute* file
-                       (("#elif defined(__FreeBSD__)" line)
-                        (string-append
-                         line " || defined(__GNUC__)"))))
-                   '("src/music.h" "src/tSDL.h")))))
+        '(substitute* '("src/music.h" "src/tSDL.h")
+           (("#elif defined(__FreeBSD__)" line)
+            (string-append
+             line " || defined(__GNUC__)"))))))
     (build-system gnu-build-system)
     (native-inputs
      `(("unzip" ,unzip)))
-- 
2.13.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]