From 0b85d04d9ea5b1cded6ba775b989a993f58d989b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Pag=C3=A8s?= <page@cubata.homelinux.net> Date: Thu, 12 Jul 2012 23:42:20 +0200 Subject: [PATCH] kobodeluxe: fix compilation errors. The glibc29 patch was taken from Gentoo. --- pkgs/games/kobodeluxe/default.nix | 6 +++ pkgs/games/kobodeluxe/glibc29.patch | 83 +++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 pkgs/games/kobodeluxe/glibc29.patch diff --git a/pkgs/games/kobodeluxe/default.nix b/pkgs/games/kobodeluxe/default.nix index 1d700d5cf038..70288e549a4e 100644 --- a/pkgs/games/kobodeluxe/default.nix +++ b/pkgs/games/kobodeluxe/default.nix @@ -9,6 +9,12 @@ stdenv.mkDerivation { buildInputs = [ SDL SDL_image]; + prePatch = '' + sed -e 's/char \*tok/const char \*tok/' -i graphics/window.cpp + ''; + + patches = [ ./glibc29.patch ]; + meta = { homepage = http://olofson.net/kobodl/; description = "Enhanced version of Akira Higuchi's game XKobo for Un*x systems with X11"; diff --git a/pkgs/games/kobodeluxe/glibc29.patch b/pkgs/games/kobodeluxe/glibc29.patch new file mode 100644 index 000000000000..7a9ef355a821 --- /dev/null +++ b/pkgs/games/kobodeluxe/glibc29.patch @@ -0,0 +1,83 @@ +--- a/enemies.h ++++ b/enemies.h +@@ -70,9 +70,9 @@ + extern const enemy_kind bomb2; + extern const enemy_kind bombdeto; + extern const enemy_kind cannon; +-extern const enemy_kind pipe1; ++extern const enemy_kind pipeone; + extern const enemy_kind core; +-extern const enemy_kind pipe2; ++extern const enemy_kind pipetwo; + extern const enemy_kind rock; + extern const enemy_kind ring; + extern const enemy_kind enemy_m1; +@@ -430,7 +430,7 @@ + + inline int _enemy::is_pipe() + { +- return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2))); ++ return ((_state != notuse) && ((ek == &pipeone) || (ek == &pipetwo))); + } + + +--- a/enemy.cpp ++++ b/enemy.cpp +@@ -713,7 +713,7 @@ + + void _enemy::kill_cannon() + { +- enemies.make(&pipe1, CS2PIXEL(x), CS2PIXEL(y)); ++ enemies.make(&pipeone, CS2PIXEL(x), CS2PIXEL(y)); + sound.g_base_node_explo(x, y); + release(); + } +@@ -755,10 +755,10 @@ + + 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(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5); + enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y)); + sound.g_base_core_explo(x, y); + release(); +@@ -851,7 +851,7 @@ + screen.set_map(x1, y1, m ^ a); + release(); + } +-const enemy_kind pipe1 = { ++const enemy_kind pipeone = { + 0, + &_enemy::make_pipe1, + &_enemy::move_pipe1, +@@ -978,19 +978,19 @@ + } + p ^= a; + if(p & U_MASK) +- enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1); + if(p & R_MASK) +- enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3); + if(p & D_MASK) +- enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5); + if(p & L_MASK) +- enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7); ++ enemies.make(&pipetwo, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7); + manage.add_score(10); + release(); + } + + +-const enemy_kind pipe2 = { ++const enemy_kind pipetwo = { + 0, + &_enemy::make_pipe2, + &_enemy::move_pipe2,