1 { lib, stdenv, fetchurl, fetchFromGitHub, fetchDebianPatch, cmake, pkg-config
2 , SDL2, libvorbis, libogg, libjpeg, libpng, freetype, glew, tinyxml, openal, libepoxy
4 , freealut, readline, libb2, gcc-unwrapped
5 , enableSoundtrack ? false # Enable the "Open Clonk Soundtrack - Explorers Journey" by David Oerther
9 soundtrack_src = fetchurl {
10 url = "http://www.openclonk.org/download/Music.ocg";
11 sha256 = "1ckj0dlpp5zsnkbb5qxxfxpkiq76jj2fgj91fyf3ll7n0gbwcgw5";
13 in stdenv.mkDerivation rec {
14 version = "unstable-2023-10-30";
17 src = fetchFromGitHub {
20 rev = "5275334a11ef7c23ce809f35d6b443abd91b415f";
21 sha256 = "14x5b2rh739156l4072rbsnv9n862jz1zafi6ng158ja5fwl16l2";
29 patch = "system-libb2.patch";
30 hash = "sha256-zuH6zxSQXRhnt75092Xwb6XYv8UG391E5Arbnr7ApiI=";
34 enableParallelInstalling = false;
37 '' + lib.optionalString enableSoundtrack ''
38 ln -sv ${soundtrack_src} $out/share/games/openclonk/Music.ocg
41 nativeBuildInputs = [ cmake pkg-config ];
44 SDL2 libvorbis libogg libjpeg libpng freetype glew tinyxml openal freealut
49 cmakeFlags = [ "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" ];
51 cmakeBuildType = "RelWithDebInfo";
54 description = "Free multiplayer action game in which you control clonks, small but witty and nimble humanoid beings";
55 homepage = "https://www.openclonk.org";
56 license = if enableSoundtrack then licenses.unfreeRedistributable else licenses.isc;
57 mainProgram = "openclonk";
59 platforms = [ "x86_64-linux" "i686-linux" ];