2018-12-31 03:40:47 +00:00
|
|
|
{ fetchurl, stdenv, libGLU_combined, freeglut, libX11, plib, openal, freealut, libXrandr, xorgproto,
|
2017-02-26 17:09:51 +00:00
|
|
|
libXext, libSM, libICE, libXi, libXt, libXrender, libXxf86vm, openscenegraph, expat,
|
2019-02-26 11:45:54 +00:00
|
|
|
libpng, zlib, bash, SDL2, enet, libjpeg, cmake, pkgconfig, libvorbis, runtimeShell }:
|
2011-04-04 06:01:53 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-02-26 17:09:51 +00:00
|
|
|
version = "2.2.1-r6404";
|
2011-04-04 06:01:53 +01:00
|
|
|
name = "speed-dreams-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2017-02-26 17:09:51 +00:00
|
|
|
url = "mirror://sourceforge/speed-dreams/2.2.1/speed-dreams-src-base-${version}.tar.xz";
|
|
|
|
sha256 = "0347sk8xbdsyvl48qybbycd7hvzsx5b37zzjx1yx73nzddhmlpbx";
|
2011-04-04 06:01:53 +01:00
|
|
|
};
|
|
|
|
|
2017-02-26 17:09:51 +00:00
|
|
|
cars-and-tracks = fetchurl {
|
|
|
|
url = "mirror://sourceforge/speed-dreams/2.2.1/speed-dreams-src-hq-cars-and-tracks-${version}.tar.xz";
|
|
|
|
sha256 = "1h50l110n42nrq6j3kcyhi3swgmrjcg979vb6h0zsf46afwv0z3q";
|
|
|
|
};
|
|
|
|
|
|
|
|
more-cars-and-tracks = fetchurl {
|
|
|
|
url = "mirror://sourceforge/speed-dreams/2.2.1/speed-dreams-src-more-hq-cars-and-tracks-${version}.tar.xz";
|
|
|
|
sha256 = "03m3gwd03jqgsfjdglzmrv613cp4gh50i63fwmnwl282zhxydcwd";
|
|
|
|
};
|
|
|
|
|
|
|
|
wip-cars-and-tracks = fetchurl {
|
|
|
|
url = "mirror://sourceforge/speed-dreams/2.2.1/speed-dreams-src-wip-cars-and-tracks-${version}.tar.xz";
|
|
|
|
sha256 = "0ysk756rd294xzpwvmjh0mb229ngzrc4ry9lpyhyak98rbcp9hxm";
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
echo Unpacking data
|
|
|
|
tar -xf ${cars-and-tracks}
|
|
|
|
tar -xf ${more-cars-and-tracks}
|
|
|
|
tar -xf ${wip-cars-and-tracks}
|
2011-04-04 06:01:53 +01:00
|
|
|
'';
|
|
|
|
|
2018-11-01 22:18:25 +00:00
|
|
|
prePatch = ''
|
|
|
|
# https://sourceforge.net/p/speed-dreams/mailman/message/35665539/
|
|
|
|
sed -i "s|lastSlash = '\\\0'|lastSlash = NULL|" src/libs/tgf/params.cpp
|
|
|
|
sed -i "s|const char\* error = '\\\0'|const char\* error = NULL|" src/libs/tgfclient/openalmusicplayer.cpp
|
|
|
|
'';
|
|
|
|
|
2017-02-26 17:09:51 +00:00
|
|
|
preBuild = ''
|
|
|
|
make -C src/libs/portability
|
|
|
|
make -C src/libs/portability portability.o
|
|
|
|
ar -rv "$(echo lib*/games/speed-dreams*/lib)"/libportability_static.a src/libs/portability/CMakeFiles/portability.dir/portability.cpp.o
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -L$(echo $PWD/lib*/games/speed-dreams*/lib) -lexpat"
|
|
|
|
echo "libportability_static.a built"
|
|
|
|
'';
|
2011-04-04 06:01:53 +01:00
|
|
|
|
2017-02-26 17:09:51 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir "$out/bin"
|
|
|
|
for i in "$out"/games/*; do
|
2019-02-26 11:45:54 +00:00
|
|
|
echo '#!${runtimeShell}' >> "$out/bin/$(basename "$i")"
|
2017-02-26 17:09:51 +00:00
|
|
|
echo "$i"' "$@"' >> "$out/bin/$(basename "$i")"
|
|
|
|
chmod a+x "$out/bin/$(basename "$i")"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig cmake ];
|
2011-04-04 06:01:53 +01:00
|
|
|
|
2018-12-31 03:40:47 +00:00
|
|
|
buildInputs = [ libpng libGLU_combined freeglut libX11 plib openal freealut libXrandr xorgproto
|
2017-02-26 17:09:51 +00:00
|
|
|
libXext libSM libICE libXi libXt libXrender libXxf86vm zlib bash expat
|
|
|
|
SDL2 enet libjpeg openscenegraph libvorbis ];
|
2011-04-04 06:01:53 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Car racing game - TORCS fork with more experimental approach";
|
|
|
|
homepage = http://speed-dreams.sourceforge.net/;
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2018-07-22 20:50:19 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [raskin];
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
hydraPlatforms = [];
|
2011-04-04 06:01:53 +01:00
|
|
|
};
|
|
|
|
}
|