From 80bff15d7b9bfc18d2734607654ce7525f8c1097 Mon Sep 17 00:00:00 2001 From: freezeboy Date: Wed, 15 Jul 2020 09:43:19 +0200 Subject: [PATCH] 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. --- pkgs/games/colobot/data.nix | 41 +++++++++++++++++++++++++++++++++ pkgs/games/colobot/default.nix | 41 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 84 insertions(+) create mode 100644 pkgs/games/colobot/data.nix create mode 100644 pkgs/games/colobot/default.nix 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 930189a63ba0..ed2c8dd613e7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -192,6 +192,8 @@ in corgi = callPackage ../development/tools/corgi { }; + colobot = callPackage ../games/colobot {}; + colorz = callPackage ../tools/misc/colorz { }; colorpicker = callPackage ../tools/misc/colorpicker { };