1 { fetchurl, lib, stdenv, libGLU, libGL, freeglut, libX11, plib, openal, freealut, libXrandr, xorgproto,
2 libXext, libSM, libICE, libXi, libXt, libXrender, libXxf86vm, openscenegraph, expat,
3 libpng, zlib, bash, SDL2, enet, libjpeg, cmake, pkg-config, libvorbis, runtimeShell, curl }:
6 version = "2.2.3-r7616";
7 shortVersion = builtins.substring 0 5 version;
9 stdenv.mkDerivation rec {
11 pname = "speed-dreams";
14 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-base-${version}.tar.xz";
15 sha256 = "sha256-GvB8SDZB9UivJSsQfMMon9N5MURdxTOwsaN4F0XQUCE=";
18 cars-and-tracks = fetchurl {
19 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-hq-cars-and-tracks-${version}.tar.xz";
20 sha256 = "sha256-BuryCUvBD7rKmApCNsTkRN0UJ1q6P3sdYrSzpTqdTHc=";
23 more-cars-and-tracks = fetchurl {
24 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-more-hq-cars-and-tracks-${version}.tar.xz";
25 sha256 = "sha256-GSCHYbJS352yAMczzss7tYSQXwLQV68rv/XkyGy+GoY=";
28 wip-cars-and-tracks = fetchurl {
29 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-wip-cars-and-tracks-${version}.tar.xz";
30 sha256 = "sha256-r/IOSf+UZg2e+WIHn2QNDO6qQUhpIJvh7EF2jQ7lyyA=";
37 tar -xf ${cars-and-tracks}
38 tar -xf ${more-cars-and-tracks}
39 tar -xf ${wip-cars-and-tracks}
43 make -C src/libs/portability
44 make -C src/libs/portability portability.o
45 ar -rv "$(echo lib*/games/speed-dreams*/lib)"/libportability_static.a src/libs/portability/CMakeFiles/portability.dir/portability.cpp.o
46 export NIX_LDFLAGS="$NIX_LDFLAGS -L$(echo $PWD/lib*/games/speed-dreams*/lib) -lexpat"
47 echo "libportability_static.a built"
52 for i in "$out"/games/*; do
53 echo '#!${runtimeShell}' >> "$out/bin/$(basename "$i")"
54 echo "$i"' "$@"' >> "$out/bin/$(basename "$i")"
55 chmod a+x "$out/bin/$(basename "$i")"
59 nativeBuildInputs = [ pkg-config cmake ];
61 buildInputs = [ libpng libGLU libGL freeglut libX11 plib openal freealut libXrandr xorgproto
62 libXext libSM libICE libXi libXt libXrender libXxf86vm zlib bash expat
63 SDL2 enet libjpeg openscenegraph libvorbis curl ];
66 description = "Car racing game - TORCS fork with more experimental approach";
67 homepage = "http://speed-dreams.sourceforge.net/";
68 license = lib.licenses.gpl2Plus;
69 maintainers = with lib.maintainers; [raskin];
70 platforms = lib.platforms.linux;