1 { fetchurl, lib, stdenv, libGLU, libGL, libglut, libX11, plib, openal, freealut, libXrandr, xorgproto,
2 libXext, libSM, libICE, libXi, libXt, libXrender, libXxf86vm, openscenegraph, expat,
3 libpng, zlib, bash, SDL2, SDL2_mixer, enet, libjpeg, cmake, pkg-config, libvorbis, runtimeShell, curl, copyDesktopItems, makeDesktopItem }:
6 version = "2.3.0-r8786";
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-DUyMs9Hr1PYgmNVwBY/e6snVeGl9GX0AnZ7S+TFABKQ=";
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-WT+W6uuw4BRSbF1Cw123q3v9qSCvBQ7TcQ/Y0RV/7Js=";
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-psApv+Z1HDFvh5bzt125mo/ZvO5rjee/KhOf45iKnKk=";
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-OEAbqFfO2PzHP7+eAtPNn3Ql6fYNTKzzQW8lHe9KDXM=";
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")"
58 mkdir -p $out/share/pixmaps/
59 ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png"
64 name = "Speed Dreams 2";
65 exec = "speed-dreams-2";
66 icon = "speed-dreams-2.png";
67 desktopName = "speed-dreams-2";
68 comment = "The Open Racing Car Simulator Fork";
69 categories = [ "Application" "Game" ];
73 # RPATH of binary /nix/store/.../lib64/games/speed-dreams-2/drivers/shadow_sc/shadow_sc.so contains a forbidden reference to /build/
74 cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ];
76 nativeBuildInputs = [ pkg-config cmake copyDesktopItems ];
78 buildInputs = [ libpng libGLU libGL libglut libX11 plib openal freealut libXrandr xorgproto
79 libXext libSM libICE libXi libXt libXrender libXxf86vm zlib bash expat
80 SDL2 SDL2_mixer enet libjpeg openscenegraph libvorbis curl ];
83 description = "Car racing game - TORCS fork with more experimental approach";
84 homepage = "https://speed-dreams.sourceforge.net/";
85 license = lib.licenses.gpl2Plus;
86 maintainers = with lib.maintainers; [raskin];
87 platforms = lib.platforms.linux;