git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #103077 from freezeboy/add-colobot
commitf423aea36ab4e8d36ef0bb35fe5c295f5804077a authorDoron Behar <doron.behar@gmail.com> dateWed 30 Dec 2020, 08:42 (6 years ago) parentab6c5e580bff15
3 files changed+84
pkgs/games/colobot/data.nix+41 pkgs/games/colobot/default.nix+41 pkgs/top-level/all-packages.nix+2
pkgs/games/colobot/data.nixnew file+41
@@ -0,0 +1,41 @@
1+{ stdenv, lib, fetchFromGitHub, cmake
2+, gettext, vorbis-tools
3+, xmlstarlet, doxygen, python3 }:
4+
5+stdenv.mkDerivation rec {
6+ pname = "colobot-data";
7+ version = "0.1.12-alpha";
8+
9+ src = fetchFromGitHub {
10+ owner = "colobot";
11+ repo = "colobot-data";
12+ rev = "colobot-gold-${version}";
13+ sha256 = "1vm33s52ymwd03x24i9bqiglw5v3wgd7rlzyx9r5ww0nnqzwbwi6";
14+ };
15+
16+ nativeBuildInputs = [ cmake vorbis-tools xmlstarlet doxygen python3 ];
17+ buildInputs = [ gettext ];
18+
19+ enableParallelBuilding = false;
20+ # Build procedure requires the data folder
21+ patchPhase = ''
22+ cp -r $src localSrc
23+ chmod +w localSrc/help/bots/po
24+ find -type d -exec chmod +w {} \;
25+ for po in localSrc/help/{bots,cbot,object,generic,programs}/po/* localSrc/levels/*{/*/*,}/po/*; do
26+ rm $po
27+ touch $po
28+ done
29+ # skip music
30+ rm localSrc/music/CMakeLists.txt
31+ cd localSrc
32+ '';
33+
34+ meta = with stdenv.lib; {
35+ homepage = "https://colobot.info/";
36+ description = "Game data for colobot";
37+ license = licenses.gpl3;
38+ maintainers = with maintainers; [ freezeboy ];
39+ platforms = platforms.linux;
40+ };
41+}
pkgs/games/colobot/default.nixnew file+41
@@ -0,0 +1,41 @@
1+{ stdenv, fetchFromGitHub, cmake, boost, SDL2, SDL2_image, SDL2_ttf, libpng
2+, glew, gettext, libsndfile, libvorbis, libogg, physfs, openal
3+, xmlstarlet, doxygen, python3, callPackage }:
4+
5+let
6+ colobot-data = callPackage ./data.nix {};
7+in
8+stdenv.mkDerivation rec {
9+ pname = "colobot";
10+ # Maybe require an update to package colobot-data as well
11+ # in file data.nix next to this one
12+ version = "0.1.12-alpha";
13+
14+ src = fetchFromGitHub {
15+ owner = "colobot";
16+ repo = "colobot";
17+ rev = "colobot-gold-${version}";
18+ sha256 = "0viq5s4zqs33an7rdmc3anf74ml7mwwcwf60alhvp9hj5jr547s2";
19+ };
20+
21+ nativeBuildInputs = [ cmake xmlstarlet doxygen python3 ];
22+ buildInputs = [ boost SDL2 SDL2_image SDL2_ttf libpng glew gettext libsndfile libvorbis libogg physfs openal ];
23+
24+ enableParallelBuilding = false;
25+
26+ # The binary ends in games directoy
27+ postInstall = ''
28+ mv $out/games $out/bin
29+ for contents in ${colobot-data}/share/games/colobot/*; do
30+ ln -s $contents $out/share/games/colobot
31+ done
32+ '';
33+
34+ meta = with stdenv.lib; {
35+ homepage = "https://colobot.info/";
36+ description = "Colobot: Gold Edition is a real-time strategy game, where you can program your bots";
37+ license = licenses.gpl3;
38+ maintainers = with maintainers; [ freezeboy ];
39+ platforms = platforms.linux;
40+ };
41+}
pkgs/top-level/all-packages.nix+2
@@ -192,6 +192,8 @@ in
192192
193193 corgi = callPackage ../development/tools/corgi { };
194194
195+ colobot = callPackage ../games/colobot {};
196+
195197 colorz = callPackage ../tools/misc/colorz { };
196198
197199 colorpicker = callPackage ../tools/misc/colorpicker { };