2020-12-14 19:21:47 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchsvn, cmake, pkg-config, makeWrapper
|
|
|
|
, SDL2, glew, openal, libvorbis, libogg, curl, freetype, bluez, libjpeg, libpng, enet, harfbuzz
|
2020-06-24 17:54:22 +01:00
|
|
|
, mcpp, wiiuse, angelscript
|
|
|
|
}:
|
2020-12-14 19:21:47 +00:00
|
|
|
|
2017-01-21 06:15:00 +00:00
|
|
|
let
|
|
|
|
dir = "stk-code";
|
2020-05-04 21:56:39 +01:00
|
|
|
assets = fetchsvn {
|
|
|
|
url = "https://svn.code.sf.net/p/supertuxkart/code/stk-assets";
|
2020-12-14 19:21:47 +00:00
|
|
|
rev = "18218";
|
|
|
|
sha256 = "11iv3cqzvbjg33zz5i5gkl2syn6mlw9wqv0jc7h36vjnjqjv17xw";
|
2020-05-04 21:56:39 +01:00
|
|
|
name = "stk-assets";
|
|
|
|
};
|
2017-01-21 06:15:00 +00:00
|
|
|
|
2020-06-24 17:54:22 +01:00
|
|
|
# List of bundled libraries in stk-code/lib to keep
|
|
|
|
# Those are the libraries that cannot be replaced
|
|
|
|
# with system packages.
|
|
|
|
bundledLibraries = [
|
|
|
|
# Bullet 2.87 is incompatible (bullet 2.79 needed whereas 2.87 is packaged)
|
|
|
|
# The api changed in a lot of classes, too much work to adapt
|
|
|
|
"bullet"
|
|
|
|
# Upstream Libenet doesn't yet support IPv6,
|
|
|
|
# So we will use the bundled libenet which
|
|
|
|
# has been fixed to support it.
|
|
|
|
"enet"
|
|
|
|
# Internal library of STK, nothing to do about it
|
|
|
|
"graphics_utils"
|
|
|
|
# This irrlicht is bundled with cmake
|
|
|
|
# whereas upstream irrlicht still uses
|
|
|
|
# archaic Makefiles, too complicated to switch to.
|
|
|
|
"irrlicht"
|
|
|
|
# Not packaged to this date
|
|
|
|
"libraqm"
|
|
|
|
# Not packaged to this date
|
|
|
|
"libsquish"
|
2020-12-14 19:21:47 +00:00
|
|
|
# Not packaged to this date
|
|
|
|
"sheenbidi"
|
2020-06-24 17:54:22 +01:00
|
|
|
];
|
2017-01-21 06:15:00 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2020-06-24 17:54:22 +01:00
|
|
|
|
2019-04-21 17:56:28 +01:00
|
|
|
pname = "supertuxkart";
|
2020-12-14 19:21:47 +00:00
|
|
|
version = "1.2";
|
2018-01-19 15:05:41 +00:00
|
|
|
|
2020-06-24 17:54:22 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "supertuxkart";
|
|
|
|
repo = "stk-code";
|
|
|
|
rev = version;
|
2020-12-14 19:21:47 +00:00
|
|
|
sha256 = "1f98whk0v45jgwcsbdsb1qfambvrnbbgwq0w28kjz4278hinwzq6";
|
2020-06-24 17:54:22 +01:00
|
|
|
name = dir;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Deletes all bundled libs in stk-code/lib except those
|
|
|
|
# That couldn't be replaced with system packages
|
|
|
|
postPatch = ''
|
|
|
|
find lib -maxdepth 1 -type d | egrep -v "^lib$|${(lib.concatStringsSep "|" bundledLibraries)}" | xargs -n1 -L1 -r -I{} rm -rf {}
|
|
|
|
'';
|
2017-01-21 06:15:00 +00:00
|
|
|
|
2020-12-14 19:21:47 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
2018-01-19 15:05:41 +00:00
|
|
|
|
2008-10-12 15:28:51 +01:00
|
|
|
buildInputs = [
|
2020-12-14 19:21:47 +00:00
|
|
|
SDL2 glew openal libvorbis libogg freetype curl bluez libjpeg libpng enet harfbuzz
|
2020-06-24 17:54:22 +01:00
|
|
|
mcpp wiiuse angelscript
|
2019-03-06 20:22:55 +00:00
|
|
|
];
|
|
|
|
|
2018-01-19 15:05:41 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_RECORDER=OFF" # libopenglrecorder is not in nixpkgs
|
|
|
|
"-DUSE_SYSTEM_ANGELSCRIPT=OFF" # doesn't work with 2.31.2 or 2.32.0
|
2020-05-04 21:56:39 +01:00
|
|
|
"-DCHECK_ASSETS=OFF"
|
2020-06-24 17:54:22 +01:00
|
|
|
"-DUSE_SYSTEM_WIIUSE=ON"
|
|
|
|
"-DUSE_SYSTEM_ANGELSCRIPT=ON"
|
2020-12-14 19:21:47 +00:00
|
|
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
2018-01-19 15:05:41 +00:00
|
|
|
];
|
|
|
|
|
2020-05-04 21:56:39 +01:00
|
|
|
# Obtain the assets directly from the fetched store path, to avoid duplicating assets across multiple engine builds
|
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/bin/supertuxkart --set-default SUPERTUXKART_ASSETS_DIR "${assets}"
|
|
|
|
'';
|
|
|
|
|
2020-06-24 17:54:22 +01:00
|
|
|
enableParallelBuilding = true;
|
2009-04-14 22:01:29 +01:00
|
|
|
|
2020-06-24 17:54:22 +01:00
|
|
|
meta = with lib; {
|
2015-04-30 16:05:14 +01:00
|
|
|
description = "A Free 3D kart racing game";
|
2008-10-12 15:28:51 +01:00
|
|
|
longDescription = ''
|
|
|
|
SuperTuxKart is a Free 3D kart racing game, with many tracks,
|
|
|
|
characters and items for you to try, similar in spirit to Mario
|
|
|
|
Kart.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://supertuxkart.net/";
|
2017-01-21 06:15:00 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2019-12-05 07:29:48 +00:00
|
|
|
maintainers = with maintainers; [ pyrolagus peterhoeg ];
|
2017-01-21 06:15:00 +00:00
|
|
|
platforms = with platforms; linux;
|
2008-10-12 15:28:51 +01:00
|
|
|
};
|
|
|
|
}
|