about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorfreezeboy <freezeboy@users.noreply.github.com>2020-07-15 09:43:19 +0200
committerfreezeboy <freezeboy@users.noreply.github.com>2020-12-29 13:25:59 +0100
commit80bff15d7b9bfc18d2734607654ce7525f8c1097 (patch)
treedc8cf86899fbaa50156c170683082a913f3d61d5 /pkgs/games
parentef7116f203e663b20b3e908c60dd691f68f8f089 (diff)
downloadnixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.tar
nixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.tar.gz
nixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.tar.bz2
nixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.tar.lz
nixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.tar.xz
nixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.tar.zst
nixlib-80bff15d7b9bfc18d2734607654ce7525f8c1097.zip
colobot: init at 0.1.12-alpha
Initial integration without the game musics to reduce the size of the
game. It works without them

Data are in another derivation to let them live their live independently
as they are quite big.

Limited to linux platform only because physfs is currently broken on
darwin.
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/colobot/data.nix41
-rw-r--r--pkgs/games/colobot/default.nix41
2 files changed, 82 insertions, 0 deletions
diff --git a/pkgs/games/colobot/data.nix b/pkgs/games/colobot/data.nix
new file mode 100644
index 000000000000..f1a4782fad6e
--- /dev/null
+++ b/pkgs/games/colobot/data.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchFromGitHub, cmake
+, gettext, vorbis-tools
+, xmlstarlet, doxygen, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "colobot-data";
+  version = "0.1.12-alpha";
+
+  src = fetchFromGitHub {
+    owner = "colobot";
+    repo = "colobot-data";
+    rev = "colobot-gold-${version}";
+    sha256 = "1vm33s52ymwd03x24i9bqiglw5v3wgd7rlzyx9r5ww0nnqzwbwi6";
+  };
+
+  nativeBuildInputs = [ cmake vorbis-tools xmlstarlet doxygen python3 ];
+  buildInputs = [ gettext ];
+
+  enableParallelBuilding = false;
+  # Build procedure requires the data folder
+  patchPhase = ''
+    cp -r $src localSrc
+    chmod +w localSrc/help/bots/po
+    find -type d -exec chmod +w {} \;
+    for po in localSrc/help/{bots,cbot,object,generic,programs}/po/* localSrc/levels/*{/*/*,}/po/*; do
+      rm $po
+      touch $po
+    done
+    # skip music
+    rm localSrc/music/CMakeLists.txt
+    cd localSrc
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://colobot.info/";
+    description = "Game data for colobot";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ freezeboy ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/games/colobot/default.nix b/pkgs/games/colobot/default.nix
new file mode 100644
index 000000000000..9c0cbe7949c0
--- /dev/null
+++ b/pkgs/games/colobot/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitHub, cmake, boost, SDL2, SDL2_image, SDL2_ttf, libpng
+, glew, gettext, libsndfile, libvorbis, libogg, physfs, openal
+, xmlstarlet, doxygen, python3, callPackage }:
+
+let
+  colobot-data = callPackage ./data.nix {};
+in
+stdenv.mkDerivation rec {
+  pname = "colobot";
+  # Maybe require an update to package colobot-data as well
+  # in file data.nix next to this one
+  version = "0.1.12-alpha";
+
+  src = fetchFromGitHub {
+    owner = "colobot";
+    repo = "colobot";
+    rev = "colobot-gold-${version}";
+    sha256 = "0viq5s4zqs33an7rdmc3anf74ml7mwwcwf60alhvp9hj5jr547s2";
+  };
+
+  nativeBuildInputs = [ cmake xmlstarlet doxygen python3 ];
+  buildInputs = [ boost SDL2 SDL2_image SDL2_ttf libpng glew gettext libsndfile libvorbis libogg physfs openal ];
+
+  enableParallelBuilding = false;
+
+  # The binary ends in games directoy
+  postInstall = ''
+    mv $out/games $out/bin
+    for contents in ${colobot-data}/share/games/colobot/*; do
+      ln -s $contents $out/share/games/colobot
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://colobot.info/";
+    description = "Colobot: Gold Edition is a real-time strategy game, where you can program your bots";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ freezeboy ];
+    platforms = platforms.linux;
+  };
+}