Ludovic Courtès (2015-10-12 19:35 +0300) wrote:

> Alex Kost <alez...@gmail.com> skribis:
>
[...]
>> Actually, I think it will be more clear to use 'sdl-union' here, because
>> the workaround is more concise, WDYT?
>
> Indeed.

What about using 'sdl-union' in ‘abbaye’ as well?

I have switched ‘abbaye’ to 'modify-phases' syntax, but since it is
trivial I didn't send the patch for it (I hope it's OK).

>From 310cd7241fdb8e5c37e8649473fb3d6a04e898ac Mon Sep 17 00:00:00 2001
From: Alex Kost <alez...@gmail.com>
Date: Sat, 10 Oct 2015 10:47:15 +0300
Subject: [PATCH] gnu: abbaye: Use 'sdl-union'.

* gnu/packages/games.scm (abbaye)[inputs]: Use 'sdl-union'.
  [arguments]: Adjust 'set-sdl-paths' phase accordingly.
---
 gnu/packages/games.scm | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e250bf9..dfaf838 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -163,17 +163,10 @@ scriptable with Guile.")
                   (guix build utils))
        #:phases (modify-phases %standard-phases
                   (add-after 'set-paths 'set-sdl-paths
-                    (lambda* (#:key inputs outputs (search-paths '())
-                              #:allow-other-keys)
-                      (define input-directories
-                        (match inputs
-                          (((_ . dir) ...)
-                           dir)))
-                      ;; This package does not use pkg-config, so modify CPATH
-                      ;; variable to point to include/SDL for SDL header files.
-                      (set-path-environment-variable "CPATH"
-                                                     '("include/SDL")
-                                                     input-directories)))
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (setenv "CPATH"
+                              (string-append (assoc-ref inputs "sdl-union")
+                                             "/include/SDL"))))
                   (add-after 'patch-source-shebangs 'patch-makefile
                     (lambda* (#:key outputs #:allow-other-keys)
                       ;; Replace /usr with package output directory.
@@ -192,11 +185,7 @@ scriptable with Guile.")
                   (delete 'configure))
        #:tests? #f)) ;; No check target.
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (inputs `(("sdl" ,sdl)
-              ("sdl-gfx" ,sdl-gfx)
-              ("sdl-image" ,sdl-image)
-              ("sdl-mixer" ,sdl-mixer)
-              ("sdl-ttf" ,sdl-ttf)))
+    (inputs `(("sdl-union" ,(sdl-union))))
     (home-page "http://code.google.com/p/abbaye-for-linux/";)
     (synopsis "GNU/Linux port of the indie game \"l'Abbaye des Morts\"")
     (description "L'Abbaye des Morts is a 2D platform game set in 13th century
-- 
2.5.0

Reply via email to