unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] add kobodeluxe
@ 2016-10-16 20:47 Stephen Webber
  2016-10-16 23:22 ` Christopher Allan Webber
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Webber @ 2016-10-16 20:47 UTC (permalink / raw)
  To: guix-devel


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



[-- Attachment #1.2: Type: text/html, Size: 26 bytes --]

[-- Attachment #2: 0001-gnu-Add-kobodeluxe.patch --]
[-- Type: text/x-patch, Size: 14703 bytes --]

From c8b122d8c7cf7a574bbbac66963ac355c64effc5 Mon Sep 17 00:00:00 2001
From: Stephen Webber <webber.sl@gmail.com>
Date: Sun, 16 Oct 2016 15:04:35 -0500
Subject: [PATCH] gnu: Add kobodeluxe.

* gnu/packages/games.scm (kobodeluxe): New variable.
* gnu/packages/patches/kobodeluxe_paths.patch: New file.
* gnu/packages/patches/kobodeluxe-spelling.patch: New file.
* gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch: New file.
* gnu/packages/patches/kobodeluxe_const_charp_conversion.patch: New file.
* gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch: New file.
* gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New file.
* gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  7 +++
 gnu/packages/games.scm                             | 34 +++++++++++
 .../kobodeluxe-midicon-segmentation-fault.patch    | 24 ++++++++
 gnu/packages/patches/kobodeluxe-spelling.patch     | 25 ++++++++
 .../kobodeluxe_const_charp_conversion.patch        | 17 ++++++
 .../patches/kobodeluxe_enemies-pipe-decl.patch     | 67 ++++++++++++++++++++++
 .../kobodeluxe_graphics_window-signed-char.patch   | 38 ++++++++++++
 .../kobodeluxe_manpage-minus-not-hyphen.patch      | 15 +++++
 gnu/packages/patches/kobodeluxe_paths.patch        | 40 +++++++++++++
 9 files changed, 267 insertions(+)
 create mode 100644 gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-spelling.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_const_charp_conversion.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_paths.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 19dd9ae..ccdca77 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -621,6 +621,13 @@ dist_patch_DATA =						\
   %D%/packages/patches/jq-CVE-2015-8863.patch			\
   %D%/packages/patches/khmer-use-libraries.patch                \
   %D%/packages/patches/kmod-module-directory.patch		\
+  %D%/packages/patches/kobodeluxe_paths.patch
+  %D%/packages/patches/kobodeluxe-spelling.patch
+  %D%/packages/patches/kobodeluxe_enemies-pipe-decl.patch
+  %D%/packages/patches/kobodeluxe_const_charp_conversion.patch
+  %D%/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
+  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
+  %D%/packages/patches/kobodeluxe_graphics_window-signed-char.patch
   %D%/packages/patches/laby-make-install.patch			\
   %D%/packages/patches/ldc-disable-tests.patch			\
   %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 2bb53e0..3fed38c 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2994,3 +2995,36 @@ symbols, the game needs graphics to render the non-euclidean world.")
                    license:public-domain ; src/direntx.*
                    license:zlib          ; src/savepng.*
                    license:gpl2+))))     ; remaining files
+
+(define-public kobodeluxe
+  (package
+    (name "kobodeluxe")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://olofson.net/kobodl/download/KoboDeluxe-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "0b2wvdpnmaibsy419c16dfwj5kvd3pccby2aaqvm964x74592yqg"))
+              (patches (search-patches
+                        "kobodeluxe_const_charp_conversion.patch"
+                        "kobodeluxe_enemies-pipe-decl.patch"
+                        "kobodeluxe_graphics_window-signed-char.patch"
+                        "kobodeluxe_manpage-minus-not-hyphen.patch"
+                        "kobodeluxe-midicon-segmentation-fault.patch"
+                        "kobodeluxe_paths.patch"
+                        "kobodeluxe-spelling.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "CPPFLAGS=-I"
+                            (assoc-ref %build-inputs "sdl-union")
+                            "/include/SDL"))))
+    (inputs `(("sdl-union" ,(sdl-union (list sdl sdl-image)))))
+    (synopsis "Shooter with space station destruction")
+    (description
+     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo for Un*x
+systems with X11.")
+    (home-page "http://olofson.net/kobodl/")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
new file mode 100644
index 0000000..65ce259
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
@@ -0,0 +1,24 @@
+From: Emile CARRY <emile.carry@sequanux.org>
+Date: Wed, 6 Apr 2016 00:27:17 +0200
+Subject: midicon segmentation fault
+
+Debian-Bug: https://bugs.debian.org/819897
+Forwarded: no
+---
+ sound/a_midicon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/a_midicon.c b/sound/a_midicon.c
+index 57de3cf..ded2988 100644
+--- a/sound/a_midicon.c
++++ b/sound/a_midicon.c
+@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
+ {
+ 	m[ch].next[key] = -1;
+ 	m[ch].prev[key] = m[ch].last;
+-	m[ch].next[m[ch].last] = (char)key;
+ 	m[ch].last = (char)key;
++	m[ch].next[m[ch].last] = (char)key;
+ }
+ 
+ 
diff --git a/gnu/packages/patches/kobodeluxe-spelling.patch b/gnu/packages/patches/kobodeluxe-spelling.patch
new file mode 100644
index 0000000..21259cc
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-spelling.patch
@@ -0,0 +1,25 @@
+Description: two spelling fixes
+Author: Damyan Ivanov <dmn@debian.org>
+
+--- a/graphics/sofont.cpp
++++ b/graphics/sofont.cpp
+@@ -255,7 +255,7 @@ bool SoFont::load(SDL_Surface * FontSurf
+ 
+ 	if(!FontSurface)
+ 	{
+-		log_printf(ELOG, "SoFont recieved a NULL SDL_Surface\n");
++		log_printf(ELOG, "SoFont received a NULL SDL_Surface\n");
+ 		return false;
+ 	}
+ 	if(picture)
+--- a/prefs.cpp
++++ b/prefs.cpp
+@@ -161,7 +161,7 @@ void prefs_t::postload()
+ 
+ 	if((o_wait_msec != 30) && !cmd_cheat)
+ 	{
+-		log_printf(ELOG, "'wait' is only avaliable in cheat mode!\n");
++		log_printf(ELOG, "'wait' is only available in cheat mode!\n");
+ 		o_wait_msec = 30;
+ 	}
+ 
diff --git a/gnu/packages/patches/kobodeluxe_const_charp_conversion.patch b/gnu/packages/patches/kobodeluxe_const_charp_conversion.patch
new file mode 100644
index 0000000..a14ed4b
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_const_charp_conversion.patch
@@ -0,0 +1,17 @@
+Description: Avoid compilation error with gcc-4.4.
+ "const char* -> char*" conversion is fatal in that version
+Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Debian: http://bugs.debian.org/552548
+Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
+--- a/graphics/window.cpp
++++ b/graphics/window.cpp
+@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x, 
+ 		 */
+ 		if(token)
+ 		{
+-			char *tok = strchr(txt, token);
++			const char *tok = strchr(txt, token);
+ 			if(tok)
+ 				tokpos = tok-txt;
+ 			else
diff --git a/gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch b/gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch
new file mode 100644
index 0000000..9510ed4
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch
@@ -0,0 +1,67 @@
+# Authhor: Damyan Ivanov <dmn@debian.org>
+# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
+#              declared in system unistd.h
+# Debian-Bug: 527705
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
+--- a/enemies.h
++++ b/enemies.h
+@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
+ extern const enemy_kind cannon;
+ extern const enemy_kind pipe1;
+ extern const enemy_kind core;
+-extern const enemy_kind pipe2;
++extern const enemy_kind pipe2_kbdl;
+ extern const enemy_kind rock;
+ extern const enemy_kind ring;
+ extern const enemy_kind enemy_m1;
+@@ -430,7 +430,7 @@ inline int _enemy::realize()
+ 
+ inline int _enemy::is_pipe()
+ {
+-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
++	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
+ }
+ 
+ 
+--- a/enemy.cpp
++++ b/enemy.cpp
+@@ -755,10 +755,10 @@ void _enemy::move_core()
+ 
+ void _enemy::kill_core()
+ {
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
+ 	sound.g_base_core_explo(x, y);
+ 	release();
+@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
+ 	}
+ 	p ^= a;
+ 	if(p & U_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+ 	if(p & R_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+ 	if(p & D_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	if(p & L_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+ 	manage.add_score(10);
+ 	release();
+ }
+ 
+ 
+-const enemy_kind pipe2 = {
++const enemy_kind pipe2_kbdl = {
+ 	0,
+ 	&_enemy::make_pipe2,
+ 	&_enemy::move_pipe2,
diff --git a/gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch b/gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch
new file mode 100644
index 0000000..b258b62
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch
@@ -0,0 +1,38 @@
+# This was created in responce to Debian bug #163979
+# Thing is, if you want to compant "-1" with a char value,
+# you better make that char signed
+--- kobodeluxe-0.5.1.orig/graphics/window.cpp
++++ kobodeluxe-0.5.1/graphics/window.cpp
+@@ -331,7 +331,7 @@
+ }
+ 
+ 
+-void window_t::center_token(int _x, int _y, const char *txt, char token)
++void window_t::center_token(int _x, int _y, const char *txt, signed char token)
+ {
+ 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
+ }
+@@ -374,7 +374,7 @@
+ }
+ 
+ 
+-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
++void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
+ {
+ 	_x = CS2PIXEL((_x * xs + 128) >> 8);
+ 	_y = CS2PIXEL((_y * ys + 128) >> 8);
+--- kobodeluxe-0.5.1.orig/graphics/window.h
++++ kobodeluxe-0.5.1/graphics/window.h
+@@ -265,10 +265,10 @@
+ 	void font(int fnt);
+ 	void string(int _x, int _y, const char *txt);
+ 	void center(int _y, const char *txt);
+-	void center_token(int _x, int _y, const char *txt, char token = 0);
++	void center_token(int _x, int _y, const char *txt, signed char token = 0);
+ 	void string_fxp(int _x, int _y, const char *txt);
+ 	void center_fxp(int _y, const char *txt);
+-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
++	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
+ 	int textwidth(const char *txt, int min = 0, int max = 255);
+ 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
+ 	int fontheight();
diff --git a/gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch b/gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
new file mode 100644
index 0000000..34cab90
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
@@ -0,0 +1,15 @@
+# Author: Damyan Ivanov <dmn@debian.org>
+# Description: convert a hyphen in kobodl manpage to a minus, which is what is
+#              inttented here
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
+--- a/kobodl.6
++++ b/kobodl.6
+@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
+ Enable Vertical Sync. Default: On.
+ .TP
+ .B \-videopages
+-Number of Video Pages. Default: -1.
++Number of Video Pages. Default: \-1.
+ .TP
+ .B \-scalemode
+ Scaling Filter Mode. Default: 1.
diff --git a/gnu/packages/patches/kobodeluxe_paths.patch b/gnu/packages/patches/kobodeluxe_paths.patch
new file mode 100644
index 0000000..b54ab52
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_paths.patch
@@ -0,0 +1,40 @@
+# Disable reading of configs, graphics, and data from the current directory.
+# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
+# feeding it bad data.
+--- kobodeluxe-0.5.1.orig/kobo.cpp
++++ kobodeluxe-0.5.1/kobo.cpp
+@@ -141,21 +141,21 @@
+ 	 * Graphics data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("GFX", "./data/gfx");
++	//fmap->addpath("GFX", "./data/gfx");
+ 	/* Real data dir */
+ 	fmap->addpath("GFX", "DATA>>gfx");
+ 	/* Current dir */
+-	fmap->addpath("GFX", "./gfx");
++	//fmap->addpath("GFX", "./gfx");
+ 
+ 	/*
+ 	 * Sound data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("SFX", "./data/sfx");
++	//fmap->addpath("SFX", "./data/sfx");
+ 	/* Real data dir */
+ 	fmap->addpath("SFX", "DATA>>sfx");
+ 	/* Current dir */
+-	fmap->addpath("SFX", "./sfx");
++	//fmap->addpath("SFX", "./sfx");
+ 
+ 	/*
+ 	 * Score files (user and global)
+@@ -173,7 +173,7 @@
+ 	/* System local */
+ 	fmap->addpath("CONFIG", SYSCONF_DIR);
+ 	/* In current dir (last resort) */
+-	fmap->addpath("CONFIG", "./");
++	//fmap->addpath("CONFIG", "./");
+ }
+ 
+ 
-- 
2.1.4


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

* Re: [PATCH] add kobodeluxe
  2016-10-16 20:47 [PATCH] add kobodeluxe Stephen Webber
@ 2016-10-16 23:22 ` Christopher Allan Webber
  2016-10-17  1:58   ` Christopher Allan Webber
  2016-10-17  2:06   ` Kei Kebreau
  0 siblings, 2 replies; 10+ messages in thread
From: Christopher Allan Webber @ 2016-10-16 23:22 UTC (permalink / raw)
  To: Stephen Webber; +Cc: guix-devel

I know Stephen, so I helped him put together this package, which is his
first.  It's a long time favorite free software game.

There were a lot of patches to Kobo Deluxe in Debian; we kept finding
that it wouldn't build without one or another of them, and we read the
summary of all of them and decided they were all probably worth
including.

I think the package looks fine, but probably someone else should look it
over.  If someone can give it an ACK, I'd love to merge it (or you can)!

 - Chris

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

* Re: [PATCH] add kobodeluxe
  2016-10-16 23:22 ` Christopher Allan Webber
@ 2016-10-17  1:58   ` Christopher Allan Webber
  2016-10-17 14:50     ` Ludovic Courtès
  2016-10-17  2:06   ` Kei Kebreau
  1 sibling, 1 reply; 10+ messages in thread
From: Christopher Allan Webber @ 2016-10-17  1:58 UTC (permalink / raw)
  To: Stephen Webber; +Cc: guix-devel

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

Christopher Allan Webber writes:

> I know Stephen, so I helped him put together this package, which is his
> first.  It's a long time favorite free software game.
>
> There were a lot of patches to Kobo Deluxe in Debian; we kept finding
> that it wouldn't build without one or another of them, and we read the
> summary of all of them and decided they were all probably worth
> including.
>
> I think the package looks fine, but probably someone else should look it
> over.  If someone can give it an ACK, I'd love to merge it (or you can)!
>
>  - Chris

There was something I overlooked, mainly because we corrected it late
in the patch... the automake file is missing some backslashes.  I also
changed some underscores to dashes in the patch filenames.

New patch attached!


[-- Attachment #2: 0001-gnu-Add-kobodeluxe.patch --]
[-- Type: text/x-patch, Size: 15074 bytes --]

From c8b122d8c7cf7a574bbbac66963ac355c64effc5 Mon Sep 17 00:00:00 2001
From: Stephen Webber <webber.sl@gmail.com>
Date: Sun, 16 Oct 2016 15:04:35 -0500
Subject: [PATCH] gnu: Add kobodeluxe.

* gnu/packages/games.scm (kobodeluxe): New variable.
* gnu/packages/patches/kobodeluxe_paths.patch: New file.
* gnu/packages/patches/kobodeluxe-spelling.patch: New file.
* gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch: New file.
* gnu/packages/patches/kobodeluxe_const_charp_conversion.patch: New file.
* gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch: New file.
* gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New file.
* gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  7 +++
 gnu/packages/games.scm                             | 34 +++++++++++
 .../kobodeluxe-midicon-segmentation-fault.patch    | 24 ++++++++
 gnu/packages/patches/kobodeluxe-spelling.patch     | 25 ++++++++
 .../kobodeluxe_const_charp_conversion.patch        | 17 ++++++
 .../patches/kobodeluxe_enemies-pipe-decl.patch     | 67 ++++++++++++++++++++++
 .../kobodeluxe_graphics_window-signed-char.patch   | 38 ++++++++++++
 .../kobodeluxe_manpage-minus-not-hyphen.patch      | 15 +++++
 gnu/packages/patches/kobodeluxe_paths.patch        | 40 +++++++++++++
 9 files changed, 267 insertions(+)
 create mode 100644 gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-spelling.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_const_charp_conversion.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
 create mode 100644 gnu/packages/patches/kobodeluxe_paths.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 19dd9ae..ccdca77 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -621,6 +621,13 @@ dist_patch_DATA =						\
   %D%/packages/patches/jq-CVE-2015-8863.patch			\
   %D%/packages/patches/khmer-use-libraries.patch                \
   %D%/packages/patches/kmod-module-directory.patch		\
+  %D%/packages/patches/kobodeluxe_paths.patch
+  %D%/packages/patches/kobodeluxe-spelling.patch
+  %D%/packages/patches/kobodeluxe_enemies-pipe-decl.patch
+  %D%/packages/patches/kobodeluxe_const_charp_conversion.patch
+  %D%/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
+  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
+  %D%/packages/patches/kobodeluxe_graphics_window-signed-char.patch
   %D%/packages/patches/laby-make-install.patch			\
   %D%/packages/patches/ldc-disable-tests.patch			\
   %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 2bb53e0..3fed38c 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2994,3 +2995,36 @@ symbols, the game needs graphics to render the non-euclidean world.")
                    license:public-domain ; src/direntx.*
                    license:zlib          ; src/savepng.*
                    license:gpl2+))))     ; remaining files
+
+(define-public kobodeluxe
+  (package
+    (name "kobodeluxe")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://olofson.net/kobodl/download/KoboDeluxe-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "0b2wvdpnmaibsy419c16dfwj5kvd3pccby2aaqvm964x74592yqg"))
+              (patches (search-patches
+                        "kobodeluxe_const_charp_conversion.patch"
+                        "kobodeluxe_enemies-pipe-decl.patch"
+                        "kobodeluxe_graphics_window-signed-char.patch"
+                        "kobodeluxe_manpage-minus-not-hyphen.patch"
+                        "kobodeluxe-midicon-segmentation-fault.patch"
+                        "kobodeluxe_paths.patch"
+                        "kobodeluxe-spelling.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "CPPFLAGS=-I"
+                            (assoc-ref %build-inputs "sdl-union")
+                            "/include/SDL"))))
+    (inputs `(("sdl-union" ,(sdl-union (list sdl sdl-image)))))
+    (synopsis "Shooter with space station destruction")
+    (description
+     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo for Un*x
+systems with X11.")
+    (home-page "http://olofson.net/kobodl/")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
new file mode 100644
index 0000000..65ce259
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
@@ -0,0 +1,24 @@
+From: Emile CARRY <emile.carry@sequanux.org>
+Date: Wed, 6 Apr 2016 00:27:17 +0200
+Subject: midicon segmentation fault
+
+Debian-Bug: https://bugs.debian.org/819897
+Forwarded: no
+---
+ sound/a_midicon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/a_midicon.c b/sound/a_midicon.c
+index 57de3cf..ded2988 100644
+--- a/sound/a_midicon.c
++++ b/sound/a_midicon.c
+@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
+ {
+ 	m[ch].next[key] = -1;
+ 	m[ch].prev[key] = m[ch].last;
+-	m[ch].next[m[ch].last] = (char)key;
+ 	m[ch].last = (char)key;
++	m[ch].next[m[ch].last] = (char)key;
+ }
+ 
+ 
diff --git a/gnu/packages/patches/kobodeluxe-spelling.patch b/gnu/packages/patches/kobodeluxe-spelling.patch
new file mode 100644
index 0000000..21259cc
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-spelling.patch
@@ -0,0 +1,25 @@
+Description: two spelling fixes
+Author: Damyan Ivanov <dmn@debian.org>
+
+--- a/graphics/sofont.cpp
++++ b/graphics/sofont.cpp
+@@ -255,7 +255,7 @@ bool SoFont::load(SDL_Surface * FontSurf
+ 
+ 	if(!FontSurface)
+ 	{
+-		log_printf(ELOG, "SoFont recieved a NULL SDL_Surface\n");
++		log_printf(ELOG, "SoFont received a NULL SDL_Surface\n");
+ 		return false;
+ 	}
+ 	if(picture)
+--- a/prefs.cpp
++++ b/prefs.cpp
+@@ -161,7 +161,7 @@ void prefs_t::postload()
+ 
+ 	if((o_wait_msec != 30) && !cmd_cheat)
+ 	{
+-		log_printf(ELOG, "'wait' is only avaliable in cheat mode!\n");
++		log_printf(ELOG, "'wait' is only available in cheat mode!\n");
+ 		o_wait_msec = 30;
+ 	}
+ 
diff --git a/gnu/packages/patches/kobodeluxe_const_charp_conversion.patch b/gnu/packages/patches/kobodeluxe_const_charp_conversion.patch
new file mode 100644
index 0000000..a14ed4b
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_const_charp_conversion.patch
@@ -0,0 +1,17 @@
+Description: Avoid compilation error with gcc-4.4.
+ "const char* -> char*" conversion is fatal in that version
+Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Debian: http://bugs.debian.org/552548
+Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
+--- a/graphics/window.cpp
++++ b/graphics/window.cpp
+@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x, 
+ 		 */
+ 		if(token)
+ 		{
+-			char *tok = strchr(txt, token);
++			const char *tok = strchr(txt, token);
+ 			if(tok)
+ 				tokpos = tok-txt;
+ 			else
diff --git a/gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch b/gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch
new file mode 100644
index 0000000..9510ed4
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch
@@ -0,0 +1,67 @@
+# Authhor: Damyan Ivanov <dmn@debian.org>
+# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
+#              declared in system unistd.h
+# Debian-Bug: 527705
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
+--- a/enemies.h
++++ b/enemies.h
+@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
+ extern const enemy_kind cannon;
+ extern const enemy_kind pipe1;
+ extern const enemy_kind core;
+-extern const enemy_kind pipe2;
++extern const enemy_kind pipe2_kbdl;
+ extern const enemy_kind rock;
+ extern const enemy_kind ring;
+ extern const enemy_kind enemy_m1;
+@@ -430,7 +430,7 @@ inline int _enemy::realize()
+ 
+ inline int _enemy::is_pipe()
+ {
+-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
++	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
+ }
+ 
+ 
+--- a/enemy.cpp
++++ b/enemy.cpp
+@@ -755,10 +755,10 @@ void _enemy::move_core()
+ 
+ void _enemy::kill_core()
+ {
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
+ 	sound.g_base_core_explo(x, y);
+ 	release();
+@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
+ 	}
+ 	p ^= a;
+ 	if(p & U_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+ 	if(p & R_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+ 	if(p & D_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	if(p & L_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+ 	manage.add_score(10);
+ 	release();
+ }
+ 
+ 
+-const enemy_kind pipe2 = {
++const enemy_kind pipe2_kbdl = {
+ 	0,
+ 	&_enemy::make_pipe2,
+ 	&_enemy::move_pipe2,
diff --git a/gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch b/gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch
new file mode 100644
index 0000000..b258b62
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch
@@ -0,0 +1,38 @@
+# This was created in responce to Debian bug #163979
+# Thing is, if you want to compant "-1" with a char value,
+# you better make that char signed
+--- kobodeluxe-0.5.1.orig/graphics/window.cpp
++++ kobodeluxe-0.5.1/graphics/window.cpp
+@@ -331,7 +331,7 @@
+ }
+ 
+ 
+-void window_t::center_token(int _x, int _y, const char *txt, char token)
++void window_t::center_token(int _x, int _y, const char *txt, signed char token)
+ {
+ 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
+ }
+@@ -374,7 +374,7 @@
+ }
+ 
+ 
+-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
++void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
+ {
+ 	_x = CS2PIXEL((_x * xs + 128) >> 8);
+ 	_y = CS2PIXEL((_y * ys + 128) >> 8);
+--- kobodeluxe-0.5.1.orig/graphics/window.h
++++ kobodeluxe-0.5.1/graphics/window.h
+@@ -265,10 +265,10 @@
+ 	void font(int fnt);
+ 	void string(int _x, int _y, const char *txt);
+ 	void center(int _y, const char *txt);
+-	void center_token(int _x, int _y, const char *txt, char token = 0);
++	void center_token(int _x, int _y, const char *txt, signed char token = 0);
+ 	void string_fxp(int _x, int _y, const char *txt);
+ 	void center_fxp(int _y, const char *txt);
+-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
++	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
+ 	int textwidth(const char *txt, int min = 0, int max = 255);
+ 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
+ 	int fontheight();
diff --git a/gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch b/gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
new file mode 100644
index 0000000..34cab90
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
@@ -0,0 +1,15 @@
+# Author: Damyan Ivanov <dmn@debian.org>
+# Description: convert a hyphen in kobodl manpage to a minus, which is what is
+#              inttented here
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
+--- a/kobodl.6
++++ b/kobodl.6
+@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
+ Enable Vertical Sync. Default: On.
+ .TP
+ .B \-videopages
+-Number of Video Pages. Default: -1.
++Number of Video Pages. Default: \-1.
+ .TP
+ .B \-scalemode
+ Scaling Filter Mode. Default: 1.
diff --git a/gnu/packages/patches/kobodeluxe_paths.patch b/gnu/packages/patches/kobodeluxe_paths.patch
new file mode 100644
index 0000000..b54ab52
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe_paths.patch
@@ -0,0 +1,40 @@
+# Disable reading of configs, graphics, and data from the current directory.
+# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
+# feeding it bad data.
+--- kobodeluxe-0.5.1.orig/kobo.cpp
++++ kobodeluxe-0.5.1/kobo.cpp
+@@ -141,21 +141,21 @@
+ 	 * Graphics data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("GFX", "./data/gfx");
++	//fmap->addpath("GFX", "./data/gfx");
+ 	/* Real data dir */
+ 	fmap->addpath("GFX", "DATA>>gfx");
+ 	/* Current dir */
+-	fmap->addpath("GFX", "./gfx");
++	//fmap->addpath("GFX", "./gfx");
+ 
+ 	/*
+ 	 * Sound data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("SFX", "./data/sfx");
++	//fmap->addpath("SFX", "./data/sfx");
+ 	/* Real data dir */
+ 	fmap->addpath("SFX", "DATA>>sfx");
+ 	/* Current dir */
+-	fmap->addpath("SFX", "./sfx");
++	//fmap->addpath("SFX", "./sfx");
+ 
+ 	/*
+ 	 * Score files (user and global)
+@@ -173,7 +173,7 @@
+ 	/* System local */
+ 	fmap->addpath("CONFIG", SYSCONF_DIR);
+ 	/* In current dir (last resort) */
+-	fmap->addpath("CONFIG", "./");
++	//fmap->addpath("CONFIG", "./");
+ }
+ 
+ 
-- 
2.1.4


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

* Re: [PATCH] add kobodeluxe
  2016-10-16 23:22 ` Christopher Allan Webber
  2016-10-17  1:58   ` Christopher Allan Webber
@ 2016-10-17  2:06   ` Kei Kebreau
  2016-10-17  2:19     ` Stephen Webber
  1 sibling, 1 reply; 10+ messages in thread
From: Kei Kebreau @ 2016-10-17  2:06 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

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

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> I know Stephen, so I helped him put together this package, which is his
> first.  It's a long time favorite free software game.
>
> There were a lot of patches to Kobo Deluxe in Debian; we kept finding
> that it wouldn't build without one or another of them, and we read the
> summary of all of them and decided they were all probably worth
> including.
>
> I think the package looks fine, but probably someone else should look it
> over.  If someone can give it an ACK, I'd love to merge it (or you can)!
>
>  - Chris

I love this game! It's a solid patch except for two things:

I can't make a permanent user profile. This is a somewhat popular
problem for games to have.

When I applied the patch, git complained about trailing whitespace; a
trivial fix.

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

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

* Re: [PATCH] add kobodeluxe
  2016-10-17  2:06   ` Kei Kebreau
@ 2016-10-17  2:19     ` Stephen Webber
  2016-10-17 14:14       ` Christopher Allan Webber
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Webber @ 2016-10-17  2:19 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

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

As for the permanent user profile, one of the debian patches I applied
changed the functionality for security reason. I'm not certain I have the
expertise to make a correcting decision at this time, especially that is in
line with guix conventions about state.

I'll remember the feedback on patch name convention in the future. Thank
you for your review!


On Sun, Oct 16, 2016 at 9:06 PM, Kei Kebreau <kei@openmailbox.org> wrote:

> Christopher Allan Webber <cwebber@dustycloud.org> writes:
>
> > I know Stephen, so I helped him put together this package, which is his
> > first.  It's a long time favorite free software game.
> >
> > There were a lot of patches to Kobo Deluxe in Debian; we kept finding
> > that it wouldn't build without one or another of them, and we read the
> > summary of all of them and decided they were all probably worth
> > including.
> >
> > I think the package looks fine, but probably someone else should look it
> > over.  If someone can give it an ACK, I'd love to merge it (or you can)!
> >
> >  - Chris
>
> I love this game! It's a solid patch except for two things:
>
> I can't make a permanent user profile. This is a somewhat popular
> problem for games to have.
>
> When I applied the patch, git complained about trailing whitespace; a
> trivial fix.
>

[-- Attachment #2: Type: text/html, Size: 1845 bytes --]

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

* Re: [PATCH] add kobodeluxe
  2016-10-17  2:19     ` Stephen Webber
@ 2016-10-17 14:14       ` Christopher Allan Webber
  2016-10-17 16:41         ` Kei Kebreau
  0 siblings, 1 reply; 10+ messages in thread
From: Christopher Allan Webber @ 2016-10-17 14:14 UTC (permalink / raw)
  To: Stephen Webber; +Cc: guix-devel

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

Stephen Webber writes:

> As for the permanent user profile, one of the debian patches I applied
> changed the functionality for security reason. I'm not certain I have the
> expertise to make a correcting decision at this time, especially that is in
> line with guix conventions about state.

I also don't feel qualified to interpret the potential security issue in
the patch, not to build an alternative path based patch that's not at
supposed risk.  My suggestion is: let's accept the patch now, and if
someone can come up with a reason why the Debian-applied patch wasn't
needed, we can remove it, or if they can come up with a patch that
switches it to paths in the user's home directory, we can do that.

WDYT?

> On Sun, Oct 16, 2016 at 9:06 PM, Kei Kebreau <kei@openmailbox.org> wrote:
>> When I applied the patch, git complained about trailing whitespace; a
>> trivial fix.

Those whitespace "errors" were in the original patches we borrowed from
Debian, and weren't on any of the lines that patch in new code.
Nonetheless the patches seem to apply fine without them, so here's an
adjusted patch that fixes that.  (It also fixes the commit line, since I
forgot to change the underscores to hyphens there in my last patch!)

 - Chris


[-- Attachment #2: 0001-gnu-Add-kobodeluxe.patch --]
[-- Type: text/x-patch, Size: 15072 bytes --]

From 62bf271a6907bd5b0ec73662bc3f92c64aafa229 Mon Sep 17 00:00:00 2001
From: Stephen Webber <webber.sl@gmail.com>
Date: Sun, 16 Oct 2016 15:04:35 -0500
Subject: [PATCH] gnu: Add kobodeluxe.

* gnu/packages/games.scm (kobodeluxe): New variable.
* gnu/packages/patches/kobodeluxe-paths.patch: New file.
* gnu/packages/patches/kobodeluxe-spelling.patch: New file.
* gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch: New file.
* gnu/packages/patches/kobodeluxe-const-charp-conversion.patch: New file.
* gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch: New file.
* gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New file.
* gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  7 +++
 gnu/packages/games.scm                             | 34 +++++++++++
 .../kobodeluxe-const-charp-conversion.patch        | 17 ++++++
 .../patches/kobodeluxe-enemies-pipe-decl.patch     | 67 ++++++++++++++++++++++
 .../kobodeluxe-graphics-window-signed-char.patch   | 38 ++++++++++++
 .../kobodeluxe-manpage-minus-not-hyphen.patch      | 15 +++++
 .../kobodeluxe-midicon-segmentation-fault.patch    | 24 ++++++++
 gnu/packages/patches/kobodeluxe-paths.patch        | 40 +++++++++++++
 gnu/packages/patches/kobodeluxe-spelling.patch     | 25 ++++++++
 9 files changed, 267 insertions(+)
 create mode 100644 gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-paths.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-spelling.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 19dd9ae..a358939 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -621,6 +621,13 @@ dist_patch_DATA =						\
   %D%/packages/patches/jq-CVE-2015-8863.patch			\
   %D%/packages/patches/khmer-use-libraries.patch                \
   %D%/packages/patches/kmod-module-directory.patch		\
+  %D%/packages/patches/kobodeluxe-paths.patch			\
+  %D%/packages/patches/kobodeluxe-spelling.patch		\
+  %D%/packages/patches/kobodeluxe-enemies-pipe-decl.patch	\
+  %D%/packages/patches/kobodeluxe-const-charp-conversion.patch	\
+  %D%/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch	\
+  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch	\
+  %D%/packages/patches/kobodeluxe-graphics-window-signed-char.patch	\
   %D%/packages/patches/laby-make-install.patch			\
   %D%/packages/patches/ldc-disable-tests.patch			\
   %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 2bb53e0..7c43f84 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2994,3 +2995,36 @@ symbols, the game needs graphics to render the non-euclidean world.")
                    license:public-domain ; src/direntx.*
                    license:zlib          ; src/savepng.*
                    license:gpl2+))))     ; remaining files
+
+(define-public kobodeluxe
+  (package
+    (name "kobodeluxe")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://olofson.net/kobodl/download/KoboDeluxe-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "0b2wvdpnmaibsy419c16dfwj5kvd3pccby2aaqvm964x74592yqg"))
+              (patches (search-patches
+                        "kobodeluxe-const-charp-conversion.patch"
+                        "kobodeluxe-enemies-pipe-decl.patch"
+                        "kobodeluxe-graphics-window-signed-char.patch"
+                        "kobodeluxe-manpage-minus-not-hyphen.patch"
+                        "kobodeluxe-midicon-segmentation-fault.patch"
+                        "kobodeluxe-paths.patch"
+                        "kobodeluxe-spelling.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "CPPFLAGS=-I"
+                            (assoc-ref %build-inputs "sdl-union")
+                            "/include/SDL"))))
+    (inputs `(("sdl-union" ,(sdl-union (list sdl sdl-image)))))
+    (synopsis "Shooter with space station destruction")
+    (description
+     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo for Un*x
+systems with X11.")
+    (home-page "http://olofson.net/kobodl/")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
new file mode 100644
index 0000000..8386cf8
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
@@ -0,0 +1,17 @@
+Description: Avoid compilation error with gcc-4.4.
+ "const char* -> char*" conversion is fatal in that version
+Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Debian: http://bugs.debian.org/552548
+Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
+--- a/graphics/window.cpp
++++ b/graphics/window.cpp
+@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x,
+ 		 */
+ 		if(token)
+ 		{
+-			char *tok = strchr(txt, token);
++			const char *tok = strchr(txt, token);
+ 			if(tok)
+ 				tokpos = tok-txt;
+ 			else
diff --git a/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
new file mode 100644
index 0000000..05cd884
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
@@ -0,0 +1,67 @@
+# Authhor: Damyan Ivanov <dmn@debian.org>
+# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
+#              declared in system unistd.h
+# Debian-Bug: 527705
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
+--- a/enemies.h
++++ b/enemies.h
+@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
+ extern const enemy_kind cannon;
+ extern const enemy_kind pipe1;
+ extern const enemy_kind core;
+-extern const enemy_kind pipe2;
++extern const enemy_kind pipe2_kbdl;
+ extern const enemy_kind rock;
+ extern const enemy_kind ring;
+ extern const enemy_kind enemy_m1;
+@@ -430,7 +430,7 @@ inline int _enemy::realize()
+
+ inline int _enemy::is_pipe()
+ {
+-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
++	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
+ }
+
+
+--- a/enemy.cpp
++++ b/enemy.cpp
+@@ -755,10 +755,10 @@ void _enemy::move_core()
+
+ void _enemy::kill_core()
+ {
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
+ 	sound.g_base_core_explo(x, y);
+ 	release();
+@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
+ 	}
+ 	p ^= a;
+ 	if(p & U_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+ 	if(p & R_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+ 	if(p & D_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	if(p & L_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+ 	manage.add_score(10);
+ 	release();
+ }
+
+
+-const enemy_kind pipe2 = {
++const enemy_kind pipe2_kbdl = {
+ 	0,
+ 	&_enemy::make_pipe2,
+ 	&_enemy::move_pipe2,
diff --git a/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
new file mode 100644
index 0000000..d626618
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
@@ -0,0 +1,38 @@
+# This was created in responce to Debian bug #163979
+# Thing is, if you want to compant "-1" with a char value,
+# you better make that char signed
+--- kobodeluxe-0.5.1.orig/graphics/window.cpp
++++ kobodeluxe-0.5.1/graphics/window.cpp
+@@ -331,7 +331,7 @@
+ }
+
+
+-void window_t::center_token(int _x, int _y, const char *txt, char token)
++void window_t::center_token(int _x, int _y, const char *txt, signed char token)
+ {
+ 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
+ }
+@@ -374,7 +374,7 @@
+ }
+
+
+-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
++void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
+ {
+ 	_x = CS2PIXEL((_x * xs + 128) >> 8);
+ 	_y = CS2PIXEL((_y * ys + 128) >> 8);
+--- kobodeluxe-0.5.1.orig/graphics/window.h
++++ kobodeluxe-0.5.1/graphics/window.h
+@@ -265,10 +265,10 @@
+ 	void font(int fnt);
+ 	void string(int _x, int _y, const char *txt);
+ 	void center(int _y, const char *txt);
+-	void center_token(int _x, int _y, const char *txt, char token = 0);
++	void center_token(int _x, int _y, const char *txt, signed char token = 0);
+ 	void string_fxp(int _x, int _y, const char *txt);
+ 	void center_fxp(int _y, const char *txt);
+-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
++	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
+ 	int textwidth(const char *txt, int min = 0, int max = 255);
+ 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
+ 	int fontheight();
diff --git a/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
new file mode 100644
index 0000000..34cab90
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
@@ -0,0 +1,15 @@
+# Author: Damyan Ivanov <dmn@debian.org>
+# Description: convert a hyphen in kobodl manpage to a minus, which is what is
+#              inttented here
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
+--- a/kobodl.6
++++ b/kobodl.6
+@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
+ Enable Vertical Sync. Default: On.
+ .TP
+ .B \-videopages
+-Number of Video Pages. Default: -1.
++Number of Video Pages. Default: \-1.
+ .TP
+ .B \-scalemode
+ Scaling Filter Mode. Default: 1.
diff --git a/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
new file mode 100644
index 0000000..3348348
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
@@ -0,0 +1,24 @@
+From: Emile CARRY <emile.carry@sequanux.org>
+Date: Wed, 6 Apr 2016 00:27:17 +0200
+Subject: midicon segmentation fault
+
+Debian-Bug: https://bugs.debian.org/819897
+Forwarded: no
+---
+ sound/a_midicon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/a_midicon.c b/sound/a_midicon.c
+index 57de3cf..ded2988 100644
+--- a/sound/a_midicon.c
++++ b/sound/a_midicon.c
+@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
+ {
+ 	m[ch].next[key] = -1;
+ 	m[ch].prev[key] = m[ch].last;
+-	m[ch].next[m[ch].last] = (char)key;
+ 	m[ch].last = (char)key;
++	m[ch].next[m[ch].last] = (char)key;
+ }
+
+
diff --git a/gnu/packages/patches/kobodeluxe-paths.patch b/gnu/packages/patches/kobodeluxe-paths.patch
new file mode 100644
index 0000000..87c7b3a
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-paths.patch
@@ -0,0 +1,40 @@
+# Disable reading of configs, graphics, and data from the current directory.
+# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
+# feeding it bad data.
+--- kobodeluxe-0.5.1.orig/kobo.cpp
++++ kobodeluxe-0.5.1/kobo.cpp
+@@ -141,21 +141,21 @@
+ 	 * Graphics data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("GFX", "./data/gfx");
++	//fmap->addpath("GFX", "./data/gfx");
+ 	/* Real data dir */
+ 	fmap->addpath("GFX", "DATA>>gfx");
+ 	/* Current dir */
+-	fmap->addpath("GFX", "./gfx");
++	//fmap->addpath("GFX", "./gfx");
+
+ 	/*
+ 	 * Sound data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("SFX", "./data/sfx");
++	//fmap->addpath("SFX", "./data/sfx");
+ 	/* Real data dir */
+ 	fmap->addpath("SFX", "DATA>>sfx");
+ 	/* Current dir */
+-	fmap->addpath("SFX", "./sfx");
++	//fmap->addpath("SFX", "./sfx");
+
+ 	/*
+ 	 * Score files (user and global)
+@@ -173,7 +173,7 @@
+ 	/* System local */
+ 	fmap->addpath("CONFIG", SYSCONF_DIR);
+ 	/* In current dir (last resort) */
+-	fmap->addpath("CONFIG", "./");
++	//fmap->addpath("CONFIG", "./");
+ }
+
+
diff --git a/gnu/packages/patches/kobodeluxe-spelling.patch b/gnu/packages/patches/kobodeluxe-spelling.patch
new file mode 100644
index 0000000..cca1629
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-spelling.patch
@@ -0,0 +1,25 @@
+Description: two spelling fixes
+Author: Damyan Ivanov <dmn@debian.org>
+
+--- a/graphics/sofont.cpp
++++ b/graphics/sofont.cpp
+@@ -255,7 +255,7 @@ bool SoFont::load(SDL_Surface * FontSurf
+
+ 	if(!FontSurface)
+ 	{
+-		log_printf(ELOG, "SoFont recieved a NULL SDL_Surface\n");
++		log_printf(ELOG, "SoFont received a NULL SDL_Surface\n");
+ 		return false;
+ 	}
+ 	if(picture)
+--- a/prefs.cpp
++++ b/prefs.cpp
+@@ -161,7 +161,7 @@ void prefs_t::postload()
+
+ 	if((o_wait_msec != 30) && !cmd_cheat)
+ 	{
+-		log_printf(ELOG, "'wait' is only avaliable in cheat mode!\n");
++		log_printf(ELOG, "'wait' is only available in cheat mode!\n");
+ 		o_wait_msec = 30;
+ 	}
+
-- 
2.10.1


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

* Re: [PATCH] add kobodeluxe
  2016-10-17  1:58   ` Christopher Allan Webber
@ 2016-10-17 14:50     ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2016-10-17 14:50 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

Hello!

Welcome, Stephen!

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

> From c8b122d8c7cf7a574bbbac66963ac355c64effc5 Mon Sep 17 00:00:00 2001
> From: Stephen Webber <webber.sl@gmail.com>
> Date: Sun, 16 Oct 2016 15:04:35 -0500
> Subject: [PATCH] gnu: Add kobodeluxe.
>
> * gnu/packages/games.scm (kobodeluxe): New variable.
> * gnu/packages/patches/kobodeluxe_paths.patch: New file.
> * gnu/packages/patches/kobodeluxe-spelling.patch: New file.
> * gnu/packages/patches/kobodeluxe_enemies-pipe-decl.patch: New file.
> * gnu/packages/patches/kobodeluxe_const_charp_conversion.patch: New file.
> * gnu/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch: New file.
> * gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New file.
> * gnu/packages/patches/kobodeluxe_graphics_window-signed-char.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.

Overall looks good to me!  I have minor/cosmetic suggestions, but
otherwise this is ready for commit IMO.

> +  %D%/packages/patches/kobodeluxe_paths.patch
> +  %D%/packages/patches/kobodeluxe-spelling.patch
> +  %D%/packages/patches/kobodeluxe_enemies-pipe-decl.patch
> +  %D%/packages/patches/kobodeluxe_const_charp_conversion.patch
> +  %D%/packages/patches/kobodeluxe_manpage-minus-not-hyphen.patch
> +  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
> +  %D%/packages/patches/kobodeluxe_graphics_window-signed-char.patch

Maybe use only hyphens in file names for consistency.

> +    (synopsis "Shooter with space station destruction")
> +    (description
> +     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo for Un*x
> +systems with X11.")

Maybe s/XKobo.*/XKobo graphical game/.

That way ‘guix package -s game’ will return it.  :-)

> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-spelling.patch
> @@ -0,0 +1,25 @@
> +Description: two spelling fixes
> +Author: Damyan Ivanov <dmn@debian.org>

Maybe this patch can be omitted; hopefully it’ll be fixed in the next
release.

> +++ b/gnu/packages/patches/kobodeluxe_paths.patch
> @@ -0,0 +1,40 @@
> +# Disable reading of configs, graphics, and data from the current directory.
> +# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
> +# feeding it bad data.

Could you indicate the origin or status of this patch?

Chris: feel free to push an updated version!

Stephen, you picked a tricky package as your first patch but it’s
perfect!  I’m sure you had a good mentor too.  ;-)

Ludo’.

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

* Re: [PATCH] add kobodeluxe
  2016-10-17 14:14       ` Christopher Allan Webber
@ 2016-10-17 16:41         ` Kei Kebreau
  2016-10-18  3:49           ` Stephen Webber
  0 siblings, 1 reply; 10+ messages in thread
From: Kei Kebreau @ 2016-10-17 16:41 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

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

Christopher Allan Webber <cwebber@dustycloud.org> writes:

>> On Sun, Oct 16, 2016 at 9:06 PM, Kei Kebreau <kei@openmailbox.org> wrote:
>>> When I applied the patch, git complained about trailing whitespace; a
>>> trivial fix.
>
> Those whitespace "errors" were in the original patches we borrowed from
> Debian, and weren't on any of the lines that patch in new code.
> Nonetheless the patches seem to apply fine without them, so here's an
> adjusted patch that fixes that.  (It also fixes the commit line, since I
> forgot to change the underscores to hyphens there in my last patch!)
>
>  - Chris
>
> From 62bf271a6907bd5b0ec73662bc3f92c64aafa229 Mon Sep 17 00:00:00 2001
> From: Stephen Webber <webber.sl@gmail.com>
> Date: Sun, 16 Oct 2016 15:04:35 -0500
> Subject: [PATCH] gnu: Add kobodeluxe.
>
> * gnu/packages/games.scm (kobodeluxe): New variable.
> * gnu/packages/patches/kobodeluxe-paths.patch: New file.
> * gnu/packages/patches/kobodeluxe-spelling.patch: New file.
> * gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch: New file.
> * gnu/packages/patches/kobodeluxe-const-charp-conversion.patch: New file.
> * gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch: New file.
> * gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New file.
> * gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> ---
>  gnu/local.mk                                       |  7 +++
>  gnu/packages/games.scm                             | 34 +++++++++++
>  .../kobodeluxe-const-charp-conversion.patch        | 17 ++++++
>  .../patches/kobodeluxe-enemies-pipe-decl.patch     | 67 ++++++++++++++++++++++
>  .../kobodeluxe-graphics-window-signed-char.patch   | 38 ++++++++++++
>  .../kobodeluxe-manpage-minus-not-hyphen.patch      | 15 +++++
>  .../kobodeluxe-midicon-segmentation-fault.patch    | 24 ++++++++
>  gnu/packages/patches/kobodeluxe-paths.patch        | 40 +++++++++++++
>  gnu/packages/patches/kobodeluxe-spelling.patch     | 25 ++++++++
>  9 files changed, 267 insertions(+)
>  create mode 100644 gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
>  create mode 100644 gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
>  create mode 100644 gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
>  create mode 100644 gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
>  create mode 100644 gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
>  create mode 100644 gnu/packages/patches/kobodeluxe-paths.patch
>  create mode 100644 gnu/packages/patches/kobodeluxe-spelling.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 19dd9ae..a358939 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -621,6 +621,13 @@ dist_patch_DATA =						\
>    %D%/packages/patches/jq-CVE-2015-8863.patch			\
>    %D%/packages/patches/khmer-use-libraries.patch                \
>    %D%/packages/patches/kmod-module-directory.patch		\
> +  %D%/packages/patches/kobodeluxe-paths.patch			\
> +  %D%/packages/patches/kobodeluxe-spelling.patch		\
> +  %D%/packages/patches/kobodeluxe-enemies-pipe-decl.patch	\
> +  %D%/packages/patches/kobodeluxe-const-charp-conversion.patch	\
> +  %D%/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch	\
> +  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch	\
> +  %D%/packages/patches/kobodeluxe-graphics-window-signed-char.patch	\
>    %D%/packages/patches/laby-make-install.patch			\
>    %D%/packages/patches/ldc-disable-tests.patch			\
>    %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index 2bb53e0..7c43f84 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -23,6 +23,7 @@
>  ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
> +;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -2994,3 +2995,36 @@ symbols, the game needs graphics to render the non-euclidean world.")
>                     license:public-domain ; src/direntx.*
>                     license:zlib          ; src/savepng.*
>                     license:gpl2+))))     ; remaining files
> +
> +(define-public kobodeluxe
> +  (package
> +    (name "kobodeluxe")
> +    (version "0.5.1")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "http://olofson.net/kobodl/download/KoboDeluxe-"
> +                                  version ".tar.bz2"))
> +              (sha256
> +               (base32
> +                "0b2wvdpnmaibsy419c16dfwj5kvd3pccby2aaqvm964x74592yqg"))
> +              (patches (search-patches
> +                        "kobodeluxe-const-charp-conversion.patch"
> +                        "kobodeluxe-enemies-pipe-decl.patch"
> +                        "kobodeluxe-graphics-window-signed-char.patch"
> +                        "kobodeluxe-manpage-minus-not-hyphen.patch"
> +                        "kobodeluxe-midicon-segmentation-fault.patch"
> +                        "kobodeluxe-paths.patch"
> +                        "kobodeluxe-spelling.patch"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:configure-flags
> +       (list (string-append "CPPFLAGS=-I"
> +                            (assoc-ref %build-inputs "sdl-union")
> +                            "/include/SDL"))))
> +    (inputs `(("sdl-union" ,(sdl-union (list sdl sdl-image)))))
> +    (synopsis "Shooter with space station destruction")
> +    (description
> +     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo for Un*x
> +systems with X11.")
> +    (home-page "http://olofson.net/kobodl/")
> +    (license license:gpl2+)))
> diff --git a/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
> new file mode 100644
> index 0000000..8386cf8
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
> @@ -0,0 +1,17 @@
> +Description: Avoid compilation error with gcc-4.4.
> + "const char* -> char*" conversion is fatal in that version
> +Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
> +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
> +Bug-Debian: http://bugs.debian.org/552548
> +Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
> +--- a/graphics/window.cpp
> ++++ b/graphics/window.cpp
> +@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x,
> + 		 */
> + 		if(token)
> + 		{
> +-			char *tok = strchr(txt, token);
> ++			const char *tok = strchr(txt, token);
> + 			if(tok)
> + 				tokpos = tok-txt;
> + 			else
> diff --git a/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
> new file mode 100644
> index 0000000..05cd884
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
> @@ -0,0 +1,67 @@
> +# Authhor: Damyan Ivanov <dmn@debian.org>
> +# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
> +#              declared in system unistd.h
> +# Debian-Bug: 527705
> +# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
> +--- a/enemies.h
> ++++ b/enemies.h
> +@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
> + extern const enemy_kind cannon;
> + extern const enemy_kind pipe1;
> + extern const enemy_kind core;
> +-extern const enemy_kind pipe2;
> ++extern const enemy_kind pipe2_kbdl;
> + extern const enemy_kind rock;
> + extern const enemy_kind ring;
> + extern const enemy_kind enemy_m1;
> +@@ -430,7 +430,7 @@ inline int _enemy::realize()
> +
> + inline int _enemy::is_pipe()
> + {
> +-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
> ++	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
> + }
> +
> +
> +--- a/enemy.cpp
> ++++ b/enemy.cpp
> +@@ -755,10 +755,10 @@ void _enemy::move_core()
> +
> + void _enemy::kill_core()
> + {
> +-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> +-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> +-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> +-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> ++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> ++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> ++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> ++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> + 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
> + 	sound.g_base_core_explo(x, y);
> + 	release();
> +@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
> + 	}
> + 	p ^= a;
> + 	if(p & U_MASK)
> +-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> ++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> + 	if(p & R_MASK)
> +-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> ++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> + 	if(p & D_MASK)
> +-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> ++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> + 	if(p & L_MASK)
> +-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> ++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> + 	manage.add_score(10);
> + 	release();
> + }
> +
> +
> +-const enemy_kind pipe2 = {
> ++const enemy_kind pipe2_kbdl = {
> + 	0,
> + 	&_enemy::make_pipe2,
> + 	&_enemy::move_pipe2,
> diff --git a/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
> new file mode 100644
> index 0000000..d626618
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
> @@ -0,0 +1,38 @@
> +# This was created in responce to Debian bug #163979
> +# Thing is, if you want to compant "-1" with a char value,
> +# you better make that char signed
> +--- kobodeluxe-0.5.1.orig/graphics/window.cpp
> ++++ kobodeluxe-0.5.1/graphics/window.cpp
> +@@ -331,7 +331,7 @@
> + }
> +
> +
> +-void window_t::center_token(int _x, int _y, const char *txt, char token)
> ++void window_t::center_token(int _x, int _y, const char *txt, signed char token)
> + {
> + 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
> + }
> +@@ -374,7 +374,7 @@
> + }
> +
> +
> +-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
> ++void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
> + {
> + 	_x = CS2PIXEL((_x * xs + 128) >> 8);
> + 	_y = CS2PIXEL((_y * ys + 128) >> 8);
> +--- kobodeluxe-0.5.1.orig/graphics/window.h
> ++++ kobodeluxe-0.5.1/graphics/window.h
> +@@ -265,10 +265,10 @@
> + 	void font(int fnt);
> + 	void string(int _x, int _y, const char *txt);
> + 	void center(int _y, const char *txt);
> +-	void center_token(int _x, int _y, const char *txt, char token = 0);
> ++	void center_token(int _x, int _y, const char *txt, signed char token = 0);
> + 	void string_fxp(int _x, int _y, const char *txt);
> + 	void center_fxp(int _y, const char *txt);
> +-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
> ++	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
> + 	int textwidth(const char *txt, int min = 0, int max = 255);
> + 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
> + 	int fontheight();
> diff --git a/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
> new file mode 100644
> index 0000000..34cab90
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
> @@ -0,0 +1,15 @@
> +# Author: Damyan Ivanov <dmn@debian.org>
> +# Description: convert a hyphen in kobodl manpage to a minus, which is what is
> +#              inttented here
> +# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
> +--- a/kobodl.6
> ++++ b/kobodl.6
> +@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
> + Enable Vertical Sync. Default: On.
> + .TP
> + .B \-videopages
> +-Number of Video Pages. Default: -1.
> ++Number of Video Pages. Default: \-1.
> + .TP
> + .B \-scalemode
> + Scaling Filter Mode. Default: 1.
> diff --git a/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
> new file mode 100644
> index 0000000..3348348
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
> @@ -0,0 +1,24 @@
> +From: Emile CARRY <emile.carry@sequanux.org>
> +Date: Wed, 6 Apr 2016 00:27:17 +0200
> +Subject: midicon segmentation fault
> +
> +Debian-Bug: https://bugs.debian.org/819897
> +Forwarded: no
> +---
> + sound/a_midicon.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/sound/a_midicon.c b/sound/a_midicon.c
> +index 57de3cf..ded2988 100644
> +--- a/sound/a_midicon.c
> ++++ b/sound/a_midicon.c
> +@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
> + {
> + 	m[ch].next[key] = -1;
> + 	m[ch].prev[key] = m[ch].last;
> +-	m[ch].next[m[ch].last] = (char)key;
> + 	m[ch].last = (char)key;
> ++	m[ch].next[m[ch].last] = (char)key;
> + }
> +
> +
> diff --git a/gnu/packages/patches/kobodeluxe-paths.patch b/gnu/packages/patches/kobodeluxe-paths.patch
> new file mode 100644
> index 0000000..87c7b3a
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-paths.patch
> @@ -0,0 +1,40 @@
> +# Disable reading of configs, graphics, and data from the current directory.
> +# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
> +# feeding it bad data.
> +--- kobodeluxe-0.5.1.orig/kobo.cpp
> ++++ kobodeluxe-0.5.1/kobo.cpp
> +@@ -141,21 +141,21 @@
> + 	 * Graphics data
> + 	 */
> + 	/* Current dir; from within the build tree */
> +-	fmap->addpath("GFX", "./data/gfx");
> ++	//fmap->addpath("GFX", "./data/gfx");
> + 	/* Real data dir */
> + 	fmap->addpath("GFX", "DATA>>gfx");
> + 	/* Current dir */
> +-	fmap->addpath("GFX", "./gfx");
> ++	//fmap->addpath("GFX", "./gfx");
> +
> + 	/*
> + 	 * Sound data
> + 	 */
> + 	/* Current dir; from within the build tree */
> +-	fmap->addpath("SFX", "./data/sfx");
> ++	//fmap->addpath("SFX", "./data/sfx");
> + 	/* Real data dir */
> + 	fmap->addpath("SFX", "DATA>>sfx");
> + 	/* Current dir */
> +-	fmap->addpath("SFX", "./sfx");
> ++	//fmap->addpath("SFX", "./sfx");
> +
> + 	/*
> + 	 * Score files (user and global)
> +@@ -173,7 +173,7 @@
> + 	/* System local */
> + 	fmap->addpath("CONFIG", SYSCONF_DIR);
> + 	/* In current dir (last resort) */
> +-	fmap->addpath("CONFIG", "./");
> ++	//fmap->addpath("CONFIG", "./");
> + }
> +
> +
> diff --git a/gnu/packages/patches/kobodeluxe-spelling.patch b/gnu/packages/patches/kobodeluxe-spelling.patch
> new file mode 100644
> index 0000000..cca1629
> --- /dev/null
> +++ b/gnu/packages/patches/kobodeluxe-spelling.patch
> @@ -0,0 +1,25 @@
> +Description: two spelling fixes
> +Author: Damyan Ivanov <dmn@debian.org>
> +
> +--- a/graphics/sofont.cpp
> ++++ b/graphics/sofont.cpp
> +@@ -255,7 +255,7 @@ bool SoFont::load(SDL_Surface * FontSurf
> +
> + 	if(!FontSurface)
> + 	{
> +-		log_printf(ELOG, "SoFont recieved a NULL SDL_Surface\n");
> ++		log_printf(ELOG, "SoFont received a NULL SDL_Surface\n");
> + 		return false;
> + 	}
> + 	if(picture)
> +--- a/prefs.cpp
> ++++ b/prefs.cpp
> +@@ -161,7 +161,7 @@ void prefs_t::postload()
> +
> + 	if((o_wait_msec != 30) && !cmd_cheat)
> + 	{
> +-		log_printf(ELOG, "'wait' is only avaliable in cheat mode!\n");
> ++		log_printf(ELOG, "'wait' is only available in cheat mode!\n");
> + 		o_wait_msec = 30;
> + 	}
> +

Less whitespace errors, but the patches apply to the kobodeluxe source
code just fine. But other than what Ludovic brought up and my
nitpicking, the patch looks good. :-)

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

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

* Re: [PATCH] add kobodeluxe
  2016-10-17 16:41         ` Kei Kebreau
@ 2016-10-18  3:49           ` Stephen Webber
  2016-10-19  1:36             ` Christopher Allan Webber
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Webber @ 2016-10-18  3:49 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 18957 bytes --]

Thank you both for the warm welcome and feedback :)

I've attached a patch that builds upon Chris's changes.

Changed:
spelling patch - removed
description - "game" now included in description
patch names - use dashes consistently (thank you Chris)

Unchanged:
whitespace warnings - these are due to an intersection of the git patch
format and the tabular convention within Kobodeluxe's code
user profile - postponed until someone with security expertise can modify

Patches originate from:
https://packages.debian.org/sid/games/kobodeluxe (parent page)
http://http.debian.net/debian/pool/main/k/kobodeluxe/kobodeluxe_0.5.1-8.debian.tar.xz
(direct link)

If any future changes are necessary, please let me know :)

On Mon, Oct 17, 2016 at 11:41 AM, Kei Kebreau <kei@openmailbox.org> wrote:

> Christopher Allan Webber <cwebber@dustycloud.org> writes:
>
> >> On Sun, Oct 16, 2016 at 9:06 PM, Kei Kebreau <kei@openmailbox.org>
> wrote:
> >>> When I applied the patch, git complained about trailing whitespace; a
> >>> trivial fix.
> >
> > Those whitespace "errors" were in the original patches we borrowed from
> > Debian, and weren't on any of the lines that patch in new code.
> > Nonetheless the patches seem to apply fine without them, so here's an
> > adjusted patch that fixes that.  (It also fixes the commit line, since I
> > forgot to change the underscores to hyphens there in my last patch!)
> >
> >  - Chris
> >
> > From 62bf271a6907bd5b0ec73662bc3f92c64aafa229 Mon Sep 17 00:00:00 2001
> > From: Stephen Webber <webber.sl@gmail.com>
> > Date: Sun, 16 Oct 2016 15:04:35 -0500
> > Subject: [PATCH] gnu: Add kobodeluxe.
> >
> > * gnu/packages/games.scm (kobodeluxe): New variable.
> > * gnu/packages/patches/kobodeluxe-paths.patch: New file.
> > * gnu/packages/patches/kobodeluxe-spelling.patch: New file.
> > * gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch: New file.
> > * gnu/packages/patches/kobodeluxe-const-charp-conversion.patch: New
> file.
> > * gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch: New
> file.
> > * gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New
> file.
> > * gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch:
> New file.
> > * gnu/local.mk (dist_patch_DATA): Register it.
> > ---
> >  gnu/local.mk                                       |  7 +++
> >  gnu/packages/games.scm                             | 34 +++++++++++
> >  .../kobodeluxe-const-charp-conversion.patch        | 17 ++++++
> >  .../patches/kobodeluxe-enemies-pipe-decl.patch     | 67
> ++++++++++++++++++++++
> >  .../kobodeluxe-graphics-window-signed-char.patch   | 38 ++++++++++++
> >  .../kobodeluxe-manpage-minus-not-hyphen.patch      | 15 +++++
> >  .../kobodeluxe-midicon-segmentation-fault.patch    | 24 ++++++++
> >  gnu/packages/patches/kobodeluxe-paths.patch        | 40 +++++++++++++
> >  gnu/packages/patches/kobodeluxe-spelling.patch     | 25 ++++++++
> >  9 files changed, 267 insertions(+)
> >  create mode 100644 gnu/packages/patches/kobodeluxe-const-charp-
> conversion.patch
> >  create mode 100644 gnu/packages/patches/kobodeluxe-enemies-pipe-decl.
> patch
> >  create mode 100644 gnu/packages/patches/kobodeluxe-graphics-window-
> signed-char.patch
> >  create mode 100644 gnu/packages/patches/kobodeluxe-manpage-minus-not-
> hyphen.patch
> >  create mode 100644 gnu/packages/patches/kobodeluxe-midicon-
> segmentation-fault.patch
> >  create mode 100644 gnu/packages/patches/kobodeluxe-paths.patch
> >  create mode 100644 gnu/packages/patches/kobodeluxe-spelling.patch
> >
> > diff --git a/gnu/local.mk b/gnu/local.mk
> > index 19dd9ae..a358939 100644
> > --- a/gnu/local.mk
> > +++ b/gnu/local.mk
> > @@ -621,6 +621,13 @@ dist_patch_DATA =
>               \
> >    %D%/packages/patches/jq-CVE-2015-8863.patch                        \
> >    %D%/packages/patches/khmer-use-libraries.patch                \
> >    %D%/packages/patches/kmod-module-directory.patch           \
> > +  %D%/packages/patches/kobodeluxe-paths.patch                        \
> > +  %D%/packages/patches/kobodeluxe-spelling.patch             \
> > +  %D%/packages/patches/kobodeluxe-enemies-pipe-decl.patch    \
> > +  %D%/packages/patches/kobodeluxe-const-charp-conversion.patch       \
> > +  %D%/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch     \
> > +  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch   \
> > +  %D%/packages/patches/kobodeluxe-graphics-window-signed-char.patch  \
> >    %D%/packages/patches/laby-make-install.patch                       \
> >    %D%/packages/patches/ldc-disable-tests.patch                       \
> >    %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
> > diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> > index 2bb53e0..7c43f84 100644
> > --- a/gnu/packages/games.scm
> > +++ b/gnu/packages/games.scm
> > @@ -23,6 +23,7 @@
> >  ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
> >  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
> >  ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
> > +;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
> >  ;;;
> >  ;;; This file is part of GNU Guix.
> >  ;;;
> > @@ -2994,3 +2995,36 @@ symbols, the game needs graphics to render the
> non-euclidean world.")
> >                     license:public-domain ; src/direntx.*
> >                     license:zlib          ; src/savepng.*
> >                     license:gpl2+))))     ; remaining files
> > +
> > +(define-public kobodeluxe
> > +  (package
> > +    (name "kobodeluxe")
> > +    (version "0.5.1")
> > +    (source (origin
> > +              (method url-fetch)
> > +              (uri (string-append "http://olofson.net/kobodl/
> download/KoboDeluxe-"
> > +                                  version ".tar.bz2"))
> > +              (sha256
> > +               (base32
> > +                "0b2wvdpnmaibsy419c16dfwj5kvd3p
> ccby2aaqvm964x74592yqg"))
> > +              (patches (search-patches
> > +                        "kobodeluxe-const-charp-conversion.patch"
> > +                        "kobodeluxe-enemies-pipe-decl.patch"
> > +                        "kobodeluxe-graphics-window-signed-char.patch"
> > +                        "kobodeluxe-manpage-minus-not-hyphen.patch"
> > +                        "kobodeluxe-midicon-segmentation-fault.patch"
> > +                        "kobodeluxe-paths.patch"
> > +                        "kobodeluxe-spelling.patch"))))
> > +    (build-system gnu-build-system)
> > +    (arguments
> > +     '(#:configure-flags
> > +       (list (string-append "CPPFLAGS=-I"
> > +                            (assoc-ref %build-inputs "sdl-union")
> > +                            "/include/SDL"))))
> > +    (inputs `(("sdl-union" ,(sdl-union (list sdl sdl-image)))))
> > +    (synopsis "Shooter with space station destruction")
> > +    (description
> > +     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo for
> Un*x
> > +systems with X11.")
> > +    (home-page "http://olofson.net/kobodl/")
> > +    (license license:gpl2+)))
> > diff --git a/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
> b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
> > new file mode 100644
> > index 0000000..8386cf8
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
> > @@ -0,0 +1,17 @@
> > +Description: Avoid compilation error with gcc-4.4.
> > + "const char* -> char*" conversion is fatal in that version
> > +Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+
> bug/461373
> > +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+
> bug/461373
> > +Bug-Debian: http://bugs.debian.org/552548
> > +Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-
> compile-error-in-windowcpp-with-g44
> > +--- a/graphics/window.cpp
> > ++++ b/graphics/window.cpp
> > +@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x,
> > +              */
> > +             if(token)
> > +             {
> > +-                    char *tok = strchr(txt, token);
> > ++                    const char *tok = strchr(txt, token);
> > +                     if(tok)
> > +                             tokpos = tok-txt;
> > +                     else
> > diff --git a/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
> b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
> > new file mode 100644
> > index 0000000..05cd884
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
> > @@ -0,0 +1,67 @@
> > +# Authhor: Damyan Ivanov <dmn@debian.org>
> > +# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with
> the one
> > +#              declared in system unistd.h
> > +# Debian-Bug: 527705
> > +# Upstream-Report: http://www.freelists.org/post/
> olofsonprojects/kobodeluxe-failing-to-build-in-Debian-
> enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-
> different-kind-of-symbol
> > +--- a/enemies.h
> > ++++ b/enemies.h
> > +@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
> > + extern const enemy_kind cannon;
> > + extern const enemy_kind pipe1;
> > + extern const enemy_kind core;
> > +-extern const enemy_kind pipe2;
> > ++extern const enemy_kind pipe2_kbdl;
> > + extern const enemy_kind rock;
> > + extern const enemy_kind ring;
> > + extern const enemy_kind enemy_m1;
> > +@@ -430,7 +430,7 @@ inline int _enemy::realize()
> > +
> > + inline int _enemy::is_pipe()
> > + {
> > +-    return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
> > ++    return ((_state != notuse) && ((ek == &pipe1) || (ek ==
> &pipe2_kbdl)));
> > + }
> > +
> > +
> > +--- a/enemy.cpp
> > ++++ b/enemy.cpp
> > +@@ -755,10 +755,10 @@ void _enemy::move_core()
> > +
> > + void _enemy::kill_core()
> > + {
> > +-    enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> > +-    enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> > +-    enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> > +-    enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> > ++    enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> > ++    enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> > ++    enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> > ++    enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> > +     enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
> > +     sound.g_base_core_explo(x, y);
> > +     release();
> > +@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
> > +     }
> > +     p ^= a;
> > +     if(p & U_MASK)
> > +-            enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
> > ++            enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0,
> 1);
> > +     if(p & R_MASK)
> > +-            enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
> > ++            enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0,
> 3);
> > +     if(p & D_MASK)
> > +-            enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
> > ++            enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0,
> 5);
> > +     if(p & L_MASK)
> > +-            enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
> > ++            enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0,
> 7);
> > +     manage.add_score(10);
> > +     release();
> > + }
> > +
> > +
> > +-const enemy_kind pipe2 = {
> > ++const enemy_kind pipe2_kbdl = {
> > +     0,
> > +     &_enemy::make_pipe2,
> > +     &_enemy::move_pipe2,
> > diff --git a/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
> b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
> > new file mode 100644
> > index 0000000..d626618
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
> > @@ -0,0 +1,38 @@
> > +# This was created in responce to Debian bug #163979
> > +# Thing is, if you want to compant "-1" with a char value,
> > +# you better make that char signed
> > +--- kobodeluxe-0.5.1.orig/graphics/window.cpp
> > ++++ kobodeluxe-0.5.1/graphics/window.cpp
> > +@@ -331,7 +331,7 @@
> > + }
> > +
> > +
> > +-void window_t::center_token(int _x, int _y, const char *txt, char
> token)
> > ++void window_t::center_token(int _x, int _y, const char *txt, signed
> char token)
> > + {
> > +     center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
> > + }
> > +@@ -374,7 +374,7 @@
> > + }
> > +
> > +
> > +-void window_t::center_token_fxp(int _x, int _y, const char *txt, char
> token)
> > ++void window_t::center_token_fxp(int _x, int _y, const char *txt,
> signed char token)
> > + {
> > +     _x = CS2PIXEL((_x * xs + 128) >> 8);
> > +     _y = CS2PIXEL((_y * ys + 128) >> 8);
> > +--- kobodeluxe-0.5.1.orig/graphics/window.h
> > ++++ kobodeluxe-0.5.1/graphics/window.h
> > +@@ -265,10 +265,10 @@
> > +     void font(int fnt);
> > +     void string(int _x, int _y, const char *txt);
> > +     void center(int _y, const char *txt);
> > +-    void center_token(int _x, int _y, const char *txt, char token = 0);
> > ++    void center_token(int _x, int _y, const char *txt, signed char
> token = 0);
> > +     void string_fxp(int _x, int _y, const char *txt);
> > +     void center_fxp(int _y, const char *txt);
> > +-    void center_token_fxp(int _x, int _y, const char *txt, char token
> = 0);
> > ++    void center_token_fxp(int _x, int _y, const char *txt, signed char
> token = 0);
> > +     int textwidth(const char *txt, int min = 0, int max = 255);
> > +     int textwidth_fxp(const char *txt, int min = 0, int max = 255);
> > +     int fontheight();
> > diff --git a/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
> b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
> > new file mode 100644
> > index 0000000..34cab90
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
> > @@ -0,0 +1,15 @@
> > +# Author: Damyan Ivanov <dmn@debian.org>
> > +# Description: convert a hyphen in kobodl manpage to a minus, which is
> what is
> > +#              inttented here
> > +# Upstream-Report: http://www.freelists.org/post/
> olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
> > +--- a/kobodl.6
> > ++++ b/kobodl.6
> > +@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
> > + Enable Vertical Sync. Default: On.
> > + .TP
> > + .B \-videopages
> > +-Number of Video Pages. Default: -1.
> > ++Number of Video Pages. Default: \-1.
> > + .TP
> > + .B \-scalemode
> > + Scaling Filter Mode. Default: 1.
> > diff --git a/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
> b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
> > new file mode 100644
> > index 0000000..3348348
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
> > @@ -0,0 +1,24 @@
> > +From: Emile CARRY <emile.carry@sequanux.org>
> > +Date: Wed, 6 Apr 2016 00:27:17 +0200
> > +Subject: midicon segmentation fault
> > +
> > +Debian-Bug: https://bugs.debian.org/819897
> > +Forwarded: no
> > +---
> > + sound/a_midicon.c | 2 +-
> > + 1 file changed, 1 insertion(+), 1 deletion(-)
> > +
> > +diff --git a/sound/a_midicon.c b/sound/a_midicon.c
> > +index 57de3cf..ded2988 100644
> > +--- a/sound/a_midicon.c
> > ++++ b/sound/a_midicon.c
> > +@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned
> key)
> > + {
> > +     m[ch].next[key] = -1;
> > +     m[ch].prev[key] = m[ch].last;
> > +-    m[ch].next[m[ch].last] = (char)key;
> > +     m[ch].last = (char)key;
> > ++    m[ch].next[m[ch].last] = (char)key;
> > + }
> > +
> > +
> > diff --git a/gnu/packages/patches/kobodeluxe-paths.patch
> b/gnu/packages/patches/kobodeluxe-paths.patch
> > new file mode 100644
> > index 0000000..87c7b3a
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-paths.patch
> > @@ -0,0 +1,40 @@
> > +# Disable reading of configs, graphics, and data from the current
> directory.
> > +# So it's safe to run kobodeluxe from anywhere w/o worry about an
> attacker
> > +# feeding it bad data.
> > +--- kobodeluxe-0.5.1.orig/kobo.cpp
> > ++++ kobodeluxe-0.5.1/kobo.cpp
> > +@@ -141,21 +141,21 @@
> > +      * Graphics data
> > +      */
> > +     /* Current dir; from within the build tree */
> > +-    fmap->addpath("GFX", "./data/gfx");
> > ++    //fmap->addpath("GFX", "./data/gfx");
> > +     /* Real data dir */
> > +     fmap->addpath("GFX", "DATA>>gfx");
> > +     /* Current dir */
> > +-    fmap->addpath("GFX", "./gfx");
> > ++    //fmap->addpath("GFX", "./gfx");
> > +
> > +     /*
> > +      * Sound data
> > +      */
> > +     /* Current dir; from within the build tree */
> > +-    fmap->addpath("SFX", "./data/sfx");
> > ++    //fmap->addpath("SFX", "./data/sfx");
> > +     /* Real data dir */
> > +     fmap->addpath("SFX", "DATA>>sfx");
> > +     /* Current dir */
> > +-    fmap->addpath("SFX", "./sfx");
> > ++    //fmap->addpath("SFX", "./sfx");
> > +
> > +     /*
> > +      * Score files (user and global)
> > +@@ -173,7 +173,7 @@
> > +     /* System local */
> > +     fmap->addpath("CONFIG", SYSCONF_DIR);
> > +     /* In current dir (last resort) */
> > +-    fmap->addpath("CONFIG", "./");
> > ++    //fmap->addpath("CONFIG", "./");
> > + }
> > +
> > +
> > diff --git a/gnu/packages/patches/kobodeluxe-spelling.patch
> b/gnu/packages/patches/kobodeluxe-spelling.patch
> > new file mode 100644
> > index 0000000..cca1629
> > --- /dev/null
> > +++ b/gnu/packages/patches/kobodeluxe-spelling.patch
> > @@ -0,0 +1,25 @@
> > +Description: two spelling fixes
> > +Author: Damyan Ivanov <dmn@debian.org>
> > +
> > +--- a/graphics/sofont.cpp
> > ++++ b/graphics/sofont.cpp
> > +@@ -255,7 +255,7 @@ bool SoFont::load(SDL_Surface * FontSurf
> > +
> > +     if(!FontSurface)
> > +     {
> > +-            log_printf(ELOG, "SoFont recieved a NULL SDL_Surface\n");
> > ++            log_printf(ELOG, "SoFont received a NULL SDL_Surface\n");
> > +             return false;
> > +     }
> > +     if(picture)
> > +--- a/prefs.cpp
> > ++++ b/prefs.cpp
> > +@@ -161,7 +161,7 @@ void prefs_t::postload()
> > +
> > +     if((o_wait_msec != 30) && !cmd_cheat)
> > +     {
> > +-            log_printf(ELOG, "'wait' is only avaliable in cheat
> mode!\n");
> > ++            log_printf(ELOG, "'wait' is only available in cheat
> mode!\n");
> > +             o_wait_msec = 30;
> > +     }
> > +
>
> Less whitespace errors, but the patches apply to the kobodeluxe source
> code just fine. But other than what Ludovic brought up and my
> nitpicking, the patch looks good. :-)
>

[-- Attachment #1.2: Type: text/html, Size: 25668 bytes --]

[-- Attachment #2: 0001-gnu-Add-kobodeluxe.patch --]
[-- Type: text/x-patch, Size: 13561 bytes --]

From 0af8f8fc9f0976904ec019a9fb9446a3699f1f37 Mon Sep 17 00:00:00 2001
From: Stephen Webber <webber.sl@gmail.com>
Date: Sun, 16 Oct 2016 15:04:35 -0500
Subject: [PATCH] gnu: Add kobodeluxe.

* gnu/packages/games.scm (kobodeluxe): New variable.
* gnu/packages/patches/kobodeluxe-paths.patch: New file.
* gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch: New file.
* gnu/packages/patches/kobodeluxe-const-charp-conversion.patch: New file.
* gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch: New file.
* gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New file.
* gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  7 +++
 gnu/packages/games.scm                             | 33 +++++++++++
 .../kobodeluxe-const-charp-conversion.patch        | 17 ++++++
 .../patches/kobodeluxe-enemies-pipe-decl.patch     | 67 ++++++++++++++++++++++
 .../kobodeluxe-graphics-window-signed-char.patch   | 38 ++++++++++++
 .../kobodeluxe-manpage-minus-not-hyphen.patch      | 15 +++++
 .../kobodeluxe-midicon-segmentation-fault.patch    | 24 ++++++++
 gnu/packages/patches/kobodeluxe-paths.patch        | 40 +++++++++++++
 8 files changed, 241 insertions(+)
 create mode 100644 gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
 create mode 100644 gnu/packages/patches/kobodeluxe-paths.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5226b49..9bf63b3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -609,6 +609,13 @@ dist_patch_DATA =						\
   %D%/packages/patches/jq-CVE-2015-8863.patch			\
   %D%/packages/patches/khmer-use-libraries.patch                \
   %D%/packages/patches/kmod-module-directory.patch		\
+  %D%/packages/patches/kobodeluxe-paths.patch			\
+  %D%/packages/patches/kobodeluxe-spelling.patch		\
+  %D%/packages/patches/kobodeluxe-enemies-pipe-decl.patch	\
+  %D%/packages/patches/kobodeluxe-const-charp-conversion.patch	\
+  %D%/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch	\
+  %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch	\
+  %D%/packages/patches/kobodeluxe-graphics-window-signed-char.patch	\
   %D%/packages/patches/laby-make-install.patch			\
   %D%/packages/patches/ldc-disable-tests.patch			\
   %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 17ca12b..a2c8ac0 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2966,3 +2967,35 @@ symbols, the game needs graphics to render the non-euclidean world.")
                    license:public-domain ; src/direntx.*
                    license:zlib          ; src/savepng.*
                    license:gpl2+))))     ; remaining files
+
+(define-public kobodeluxe
+  (package
+    (name "kobodeluxe")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://olofson.net/kobodl/download/KoboDeluxe-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "0b2wvdpnmaibsy419c16dfwj5kvd3pccby2aaqvm964x74592yqg"))
+              (patches (search-patches
+                        "kobodeluxe-const-charp-conversion.patch"
+                        "kobodeluxe-enemies-pipe-decl.patch"
+                        "kobodeluxe-graphics-window-signed-char.patch"
+                        "kobodeluxe-manpage-minus-not-hyphen.patch"
+                        "kobodeluxe-midicon-segmentation-fault.patch"
+                        "kobodeluxe-paths.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "CPPFLAGS=-I"
+                            (assoc-ref %build-inputs "sdl-union")
+                            "/include/SDL"))))
+    (inputs `(("sdl-union" ,(sdl-union (list sdl sdl-image)))))
+    (synopsis "Shooter with space station destruction")
+    (description
+     "Kobo Deluxe is an enhanced version of Akira Higuchi's XKobo graphical game
+for Un*x systems with X11.")
+    (home-page "http://olofson.net/kobodl/")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
new file mode 100644
index 0000000..8386cf8
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-const-charp-conversion.patch
@@ -0,0 +1,17 @@
+Description: Avoid compilation error with gcc-4.4.
+ "const char* -> char*" conversion is fatal in that version
+Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
+Bug-Debian: http://bugs.debian.org/552548
+Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
+--- a/graphics/window.cpp
++++ b/graphics/window.cpp
+@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x,
+ 		 */
+ 		if(token)
+ 		{
+-			char *tok = strchr(txt, token);
++			const char *tok = strchr(txt, token);
+ 			if(tok)
+ 				tokpos = tok-txt;
+ 			else
diff --git a/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
new file mode 100644
index 0000000..05cd884
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch
@@ -0,0 +1,67 @@
+# Authhor: Damyan Ivanov <dmn@debian.org>
+# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
+#              declared in system unistd.h
+# Debian-Bug: 527705
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
+--- a/enemies.h
++++ b/enemies.h
+@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
+ extern const enemy_kind cannon;
+ extern const enemy_kind pipe1;
+ extern const enemy_kind core;
+-extern const enemy_kind pipe2;
++extern const enemy_kind pipe2_kbdl;
+ extern const enemy_kind rock;
+ extern const enemy_kind ring;
+ extern const enemy_kind enemy_m1;
+@@ -430,7 +430,7 @@ inline int _enemy::realize()
+
+ inline int _enemy::is_pipe()
+ {
+-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
++	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
+ }
+
+
+--- a/enemy.cpp
++++ b/enemy.cpp
+@@ -755,10 +755,10 @@ void _enemy::move_core()
+
+ void _enemy::kill_core()
+ {
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
+ 	sound.g_base_core_explo(x, y);
+ 	release();
+@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
+ 	}
+ 	p ^= a;
+ 	if(p & U_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+ 	if(p & R_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+ 	if(p & D_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+ 	if(p & L_MASK)
+-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
++		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+ 	manage.add_score(10);
+ 	release();
+ }
+
+
+-const enemy_kind pipe2 = {
++const enemy_kind pipe2_kbdl = {
+ 	0,
+ 	&_enemy::make_pipe2,
+ 	&_enemy::move_pipe2,
diff --git a/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
new file mode 100644
index 0000000..d626618
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-graphics-window-signed-char.patch
@@ -0,0 +1,38 @@
+# This was created in responce to Debian bug #163979
+# Thing is, if you want to compant "-1" with a char value,
+# you better make that char signed
+--- kobodeluxe-0.5.1.orig/graphics/window.cpp
++++ kobodeluxe-0.5.1/graphics/window.cpp
+@@ -331,7 +331,7 @@
+ }
+
+
+-void window_t::center_token(int _x, int _y, const char *txt, char token)
++void window_t::center_token(int _x, int _y, const char *txt, signed char token)
+ {
+ 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
+ }
+@@ -374,7 +374,7 @@
+ }
+
+
+-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
++void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
+ {
+ 	_x = CS2PIXEL((_x * xs + 128) >> 8);
+ 	_y = CS2PIXEL((_y * ys + 128) >> 8);
+--- kobodeluxe-0.5.1.orig/graphics/window.h
++++ kobodeluxe-0.5.1/graphics/window.h
+@@ -265,10 +265,10 @@
+ 	void font(int fnt);
+ 	void string(int _x, int _y, const char *txt);
+ 	void center(int _y, const char *txt);
+-	void center_token(int _x, int _y, const char *txt, char token = 0);
++	void center_token(int _x, int _y, const char *txt, signed char token = 0);
+ 	void string_fxp(int _x, int _y, const char *txt);
+ 	void center_fxp(int _y, const char *txt);
+-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
++	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
+ 	int textwidth(const char *txt, int min = 0, int max = 255);
+ 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
+ 	int fontheight();
diff --git a/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
new file mode 100644
index 0000000..34cab90
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.patch
@@ -0,0 +1,15 @@
+# Author: Damyan Ivanov <dmn@debian.org>
+# Description: convert a hyphen in kobodl manpage to a minus, which is what is
+#              inttented here
+# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
+--- a/kobodl.6
++++ b/kobodl.6
+@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
+ Enable Vertical Sync. Default: On.
+ .TP
+ .B \-videopages
+-Number of Video Pages. Default: -1.
++Number of Video Pages. Default: \-1.
+ .TP
+ .B \-scalemode
+ Scaling Filter Mode. Default: 1.
diff --git a/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
new file mode 100644
index 0000000..3348348
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch
@@ -0,0 +1,24 @@
+From: Emile CARRY <emile.carry@sequanux.org>
+Date: Wed, 6 Apr 2016 00:27:17 +0200
+Subject: midicon segmentation fault
+
+Debian-Bug: https://bugs.debian.org/819897
+Forwarded: no
+---
+ sound/a_midicon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/a_midicon.c b/sound/a_midicon.c
+index 57de3cf..ded2988 100644
+--- a/sound/a_midicon.c
++++ b/sound/a_midicon.c
+@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
+ {
+ 	m[ch].next[key] = -1;
+ 	m[ch].prev[key] = m[ch].last;
+-	m[ch].next[m[ch].last] = (char)key;
+ 	m[ch].last = (char)key;
++	m[ch].next[m[ch].last] = (char)key;
+ }
+
+
diff --git a/gnu/packages/patches/kobodeluxe-paths.patch b/gnu/packages/patches/kobodeluxe-paths.patch
new file mode 100644
index 0000000..87c7b3a
--- /dev/null
+++ b/gnu/packages/patches/kobodeluxe-paths.patch
@@ -0,0 +1,40 @@
+# Disable reading of configs, graphics, and data from the current directory.
+# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
+# feeding it bad data.
+--- kobodeluxe-0.5.1.orig/kobo.cpp
++++ kobodeluxe-0.5.1/kobo.cpp
+@@ -141,21 +141,21 @@
+ 	 * Graphics data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("GFX", "./data/gfx");
++	//fmap->addpath("GFX", "./data/gfx");
+ 	/* Real data dir */
+ 	fmap->addpath("GFX", "DATA>>gfx");
+ 	/* Current dir */
+-	fmap->addpath("GFX", "./gfx");
++	//fmap->addpath("GFX", "./gfx");
+
+ 	/*
+ 	 * Sound data
+ 	 */
+ 	/* Current dir; from within the build tree */
+-	fmap->addpath("SFX", "./data/sfx");
++	//fmap->addpath("SFX", "./data/sfx");
+ 	/* Real data dir */
+ 	fmap->addpath("SFX", "DATA>>sfx");
+ 	/* Current dir */
+-	fmap->addpath("SFX", "./sfx");
++	//fmap->addpath("SFX", "./sfx");
+
+ 	/*
+ 	 * Score files (user and global)
+@@ -173,7 +173,7 @@
+ 	/* System local */
+ 	fmap->addpath("CONFIG", SYSCONF_DIR);
+ 	/* In current dir (last resort) */
+-	fmap->addpath("CONFIG", "./");
++	//fmap->addpath("CONFIG", "./");
+ }
+
+
-- 
2.1.4


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

* Re: [PATCH] add kobodeluxe
  2016-10-18  3:49           ` Stephen Webber
@ 2016-10-19  1:36             ` Christopher Allan Webber
  0 siblings, 0 replies; 10+ messages in thread
From: Christopher Allan Webber @ 2016-10-19  1:36 UTC (permalink / raw)
  To: Stephen Webber; +Cc: guix-devel

Stephen Webber writes:

> Thank you both for the warm welcome and feedback :)
>
> I've attached a patch that builds upon Chris's changes.
>
> Changed:
> spelling patch - removed
> description - "game" now included in description
> patch names - use dashes consistently (thank you Chris)
>
> Unchanged:
> whitespace warnings - these are due to an intersection of the git patch
> format and the tabular convention within Kobodeluxe's code
> user profile - postponed until someone with security expertise can modify
>
> Patches originate from:
> https://packages.debian.org/sid/games/kobodeluxe (parent page)
> http://http.debian.net/debian/pool/main/k/kobodeluxe/kobodeluxe_0.5.1-8.debian.tar.xz
> (direct link)
>
> If any future changes are necessary, please let me know :)

Great!  I pushed it, and indicated that origin in the one .patch file
that didn't mention anything about its provenance in a separate commit.

Thanks for your contribution, Stephen!

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

end of thread, other threads:[~2016-10-19  1:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-16 20:47 [PATCH] add kobodeluxe Stephen Webber
2016-10-16 23:22 ` Christopher Allan Webber
2016-10-17  1:58   ` Christopher Allan Webber
2016-10-17 14:50     ` Ludovic Courtès
2016-10-17  2:06   ` Kei Kebreau
2016-10-17  2:19     ` Stephen Webber
2016-10-17 14:14       ` Christopher Allan Webber
2016-10-17 16:41         ` Kei Kebreau
2016-10-18  3:49           ` Stephen Webber
2016-10-19  1:36             ` Christopher Allan Webber

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).