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 178726b61507..8d8c65626836 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 { };