diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/games/mars | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/games/mars')
-rw-r--r-- | nixpkgs/pkgs/games/mars/default.nix | 37 | ||||
-rw-r--r-- | nixpkgs/pkgs/games/mars/fix-gluortho2d.patch | 113 | ||||
-rw-r--r-- | nixpkgs/pkgs/games/mars/unbind_fix.patch | 19 |
3 files changed, 169 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/games/mars/default.nix b/nixpkgs/pkgs/games/mars/default.nix new file mode 100644 index 000000000000..2d2a31dd812c --- /dev/null +++ b/nixpkgs/pkgs/games/mars/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchgit, cmake, libGLU_combined, sfml, fribidi, taglib }: +stdenv.mkDerivation rec { + name = "mars-${version}-${rev}"; + version = "0.7.5"; + rev = "c855d04409"; + src = fetchgit { + url = "https://github.com/thelaui/M.A.R.S..git"; + inherit rev; + sha256 = "1r4c5gap1z2zsv4yjd34qriqkxaq4lb4rykapyzkkdf4g36lc3nh"; + }; + buildInputs = [ cmake libGLU_combined 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" + cat << EOF > "$out/bin/mars" + #! /bin/sh + cd "$out/share/mars/" + exec "$out/bin/mars.bin" "\$@" + EOF + chmod +x "$out/bin/mars" + ''; + meta = with stdenv.lib; { + homepage = http://mars-game.sourceforge.net/; + description = "A game about fighting with ships in a 2D space setting"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.astsmtl ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/games/mars/fix-gluortho2d.patch b/nixpkgs/pkgs/games/mars/fix-gluortho2d.patch new file mode 100644 index 000000000000..15a5c07060e2 --- /dev/null +++ b/nixpkgs/pkgs/games/mars/fix-gluortho2d.patch @@ -0,0 +1,113 @@ +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/nixpkgs/pkgs/games/mars/unbind_fix.patch b/nixpkgs/pkgs/games/mars/unbind_fix.patch new file mode 100644 index 000000000000..2aef6eb5cf66 --- /dev/null +++ b/nixpkgs/pkgs/games/mars/unbind_fix.patch @@ -0,0 +1,19 @@ +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(); |