2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchsvn
|
|
|
|
, pkg-config
|
2023-03-27 19:17:25 +00:00
|
|
|
, scons
|
2021-12-06 16:07:01 +00:00
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, libvorbis
|
|
|
|
, bullet
|
|
|
|
, curl
|
|
|
|
, gettext
|
2022-01-26 04:04:25 +00:00
|
|
|
, writeShellScriptBin
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, data ? fetchsvn {
|
|
|
|
url = "svn://svn.code.sf.net/p/vdrift/code/vdrift-data";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "1446";
|
|
|
|
sha256 = "sha256-KEu49GAOfenPyuaUItt6W9pkuqUNpXgmTSFuc7ThljQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
}:
|
|
|
|
let
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "unstable-2021-09-05";
|
2020-04-24 23:36:52 +00:00
|
|
|
bin = stdenv.mkDerivation {
|
|
|
|
pname = "vdrift";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vdrift";
|
|
|
|
repo = "vdrift";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "7e9e00c8612b2014d491f026dd86b03f9fb04dcd";
|
|
|
|
sha256 = "sha256-DrzRF4WzwEXCNALq0jz8nHWZ1oYTEsdrvSYVYI1WkTI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
nativeBuildInputs = [ pkg-config scons ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libGLU libGL SDL2 SDL2_image libvorbis bullet curl gettext ];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
./0001-Ignore-missing-data-for-installation.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
sed -i -e s,/usr/local,$out, SConstruct
|
|
|
|
export CXXFLAGS="$(pkg-config --cflags SDL2_image)"
|
|
|
|
scons -j$NIX_BUILD_CORES
|
|
|
|
'';
|
|
|
|
installPhase = "scons install";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Car racing game";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "vdrift";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://vdrift.net/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with lib.maintainers; [ viric ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
wrappedName = "vdrift-${version}-with-data-${toString data.rev}";
|
2022-01-26 04:04:25 +00:00
|
|
|
in
|
|
|
|
(writeShellScriptBin "vdrift" ''
|
|
|
|
export VDRIFT_DATA_DIRECTORY="${data}"
|
|
|
|
exec ${bin}/bin/vdrift "$@"
|
|
|
|
'').overrideAttrs (_: {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = wrappedName;
|
|
|
|
meta = bin.meta // {
|
2021-12-06 16:07:01 +00:00
|
|
|
hydraPlatforms = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
unwrapped = bin;
|
|
|
|
inherit bin data;
|
2022-01-26 04:04:25 +00:00
|
|
|
})
|