about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2020-12-30 08:42:16 +0200
committerGitHub <noreply@github.com>2020-12-30 08:42:16 +0200
commitf423aea36ab4e8d36ef0bb35fe5c295f5804077a (patch)
tree780ea513da52a2c3ee9b2baeedd128ba1b9a3d65 /pkgs/games
parentab6c5e5db99def27e207c1d8caee68ae89483e3b (diff)
parent80bff15d7b9bfc18d2734607654ce7525f8c1097 (diff)
downloadnixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.tar
nixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.tar.gz
nixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.tar.bz2
nixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.tar.lz
nixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.tar.xz
nixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.tar.zst
nixlib-f423aea36ab4e8d36ef0bb35fe5c295f5804077a.zip
Merge pull request #103077 from freezeboy/add-colobot
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;
+  };
+}