I don't know if there is a better workaround for the SDL headers, but
this problem is rather common: there is a workaround in 'abbaye' and a
special patch for 'pingus'.

The problem is: the source code has lines like this:

  #include <SDL_mixer.h>

but the headers of all SDL packages are placed in “include/SDL/”
subdirectories.  And an upstream often doesn't use "pkg-config" for
every SDL package to define CFLAGS and assumes that all SDL headers are
placed in one directory.  So we have to invent workarounds for such
packages.

I just mention this problem here, perhaps someone will come up with a
general solution.

>From 220a23aad452663f8262935cfa09fe5321e33602 Mon Sep 17 00:00:00 2001
From: Alex Kost <alez...@gmail.com>
Date: Sun, 4 Oct 2015 20:34:48 +0300
Subject: [PATCH 2/2] gnu: Add manaplus.

* gnu/packages/games.scm (manaplus): New variable.
---
 gnu/packages/games.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 7eb65bb..c080e61 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2015 Andreas Enge <andr...@enge.fr>
 ;;; Copyright © 2015 David Hashe <david.ha...@dhashe.com>
 ;;; Copyright © 2015 Christopher Allan Webber <cweb...@dustycloud.org>
+;;; Copyright © 2015 Alex Kost <alez...@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,6 +47,7 @@
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages physfs)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages xorg)
@@ -1047,3 +1049,59 @@ on the screen and keyboard to display letters.")
     ;; Most files under gpl2+ or gpl3+, but eat.wav under gpl3
     (license license:gpl3)))
 
+(define-public manaplus
+  (package
+    (name "manaplus")
+    (version "1.5.9.26")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://repo.manaplus.org/manaplus/download/";
+                    version "/manaplus-" version ".tar.xz"))
+              (sha256
+               (base32
+                "070ms1cv7q88284pqh66lfhacckgv7m9s8z9009k2laypibx7vs6"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:modules ((ice-9 match)
+                  (ice-9 regex)
+                  (srfi srfi-1)
+                  (guix build gnu-build-system)
+                  (guix build utils))
+       ;; The package relies on "sdl-config" to find SDL header files,
+       ;; which adds "include/SDL" for 'sdl' itself.  We need to include
+       ;; such directories for all sdl packages.
+       #:configure-flags
+       (let* ((sdl-rx   (make-regexp "\\`sdl"))
+              (includes (filter-map (match-lambda
+                                      ((name . dir)
+                                       (and (regexp-exec sdl-rx name)
+                                            (string-append
+                                             "-I" dir "/include/SDL"))))
+                                    %build-inputs)))
+         (list (format #f "CPPFLAGS=~{~a ~}" includes)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("glu" ,glu)
+       ("curl" ,curl)
+       ("libxml2" ,libxml2)
+       ("mesa" ,mesa)
+       ("physfs" ,physfs)
+       ("sdl" ,sdl)
+       ("sdl-gfx" ,sdl-gfx)
+       ("sdl-image" ,sdl-image)
+       ("sdl-mixer" ,sdl-mixer)
+       ("sdl-net" ,sdl-net)
+       ("sdl-ttf" ,sdl-ttf)))
+    (home-page "http://manaplus.org";)
+    (synopsis "Client for 'The Mana World' and similar games")
+    (description
+     "ManaPlus is a 2D MMORPG client for game servers.  It is the only
+fully supported client for @uref{http://www.themanaworld.org, The mana
+world}, @uref{http://evolonline.org, Evol Online} and
+@uref{http://landoffire.org, Land of fire}.")
+    ;; "src/debug/*" and "src/sdl2gfx/*" are under Zlib.
+    ;; "data/themes/{golden-delicious,jewelry}/*" are under CC-BY-SA.
+    ;; The rest is under GPL2+.
+    (license (list license:gpl2+ license:zlib license:cc-by-sa4.0))))
-- 
2.5.3

Reply via email to