2021-11-10 21:21:47 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchsvn
|
|
|
|
, pkg-config
|
|
|
|
, sconsPackages
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, libvorbis
|
|
|
|
, bullet
|
|
|
|
, curl
|
|
|
|
, gettext
|
2021-12-19 00:32:35 +00:00
|
|
|
, writeShellScriptBin
|
2011-03-28 17:08:21 +01:00
|
|
|
|
2018-01-05 21:06:15 +00:00
|
|
|
, data ? fetchsvn {
|
2016-04-17 03:24:26 +01:00
|
|
|
url = "svn://svn.code.sf.net/p/vdrift/code/vdrift-data";
|
2018-11-07 08:41:55 +00:00
|
|
|
rev = "1386";
|
2016-04-17 03:24:26 +01:00
|
|
|
sha256 = "0ka6zir9hg0md5p03dl461jkvbk05ywyw233hnc3ka6shz3vazi1";
|
2018-01-05 21:06:15 +00:00
|
|
|
}
|
|
|
|
}:
|
|
|
|
let
|
2021-11-10 21:21:47 +00:00
|
|
|
version = "unstable-2017-12-09";
|
2018-01-05 21:06:15 +00:00
|
|
|
bin = stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "vdrift";
|
|
|
|
inherit version;
|
2013-03-09 13:54:43 +00:00
|
|
|
|
2018-01-05 21:06:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vdrift";
|
|
|
|
repo = "vdrift";
|
|
|
|
rev = "12d444ed18395be8827a21b96cc7974252fce6d1";
|
|
|
|
sha256 = "001wq3c4n9wzxqfpq40b1jcl16sxbqv2zbkpy9rq2wf9h417q6hg";
|
|
|
|
};
|
2011-03-28 17:08:21 +01:00
|
|
|
|
2021-01-17 05:49:22 +00:00
|
|
|
nativeBuildInputs = [ pkg-config sconsPackages.scons_3_1_2 ];
|
2020-03-27 13:47:48 +00:00
|
|
|
buildInputs = [ libGLU libGL SDL2 SDL2_image libvorbis bullet curl gettext ];
|
2018-01-05 21:06:15 +00: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 17:08:21 +01:00
|
|
|
|
2018-01-05 21:06:15 +00:00
|
|
|
meta = {
|
|
|
|
description = "Car racing game";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://vdrift.net/";
|
2021-01-15 04:31:39 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-11-10 21:21:47 +00:00
|
|
|
maintainers = with lib.maintainers; [ viric ];
|
2021-01-15 04:31:39 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2018-01-05 21:06:15 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
wrappedName = "vdrift-${version}-with-data-${toString data.rev}";
|
2021-12-19 00:32:35 +00:00
|
|
|
in
|
|
|
|
(writeShellScriptBin "vdrift" ''
|
|
|
|
export VDRIFT_DATA_DIRECTORY="${data}"
|
|
|
|
exec ${bin}/bin/vdrift "$@"
|
|
|
|
'').overrideAttrs (_: {
|
2018-01-05 21:06:15 +00:00
|
|
|
name = wrappedName;
|
|
|
|
meta = bin.meta // {
|
2021-11-10 21:21:47 +00:00
|
|
|
hydraPlatforms = [ ];
|
2011-03-28 17:08:21 +01:00
|
|
|
};
|
2018-01-05 21:06:15 +00:00
|
|
|
unwrapped = bin;
|
|
|
|
inherit bin data;
|
2021-12-19 00:32:35 +00:00
|
|
|
})
|