python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / games / speed-dreams / default.nix
blobb97e755b27530d4593e08e9af85a6c4a62f668e7
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 }:
5 let
6   version = "2.2.3-r7616";
7   shortVersion = builtins.substring 0 5 version;
8 in
9 stdenv.mkDerivation rec {
10   inherit version;
11   pname = "speed-dreams";
13   src = fetchurl {
14     url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-base-${version}.tar.xz";
15     sha256 = "sha256-GvB8SDZB9UivJSsQfMMon9N5MURdxTOwsaN4F0XQUCE=";
16   };
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=";
21   };
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=";
26   };
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=";
31   };
33   sourceRoot = ".";
35   postUnpack = ''
36     echo Unpacking data
37     tar -xf ${cars-and-tracks}
38     tar -xf ${more-cars-and-tracks}
39     tar -xf ${wip-cars-and-tracks}
40   '';
42   preBuild = ''
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"
48   '';
50   postInstall = ''
51     mkdir "$out/bin"
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")"
56     done
57   '';
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 ];
65   meta = {
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;
71     hydraPlatforms = [];
72   };