unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38932] [PATCH] Add xmoto
@ 2020-01-05  1:27 Nicolas Goaziou
  2020-01-16 21:43 ` Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2020-01-05  1:27 UTC (permalink / raw)
  To: 38932

[-- Attachment #1: Type: text/plain, Size: 90 bytes --]

Hello,

The following patch adds xmoto.

Feedback welcome.

Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-xmoto.patch --]
[-- Type: text/x-diff, Size: 8666 bytes --]

From 8038314365cf2b1371428237aab938ba72ecf883 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Sun, 5 Jan 2020 02:20:35 +0100
Subject: [PATCH] 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.
---
 gnu/local.mk                                  |  3 +
 gnu/packages/games.scm                        | 85 +++++++++++++++++++
 gnu/packages/patches/xmoto-remove-glext.patch | 23 +++++
 gnu/packages/patches/xmoto-reproducible.patch | 24 ++++++
 gnu/packages/patches/xmoto-utf8.patch         | 16 ++++
 5 files changed, 151 insertions(+)
 create mode 100644 gnu/packages/patches/xmoto-remove-glext.patch
 create mode 100644 gnu/packages/patches/xmoto-reproducible.patch
 create mode 100644 gnu/packages/patches/xmoto-utf8.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 83bba6b644..92bfdbb20c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1490,6 +1490,9 @@ dist_patch_DATA =						\
   %D%/packages/patches/xf86-video-voodoo-pcitag.patch		\
   %D%/packages/patches/xfce4-panel-plugins.patch		\
   %D%/packages/patches/xfce4-settings-defaults.patch		\
+  %D%/packages/patches/xmoto-utf8.patch				\
+  %D%/packages/patches/xmoto-remove-glext.patch			\
+  %D%/packages/patches/xmoto-reproducible.patch			\
   %D%/packages/patches/xsane-fix-memory-leak.patch		\
   %D%/packages/patches/xsane-fix-pdf-floats.patch		\
   %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch	\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 066e2c8cf3..d9a3eeca35 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -9485,3 +9485,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))))
diff --git a/gnu/packages/patches/xmoto-remove-glext.patch b/gnu/packages/patches/xmoto-remove-glext.patch
new file mode 100644
index 0000000000..ad0c848d1d
--- /dev/null
+++ b/gnu/packages/patches/xmoto-remove-glext.patch
@@ -0,0 +1,23 @@
+Description: Allow building without upstream-supplied glext.h
+Author: Stephen Kitt <steve@sk2.org>
+Bug: http://todo.xmoto.tuxfamily.org/index.php?do=details&task_id=803
+
+--- xmoto-0.5.9+dfsg.orig/src/include/xm_OpenGL.h
++++ xmoto-0.5.9+dfsg/src/include/xm_OpenGL.h
+@@ -1,7 +1,6 @@
+ #ifdef ENABLE_OPENGL
+ /* Pull in OpenGL headers */
+ /* following scissored from SDL_opengl.h */
+-#define __glext_h_  /* Don't let gl.h include glext.h */
+ #ifdef HAVE_APPLE_OPENGL_FRAMEWORK
+ #include <OpenGL/gl.h>	/* Header File For The OpenGL Library */
+ #include <OpenGL/glu.h>	/* Header File For The GLU Library */
+@@ -12,8 +11,5 @@
+ #include <GL/gl.h>	/* Header File For The OpenGL Library */
+ #include <GL/glu.h>	/* Header File For The GLU Library */
+ #endif
+-#undef __glext_h_
+-
+-#include "../glext.h"
+ 
+ #endif
diff --git a/gnu/packages/patches/xmoto-reproducible.patch b/gnu/packages/patches/xmoto-reproducible.patch
new file mode 100644
index 0000000000..606f4ec714
--- /dev/null
+++ b/gnu/packages/patches/xmoto-reproducible.patch
@@ -0,0 +1,24 @@
+Description: Avoid __DATE__ and __TIME__ to build reproducibly
+Author: Stephen Kitt <skitt@debian.org>
+
+--- a/src/GameInit.cpp
++++ b/src/GameInit.cpp
+@@ -248,7 +248,6 @@
+   Logger::setActiv(XMSession::instance()->noLog() == false); /* apply log activ mode */
+ 
+   LogInfo(std::string("X-Moto " + XMBuild::getVersionString(true)).c_str());
+-  LogInfo("compiled at "__DATE__" "__TIME__);
+   if(SwapEndian::bigendien) {
+     LogInfo("Systeme is bigendien");
+   } else {
+--- a/src/states/StateOptions.cpp
++++ b/src/states/StateOptions.cpp
+@@ -1233,8 +1233,6 @@
+   int p=25;
+   makeWindowOptions_infos_line(v_window, "Version", "X-Moto " + XMBuild::getVersionString(true), p);
+   p+=20;
+-  makeWindowOptions_infos_line(v_window, "Compilation date", __DATE__ " " __TIME__, p);
+-  p+=20;
+   makeWindowOptions_infos_line(v_window, "User data directory", XMFS::getUserDir(FDT_DATA), p);
+   p+=20;
+   makeWindowOptions_infos_line(v_window, "User config directory", XMFS::getUserDir(FDT_CONFIG), p);
diff --git a/gnu/packages/patches/xmoto-utf8.patch b/gnu/packages/patches/xmoto-utf8.patch
new file mode 100644
index 0000000000..e5d0dfb2a4
--- /dev/null
+++ b/gnu/packages/patches/xmoto-utf8.patch
@@ -0,0 +1,16 @@
+Description: Build with g++'s new utf8.h
+Author: Stephen Kitt <skitt@debian.org>
+
+--- a/src/helpers/utf8.h
++++ b/src/helpers/utf8.h
+@@ -18,8 +18,8 @@
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ =============================================================================*/
+ 
+-#ifndef __UTF8_H__
+-#define __UTF8_H__
++#ifndef __XMOTO_UTF8_H__
++#define __XMOTO_UTF8_H__
+ 
+ #include <vector>
+ #include <string>
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#38932] [PATCH] Add xmoto
  2020-01-05  1:27 [bug#38932] [PATCH] Add xmoto Nicolas Goaziou
@ 2020-01-16 21:43 ` Christopher Baines
  2020-01-16 22:26   ` bug#38932: " Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2020-01-16 21:43 UTC (permalink / raw)
  To: mail; +Cc: 38932

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> The following patch adds xmoto.
>
> Feedback welcome.

Only comment I have is that "if you want to have a chance finishing the
more difficult challenges" reads better to me in the description.

Apart from that it looks good to me :)

I'm pretty sure I'm worse at the game than when I used to play it
though!

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#38932: [PATCH] Add xmoto
  2020-01-16 21:43 ` Christopher Baines
@ 2020-01-16 22:26   ` Nicolas Goaziou
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2020-01-16 22:26 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 38932-done

Hello,

Christopher Baines <mail@cbaines.net> writes:

> Only comment I have is that "if you want to have a chance finishing the
> more difficult challenges" reads better to me in the description.
>
> Apart from that it looks good to me :)

Applied as 40d2bddd01dd054e68aadc98f77380a8b9977f3c (and subsequent
patch as I had forgotten to fix the description). Thank you!

> I'm pretty sure I'm worse at the game than when I used to play it
> though!

Heh. This is a difficult game.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-16 22:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-05  1:27 [bug#38932] [PATCH] Add xmoto Nicolas Goaziou
2020-01-16 21:43 ` Christopher Baines
2020-01-16 22:26   ` bug#38932: " Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).