40 version = "2.3.0-r8786";
41 shortVersion = builtins.substring 0 5 version;
43 stdenv.mkDerivation rec {
45 pname = "speed-dreams";
48 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-base-${version}.tar.xz";
49 sha256 = "sha256-DUyMs9Hr1PYgmNVwBY/e6snVeGl9GX0AnZ7S+TFABKQ=";
52 cars-and-tracks = fetchurl {
53 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-hq-cars-and-tracks-${version}.tar.xz";
54 sha256 = "sha256-WT+W6uuw4BRSbF1Cw123q3v9qSCvBQ7TcQ/Y0RV/7Js=";
57 more-cars-and-tracks = fetchurl {
58 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-more-hq-cars-and-tracks-${version}.tar.xz";
59 sha256 = "sha256-psApv+Z1HDFvh5bzt125mo/ZvO5rjee/KhOf45iKnKk=";
62 wip-cars-and-tracks = fetchurl {
63 url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-wip-cars-and-tracks-${version}.tar.xz";
64 sha256 = "sha256-OEAbqFfO2PzHP7+eAtPNn3Ql6fYNTKzzQW8lHe9KDXM=";
71 tar -xf ${cars-and-tracks}
72 tar -xf ${more-cars-and-tracks}
73 tar -xf ${wip-cars-and-tracks}
77 make -C src/libs/portability
78 make -C src/libs/portability portability.o
79 ar -rv "$(echo lib*/games/speed-dreams*/lib)"/libportability_static.a src/libs/portability/CMakeFiles/portability.dir/portability.cpp.o
80 export NIX_LDFLAGS="$NIX_LDFLAGS -L$(echo $PWD/lib*/games/speed-dreams*/lib) -lexpat"
81 echo "libportability_static.a built"
86 for i in "$out"/games/*; do
87 echo '#!${runtimeShell}' >> "$out/bin/$(basename "$i")"
88 echo "$i"' "$@"' >> "$out/bin/$(basename "$i")"
89 chmod a+x "$out/bin/$(basename "$i")"
92 mkdir -p $out/share/pixmaps/
93 ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png"
98 name = "Speed Dreams 2";
99 exec = "speed-dreams-2";
100 icon = "speed-dreams-2.png";
101 desktopName = "speed-dreams-2";
102 comment = "The Open Racing Car Simulator Fork";
110 # RPATH of binary /nix/store/.../lib64/games/speed-dreams-2/drivers/shadow_sc/shadow_sc.so contains a forbidden reference to /build/
111 cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ];
113 nativeBuildInputs = [
150 description = "Car racing game - TORCS fork with more experimental approach";
151 homepage = "https://speed-dreams.sourceforge.net/";
152 license = lib.licenses.gpl2Plus;
153 maintainers = with lib.maintainers; [ raskin ];
154 platforms = lib.platforms.linux;
155 hydraPlatforms = [ ];