2021-01-15 07:31:39 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchsvn, pkgconfig, sconsPackages, libGLU, libGL, SDL2, SDL2_image
|
2018-07-21 03:44:44 +03:00
|
|
|
, libvorbis, bullet, curl, gettext, writeTextFile
|
2011-03-28 20:08:21 +04:00
|
|
|
|
2018-01-06 00:06:15 +03:00
|
|
|
, data ? fetchsvn {
|
2016-04-17 05:24:26 +03:00
|
|
|
url = "svn://svn.code.sf.net/p/vdrift/code/vdrift-data";
|
2018-11-07 11:41:55 +03:00
|
|
|
rev = "1386";
|
2016-04-17 05:24:26 +03:00
|
|
|
sha256 = "0ka6zir9hg0md5p03dl461jkvbk05ywyw233hnc3ka6shz3vazi1";
|
2018-01-06 00:06:15 +03:00
|
|
|
}
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
version = "git";
|
|
|
|
bin = stdenv.mkDerivation {
|
2019-08-14 00:52:01 +03:00
|
|
|
pname = "vdrift";
|
|
|
|
inherit version;
|
2013-03-09 17:54:43 +04:00
|
|
|
|
2018-01-06 00:06:15 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vdrift";
|
|
|
|
repo = "vdrift";
|
|
|
|
rev = "12d444ed18395be8827a21b96cc7974252fce6d1";
|
|
|
|
sha256 = "001wq3c4n9wzxqfpq40b1jcl16sxbqv2zbkpy9rq2wf9h417q6hg";
|
|
|
|
};
|
2011-03-28 20:08:21 +04:00
|
|
|
|
2020-07-18 02:30:28 +03:00
|
|
|
nativeBuildInputs = [ pkgconfig sconsPackages.scons_3_1_2 ];
|
2020-03-27 16:47:48 +03:00
|
|
|
buildInputs = [ libGLU libGL SDL2 SDL2_image libvorbis bullet curl gettext ];
|
2018-01-06 00:06:15 +03:00
|
|
|
|
|
|
|
patches = [ ./0001-Ignore-missing-data-for-installation.patch ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
sed -i -e s,/usr/local,$out, SConstruct
|
|
|
|
export CXXFLAGS="$(pkg-config --cflags SDL2_image)"
|
|
|
|
scons -j$NIX_BUILD_CORES
|
|
|
|
'';
|
|
|
|
installPhase = "scons install";
|
2011-03-28 20:08:21 +04:00
|
|
|
|
2018-01-06 00:06:15 +03:00
|
|
|
meta = {
|
|
|
|
description = "Car racing game";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "http://vdrift.net/";
|
2021-01-15 07:31:39 +03:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [viric];
|
|
|
|
platforms = lib.platforms.linux;
|
2018-01-06 00:06:15 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
wrappedName = "vdrift-${version}-with-data-${toString data.rev}";
|
|
|
|
in writeTextFile {
|
|
|
|
name = wrappedName;
|
|
|
|
text = ''
|
|
|
|
export VDRIFT_DATA_DIRECTORY="${data}"
|
|
|
|
exec ${bin}/bin/vdrift "$@"
|
|
|
|
'';
|
|
|
|
destination = "/bin/vdrift";
|
|
|
|
executable = true;
|
|
|
|
checkPhase = ''
|
|
|
|
${stdenv.shell} -n $out/bin/vdrift
|
|
|
|
'';
|
|
|
|
} // {
|
|
|
|
meta = bin.meta // {
|
2013-11-05 03:04:36 +04:00
|
|
|
hydraPlatforms = [];
|
2011-03-28 20:08:21 +04:00
|
|
|
};
|
2018-01-06 00:06:15 +03:00
|
|
|
unwrapped = bin;
|
|
|
|
inherit bin data;
|
2011-03-28 20:08:21 +04:00
|
|
|
}
|