From d328c13a7f3b9365029dc7e2cfee118299d1556a Mon Sep 17 00:00:00 2001 From: David Spencer Date: Wed, 20 Jan 2016 00:30:10 +0000 Subject: games/mars: Patched to build with SFML-2.3. Signed-off-by: David Spencer --- games/mars/mars.SlackBuild | 7 ++- games/mars/mars.patch | 26 ----------- games/mars/pull17.patch | 113 +++++++++++++++++++++++++++++++++++++++++++++ games/mars/pull2.patch | 26 +++++++++++ 4 files changed, 145 insertions(+), 27 deletions(-) delete mode 100644 games/mars/mars.patch create mode 100644 games/mars/pull17.patch create mode 100644 games/mars/pull2.patch (limited to 'games') diff --git a/games/mars/mars.SlackBuild b/games/mars/mars.SlackBuild index 43ca1cf4e0..52a64dbb4f 100644 --- a/games/mars/mars.SlackBuild +++ b/games/mars/mars.SlackBuild @@ -71,7 +71,12 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -patch -p1 < $CWD/mars.patch +# Fix build with SFML-2.1 +# https://github.com/thelaui/M.A.R.S./pull/2 +patch -p1 < $CWD/pull2.patch +# Fix build with SFML-2.3 +# https://github.com/thelaui/M.A.R.S./pull/17 +patch -p1 < $CWD/pull17.patch mkdir -p build cd build diff --git a/games/mars/mars.patch b/games/mars/mars.patch deleted file mode 100644 index 6d0eb147b0..0000000000 --- a/games/mars/mars.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- mars-game/src/CMakeLists.original.txt 2014-05-08 12:30:55.314629800 +0300 -+++ mars-game/src/CMakeLists.txt 2014-05-08 12:38:59.999570405 +0300 -@@ -68,7 +68,7 @@ - TARGETS - mars - RUNTIME DESTINATION -- ${CMAKE_INSTALL_PREFIX}/games -+ ${CMAKE_INSTALL_PREFIX}/bin - ) - install( - FILES ---- mars-game/src/System/window.original.cpp 2014-05-08 12:18:31.053934339 +0300 -+++ mars-game/src/System/window.cpp 2014-05-08 12:19:45.633001973 +0300 -@@ -308,12 +308,12 @@ - glEnable(GL_TEXTURE_2D); - - if (shader) -- shader->bind(); -+ shader->bind(NULL); - - window_.draw(toBeDrawn, states); - - if (shader) -- shader->unbind(); -+ shader->bind(NULL); - diff --git a/games/mars/pull17.patch b/games/mars/pull17.patch new file mode 100644 index 0000000000..15a5c07060 --- /dev/null +++ b/games/mars/pull17.patch @@ -0,0 +1,113 @@ +From 33d5affabf8ff84f2c028b9303c6a9e83cc824ad Mon Sep 17 00:00:00 2001 +From: James Cowgill +Date: Sat, 9 May 2015 01:54:14 +0100 +Subject: [PATCH] Remove dependency on GLU - fixes build with SFML 2.3 + +--- + premake4.lua | 8 ++++---- + src/Shaders/postFX.cpp | 2 +- + src/System/window.cpp | 12 ++++++------ + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/premake4.lua b/premake4.lua +index 023dddd..5af4495 100755 +--- a/premake4.lua ++++ b/premake4.lua +@@ -11,11 +11,11 @@ project "mars" + defines { "NDEBUG" } + flags { "Optimize" } + if os.get() == "windows" then +- links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" } ++ links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" } + elseif os.get() == "macosx" then + links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" } + else +- links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" } ++ links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" } + libdirs { "/usr/lib", "/usr/local/lib" } + end + +@@ -23,10 +23,10 @@ project "mars" + defines { "_DEBUG", "DEBUG" } + flags { "Symbols" } + if os.get() == "windows" then +- links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" } ++ links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" } + elseif os.get() == "macosx" then + links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" } + else +- links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" } ++ links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" } + libdirs { "/usr/lib", "/usr/local/lib" } + end +diff --git a/src/Shaders/postFX.cpp b/src/Shaders/postFX.cpp +index 987f411..f767a47 100644 +--- a/src/Shaders/postFX.cpp ++++ b/src/Shaders/postFX.cpp +@@ -78,7 +78,7 @@ namespace postFX { + postFX_.loadFromFile(settings::C_dataPath + "shaders/bump.frag", sf::Shader::Fragment); + bumpMap_.create(SPACE_X_RESOLUTION*0.5f, SPACE_Y_RESOLUTION*0.5f); + glViewport(0,0,SPACE_X_RESOLUTION*0.5f,SPACE_Y_RESOLUTION*0.5f); +- gluOrtho2D(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0); ++ glOrtho(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0, -1, 1); + glEnable(GL_BLEND); + glMatrixMode(GL_MODELVIEW); + postFX_.setParameter("BumpMap", bumpMap_.getTexture()); +diff --git a/src/System/window.cpp b/src/System/window.cpp +index e9a099a..8e12dcc 100644 +--- a/src/System/window.cpp ++++ b/src/System/window.cpp +@@ -222,7 +222,7 @@ namespace window { + glLoadIdentity(); + + // Setup translation (according to left-upper corner) +- gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f); ++ glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1); + + // probably improves performance... + glDisable(GL_LIGHTING); +@@ -247,7 +247,7 @@ namespace window { + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); +- gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f); ++ glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + +@@ -255,7 +255,7 @@ namespace window { + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); +- gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f); ++ glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + } +@@ -270,7 +270,7 @@ namespace window { + glLoadIdentity(); + setViewPort(); + +- gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f); ++ glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +@@ -284,7 +284,7 @@ namespace window { + glLoadIdentity(); + setViewPort(); + +- gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f); ++ glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +@@ -294,7 +294,7 @@ namespace window { + else { + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); +- gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f); ++ glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + } diff --git a/games/mars/pull2.patch b/games/mars/pull2.patch new file mode 100644 index 0000000000..6d0eb147b0 --- /dev/null +++ b/games/mars/pull2.patch @@ -0,0 +1,26 @@ +--- mars-game/src/CMakeLists.original.txt 2014-05-08 12:30:55.314629800 +0300 ++++ mars-game/src/CMakeLists.txt 2014-05-08 12:38:59.999570405 +0300 +@@ -68,7 +68,7 @@ + TARGETS + mars + RUNTIME DESTINATION +- ${CMAKE_INSTALL_PREFIX}/games ++ ${CMAKE_INSTALL_PREFIX}/bin + ) + install( + FILES +--- mars-game/src/System/window.original.cpp 2014-05-08 12:18:31.053934339 +0300 ++++ mars-game/src/System/window.cpp 2014-05-08 12:19:45.633001973 +0300 +@@ -308,12 +308,12 @@ + glEnable(GL_TEXTURE_2D); + + if (shader) +- shader->bind(); ++ shader->bind(NULL); + + window_.draw(toBeDrawn, states); + + if (shader) +- shader->unbind(); ++ shader->bind(NULL); + -- cgit v1.2.3