about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-07-18 14:40:13 +0100
committerGitHub <noreply@github.com>2016-07-18 14:40:13 +0100
commit4cf02e648d91856fe602a249eaaaaec09aec3a30 (patch)
tree185567e9edb22ad714b0200fc6bfbe00cf8ef4f2 /pkgs/games
parent4063834f92c6fa1ce6063c789ed33ba3a3d7b839 (diff)
parent88154e2877c1f85029894507deb20e51d07069b1 (diff)
downloadnixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.tar
nixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.tar.gz
nixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.tar.bz2
nixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.tar.lz
nixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.tar.xz
nixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.tar.zst
nixlib-4cf02e648d91856fe602a249eaaaaec09aec3a30.zip
Merge pull request #16948 from hce/add-commander-genius
commandergenius: init at 194beta
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/commandergenius/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/games/commandergenius/default.nix b/pkgs/games/commandergenius/default.nix
new file mode 100644
index 000000000000..007167dc696c
--- /dev/null
+++ b/pkgs/games/commandergenius/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, SDL2, SDL2_image, pkgconfig
+, libvorbis, libogg, mesa, boost, curl, zlib, cmake }:
+
+
+stdenv.mkDerivation rec {
+  name = "commandergenius-${version}";
+  version = "194beta";
+
+  src = fetchFromGitHub {
+    owner = "gerstrong";
+    repo = "Commander-Genius";
+    rev = "v${version}";
+    sha256 = "0qxqzlmadxklrhxilbqj7y94fmbv0byj6vgpl59lb77lgs4y4x47";
+  };
+
+  buildInputs = [ SDL2 SDL2_image pkgconfig libvorbis libogg mesa boost curl zlib cmake ];
+
+  patchPhase = ''
+    cat >> lib/GsKit/CMakeLists.txt <<EOF
+    execute_process(COMMAND sdl2-config --cflags
+      OUTPUT_VARIABLE CFLAGS)
+    string(REGEX REPLACE "^-I" "" CFLAGS2 \''${CFLAGS})
+    string(REGEX REPLACE " .*" "" SDLINC \''${CFLAGS2})
+    INCLUDE_DIRECTORIES(\''${SDLINC})
+    EOF
+  '';
+
+  configurePhase = ''
+    cmake -DUSE_SDL2=yes -DBUILD_TARGET=LINUX -DCMAKE_INSTALL_PREFIX:PATH=$out -DCPACK_PACKAGE_INSTALL_DIRECTORY=$out
+    sed -i 's_/usr/share_$out_g' cmake_install.cmake
+    sed -i 's_/usr/share_$out_g' src/cmake_install.cmake
+  '';
+
+  installTargets = [ ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp src/CGeniusExe $out/bin
+  '';
+
+  meta = {
+    description = "Modern Interpreter for the Commander Keen Games";
+    longdescription = ''
+      Commander Genius is an open-source clone of
+      Commander Keen which allows you to play
+      the games, and some of the mods
+      made for it. All of the original data files
+      are required to do so
+    '';
+    homepage = "https://github.com/gerstrong/Commander-Genius";
+    maintainers = with stdenv.lib.maintainers; [ hce ]; 
+    license = stdenv.lib.licenses.gpl2;
+  };
+}