From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: Re: [PATCH] add kobodeluxe Date: Mon, 17 Oct 2016 12:41:55 -0400 Message-ID: <87funvlygc.fsf@openmailbox.org> References: <87k2d7anh9.fsf@dustycloud.org> <87wph7afv5.fsf@openmailbox.org> <87funv9i5n.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwAzO-0001QZ-QY for guix-devel@gnu.org; Mon, 17 Oct 2016 12:42:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwAzL-0007N6-1e for guix-devel@gnu.org; Mon, 17 Oct 2016 12:42:14 -0400 Received: from smtp7.openmailbox.org ([62.4.1.41]:37416) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwAzK-0007Ks-MW for guix-devel@gnu.org; Mon, 17 Oct 2016 12:42:10 -0400 In-Reply-To: <87funv9i5n.fsf@dustycloud.org> (Christopher Allan Webber's message of "Mon, 17 Oct 2016 09:14:44 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Christopher Allan Webber Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Christopher Allan Webber writes: >> On Sun, Oct 16, 2016 at 9:06 PM, Kei Kebreau 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 > 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 fil= e. > * gnu/packages/patches/kobodeluxe-midicon-segmentation-fault.patch: New f= ile. > * 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-conversio= n.patch > create mode 100644 gnu/packages/patches/kobodeluxe-enemies-pipe-decl.pat= ch > create mode 100644 gnu/packages/patches/kobodeluxe-graphics-window-signe= d-char.patch > create mode 100644 gnu/packages/patches/kobodeluxe-manpage-minus-not-hyp= hen.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 =3D \ > %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 =C2=A9 2016 Alex Griffin > ;;; Copyright =C2=A9 2016 Efraim Flashner > ;;; Copyright =C2=A9 2016 Jan Nieuwenhuizen > +;;; Copyright =C2=A9 2016 Steve Webber > ;;; > ;;; 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/Ko= boDeluxe-" > + 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=3D-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/+bu= g/461373 > +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/46= 1373 > +Bug-Debian: http://bugs.debian.org/552548 > +Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-com= pile-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 =3D strchr(txt, token); > ++ const char *tok =3D strchr(txt, token); > + if(tok) > + tokpos =3D tok-txt; > + else > diff --git a/gnu/packages/patches/kobodeluxe-enemies-pipe-decl.patch b/gn= u/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 > +# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with t= he one > +# declared in system unistd.h > +# Debian-Bug: 527705 > +# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodel= uxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-rede= clared-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 !=3D notuse) && ((ek =3D=3D &pipe1) || (ek =3D=3D &pip= e2))); > ++ return ((_state !=3D notuse) && ((ek =3D=3D &pipe1) || (ek =3D=3D &pip= e2_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 ^=3D 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 =3D { > ++const enemy_kind pipe2_kbdl =3D { > + 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 cha= r 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 t= oken) > ++void window_t::center_token_fxp(int _x, int _y, const char *txt, signed= char token) > + { > + _x =3D CS2PIXEL((_x * xs + 128) >> 8); > + _y =3D 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 =3D 0); > ++ void center_token(int _x, int _y, const char *txt, signed char token = =3D 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 =3D = 0); > ++ void center_token_fxp(int _x, int _y, const char *txt, signed char tok= en =3D 0); > + int textwidth(const char *txt, int min =3D 0, int max =3D 255); > + int textwidth_fxp(const char *txt, int min =3D 0, int max =3D 255); > + int fontheight(); > diff --git a/gnu/packages/patches/kobodeluxe-manpage-minus-not-hyphen.pat= ch 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 > +# Description: convert a hyphen in kobodl manpage to a minus, which is w= hat is > +# inttented here > +# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-m= anpage-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.p= atch 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 > +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] =3D -1; > + m[ch].prev[key] =3D m[ch].last; > +- m[ch].next[m[ch].last] =3D (char)key; > + m[ch].last =3D (char)key; > ++ m[ch].next[m[ch].last] =3D (char)key; > + } > + > + > diff --git a/gnu/packages/patches/kobodeluxe-paths.patch b/gnu/packages/p= atches/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 direct= ory. > +# So it's safe to run kobodeluxe from anywhere w/o worry about an attack= er > +# 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/package= s/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 > + > +--- 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 !=3D 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 =3D 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. :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYBP9TAAoJEOal7jwZRnoNpCQP/2ER72ndriQfDnbp3qDpIiFQ j+6FBWo8p9c2RbVYxRNfyw94mIsNX6ud4sqWt/neB7toHuubWsylw2Cjel4bIUHA Nw5X+OpwveO6qHOhXphsleIo5kWWgurQW3nA1Ss/4rJyWXR4zoiEHeNBEh+Xe2X0 bBQ4IojKA3GbdF6iD6MnhYK80BlbnjLcAnphZSDQSKvCxWIybh35fA+1c8qiPmUx fgD0TFzAjY5mH5SZ1mX1hY6PjJUUhqZribnSL3qN2fwnwsqVOnA79gPPPknoNo+F 7PP5LnTGb5tYPJ29H9aXVBd9aoq6F3EguXf572BVmaWYdQcoKddeE0wYEyXoxooL b5QEi+nHE0hWVyIEsV6qiGi42P4kFpX0GidRmW0etEFkHlB2X7l6ECPaBizyBWDW jYH3G6Va9jDlw+MI9xNLwjnx9Xr39vxZM2PiSrQ5iejRa8i4stZ3Zm4RINsanMwo SaV569JblAyn3uHo8GVgnQ+bZSEvEEc2jNj1iQMiQQ5VVVeXUCzst/lqYZrL+RBi x916ov8d0sLp+NWFaeGjwaXozfvp3ckjRhmxsr/W5hQIxTUnzIxNWRNJsbo1w0GM hzqO8g3aubWljB30mR6WSuAdhjZQ5kfDnJ7lC5BB2rWSfPais9/0fwmM9mclnM8M FtcLxWQuFeBQ6tJ4GzyH =14J0 -----END PGP SIGNATURE----- --=-=-=--