summary refs log tree commit diff
path: root/gnu/packages/games.scm
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2020-01-05 02:20:35 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2020-01-16 23:20:20 +0100
commit40d2bddd01dd054e68aadc98f77380a8b9977f3c (patch)
tree02d5bb971c3ab709b7826e112488ca19d7949512 /gnu/packages/games.scm
parent9e016129e16962d4f751d934fdc0fbd6c6d64ef8 (diff)
downloadguix-40d2bddd01dd054e68aadc98f77380a8b9977f3c.tar.gz
gnu: Add xmoto.
* gnu/packages/games.scm (xmoto): New variable.
* gnu/packages/patches/xmoto-remove-glext.patch: New file.
* gnu/packages/patches/xmoto-reproducible.patch: New file.
* gnu/packages/patches/xmoto-utf8.patch: New file.
* gnu/local.mk (dist_patch_DATA): Reference new files.
Diffstat (limited to 'gnu/packages/games.scm')
-rw-r--r--gnu/packages/games.scm87
1 files changed, 86 insertions, 1 deletions
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index da6c6fd078..bb7f451edc 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -30,7 +30,7 @@
 ;;; Copyright © 2017, 2019 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 okapi <okapi@firemail.cc>
 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2018 Madalin Ionel-Patrascu <madalinionel.patrascu@mdc-berlin.de>
@@ -9463,3 +9463,88 @@ control of the board by capturing or adding to one square.
 
 This package is part of the KDE games module.")
     (license (list license:gpl2+ license:fdl1.2+))))
+
+(define-public xmoto
+  (package
+    (name "xmoto")
+    (version "0.5.11")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://download.tuxfamily.org/xmoto/xmoto/" version "/"
+             "xmoto-" version "-src.tar.gz"))
+       (sha256
+        (base32 "1ci6r8zd0l7z28cy92ddf9dmqbdqwinz2y1cny34c61b57wsd155"))
+       (patches
+        (search-patches
+         "xmoto-remove-glext.patch"     ;fixes licensing issue
+         "xmoto-reproducible.patch"
+         "xmoto-utf8.patch"))
+       ;; Unbundle ODE.
+       (modules '((guix build utils)))
+       (snippet
+        `(begin
+           (delete-file-recursively "src/ode")
+           #t))))
+    (build-system gnu-build-system)
+    (arguments
+     ;; XXX: First flag prevents a build error with GCC7+.  The second
+     ;; flag works around missing text in game.  Both are fixed
+     ;; upstream.  Remove once xmoto 0.5.12+ is released.
+     `(#:make-flags '("CXXFLAGS=-fpermissive -D_GLIBCXX_USE_CXX11_ABI=0")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (apps (string-append out "/share/applications"))
+                    (pixmaps (string-append out "/share/pixmaps")))
+               (install-file "extra/xmoto.desktop" apps)
+               (install-file "extra/xmoto.xpm" pixmaps)
+               #t)))
+         (add-after 'install-desktop-file 'install-fonts
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((font-dir (string-append (assoc-ref inputs "font-dejavu")
+                                            "/share/fonts/truetype/"))
+                   (target-dir (string-append (assoc-ref outputs "out")
+                                              "/share/xmoto/Textures/Fonts/")))
+               (for-each (lambda (f)
+                           (let ((font (string-append font-dir f))
+                                 (target (string-append target-dir f)))
+                             (delete-file target)
+                             (symlink font target)))
+                         '("DejaVuSans.ttf" "DejaVuSansMono.ttf"))
+               #t)))
+         (add-after 'install-fonts 'install-man-page
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "xmoto.6"
+                           (string-append (assoc-ref outputs "out")
+                                          "/share/man/man6"))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)))
+    (inputs
+     `(("curl" ,curl)
+       ("font-dejavu" ,font-dejavu)
+       ("glu" ,glu)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libxdg-basedir" ,libxdg-basedir)
+       ("libxml2" ,libxml2)
+       ("lua" ,lua-5.2)
+       ("ode" ,ode)
+       ("sdl" ,(sdl-union (list sdl sdl-mixer sdl-net sdl-ttf)))
+       ("sqlite" ,sqlite)
+       ("zlib" ,zlib)))
+    (home-page "https://xmoto.tuxfamily.org/")
+    (synopsis "2D motocross platform game")
+    (description "X-Moto is a challenging 2D motocross platform game,
+where physics play an all important role in the gameplay.  You need to
+control your bike to its limit, if you want to have a chance finishing
+the more difficult of the challenges.")
+    (license (list license:gpl2+        ;whole project
+                   license:bsd-4        ;src/bzip
+                   license:bsd-3        ;src/md5sum
+                   license:lgpl2.1+     ;src/iqsort.h
+                   license:expat))))