Subject: [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase.

From: Kei Kebreau <[email-masked]>
Date: Sun, 18 Jun 2017 17:03:47 -0400

Marius Bakke <[email-masked]> writes:

> Kei Kebreau <[email-masked]> writes:
>
>> * gnu/packages/games.scm (openttd-engine): Rename package to openttd.
>> [arguments]: Add it.
>> [native-inputs]: Add openttd-opengfx.
>
> This should also mention that the (openttd) variable is now gone.
> However, I would prefer keeping "openttd-engine" and only add these
> changes to the inherited "openttd" package. What do you think?

That would be a more logical progression given the comment about adding
openttd-opengfx. I've attached the change you're talking about.

From d02c7d59d268199a04c2e57da0c9d2646052f980 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <[email-masked]>
Date: Sun, 18 Jun 2017 13:45:19 -0400
Subject: [PATCH] gnu: openttd: Add 'install-data' phase.

* gnu/packages/games.scm (openttd)[arguments]: Add it.
[native-inputs]: Add openttd-opengfx.
---
 gnu/packages/games.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index df680d11d..b8ca8dc15 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2360,7 +2360,25 @@ OpenGFX provides you with...
 (define-public openttd
   (package
     (inherit openttd-engine)
-    (name "openttd")))
+    (name "openttd")
+    (arguments
+     (substitute-keyword-arguments (package-arguments openttd-engine)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'install 'install-data
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let*
+                   ((opengfx (assoc-ref inputs "opengfx"))
+                    (out (assoc-ref outputs "out"))
+                    (gfx-dir
+                     (string-append out
+                                    "/share/games/openttd/baseset/opengfx")))
+                 (mkdir-p gfx-dir)
+                 (copy-recursively opengfx gfx-dir))
+               #t))))))
+    (native-inputs
+     `(("opengfx" ,openttd-opengfx)
+       ,@(package-native-inputs openttd-engine)))))
 
 (define-public pinball
   (package
-- 
2.13.1