about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-05-27 21:47:14 +0300
committerAzat Bahawi <azat@bahawi.net>2022-05-28 14:34:05 +0300
commitf35a5e2479d9c57132a8ba73e8cd5816f2af0865 (patch)
treed5f10e91f3ac013fea3ebf3a802cb895b742a4b9
parentf0f03b52fd8c570148dbb83bd99359d43567a071 (diff)
mars: fix build
Bumps the revision and fixes https://hydra.nixos.org/build/178082390
Mark the version as "unstable" because the latest official version does
not build and there are no new releases.
-rw-r--r--pkgs/games/mars/default.nix13
-rw-r--r--pkgs/games/mars/fix-gluortho2d.patch113
-rw-r--r--pkgs/games/mars/unbind_fix.patch19
3 files changed, 4 insertions, 141 deletions
diff --git a/pkgs/games/mars/default.nix b/pkgs/games/mars/default.nix
index 0fa744677d83b..9b715b02ae09d 100644
--- a/pkgs/games/mars/default.nix
+++ b/pkgs/games/mars/default.nix
@@ -1,27 +1,22 @@
 { lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, sfml, fribidi, taglib }:
 stdenv.mkDerivation rec {
   pname = "mars";
-  version = "0.7.5";
+  version = "unstable-17.10.2021";
 
   src = fetchFromGitHub {
     owner = "thelaui";
     repo = "M.A.R.S.";
-    rev = "c855d044094a1d92317e38935d81ba938946132e";
-    sha256 = "1r4c5gap1z2zsv4yjd34qriqkxaq4lb4rykapyzkkdf4g36lc3nh";
+    rev = "84664cda094efe6e49d9b1550e4f4f98c33eefa2";
+    sha256 = "sha256-SWLP926SyVTjn+UT1DCaJSo4Ue0RbyzImVnlNJQksS0=";
   };
   nativeBuildInputs = [ cmake ];
   buildInputs = [ libGLU libGL sfml fribidi taglib ];
-  patches = [
-    ./unbind_fix.patch
-    ./fix-gluortho2d.patch
-  ];
   installPhase = ''
     cd ..
-    find -name '*.svn' -exec rm -rf {} \;
     mkdir -p "$out/share/mars/"
     mkdir -p "$out/bin/"
     cp -rv data resources credits.txt license.txt "$out/share/mars/"
-    cp -v mars "$out/bin/mars.bin"
+    cp -v marsshooter "$out/bin/mars.bin"
     cat << EOF > "$out/bin/mars"
     #! ${stdenv.shell}
     cd "$out/share/mars/"
diff --git a/pkgs/games/mars/fix-gluortho2d.patch b/pkgs/games/mars/fix-gluortho2d.patch
deleted file mode 100644
index 15a5c07060e2b..0000000000000
--- a/pkgs/games/mars/fix-gluortho2d.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 33d5affabf8ff84f2c028b9303c6a9e83cc824ad Mon Sep 17 00:00:00 2001
-From: James Cowgill <james410@cowgill.org.uk>
-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/pkgs/games/mars/unbind_fix.patch b/pkgs/games/mars/unbind_fix.patch
deleted file mode 100644
index 2aef6eb5cf662..0000000000000
--- a/pkgs/games/mars/unbind_fix.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/src/System/window.cpp b/src/System/window.cpp
-index e9a099a..e3f6de9 100644
---- a/src/System/window.cpp
-+++ b/src/System/window.cpp
-@@ -308,12 +308,12 @@ namespace window {
-         glEnable(GL_TEXTURE_2D);
- 
-         if (shader)
--            shader->bind();
-+            sf::Shader::bind(shader);
- 
-         window_.draw(toBeDrawn, states);
- 
-         if (shader)
--            shader->unbind();
-+            sf::Shader::bind(NULL);
- 
-         window_.popGLStates();
-         glPopMatrix();