2024-06-20 05:39:23 +01:00
|
|
|
{ fetchurl, lib, stdenv, libGLU, libGL, libglut, libX11, plib, openal, freealut, libXrandr, xorgproto,
|
2017-02-26 17:09:51 +00:00
|
|
|
libXext, libSM, libICE, libXi, libXt, libXrender, libXxf86vm, openscenegraph, expat,
|
2024-02-03 15:04:34 +00:00
|
|
|
libpng, zlib, bash, SDL2, SDL2_mixer, enet, libjpeg, cmake, pkg-config, libvorbis, runtimeShell, curl, copyDesktopItems, makeDesktopItem }:
|
2011-04-04 06:01:53 +01:00
|
|
|
|
2019-08-06 21:09:31 +01:00
|
|
|
let
|
2024-02-03 15:03:54 +00:00
|
|
|
version = "2.3.0-r8786";
|
2019-08-06 21:09:31 +01:00
|
|
|
shortVersion = builtins.substring 0 5 version;
|
|
|
|
in
|
2011-04-04 06:01:53 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-06 21:09:31 +01:00
|
|
|
inherit version;
|
|
|
|
pname = "speed-dreams";
|
2011-04-04 06:01:53 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-06 21:09:31 +01:00
|
|
|
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-base-${version}.tar.xz";
|
2024-02-03 15:03:54 +00:00
|
|
|
sha256 = "sha256-DUyMs9Hr1PYgmNVwBY/e6snVeGl9GX0AnZ7S+TFABKQ=";
|
2011-04-04 06:01:53 +01:00
|
|
|
};
|
|
|
|
|
2017-02-26 17:09:51 +00:00
|
|
|
cars-and-tracks = fetchurl {
|
2019-08-06 21:09:31 +01:00
|
|
|
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-hq-cars-and-tracks-${version}.tar.xz";
|
2024-02-03 15:03:54 +00:00
|
|
|
sha256 = "sha256-WT+W6uuw4BRSbF1Cw123q3v9qSCvBQ7TcQ/Y0RV/7Js=";
|
2017-02-26 17:09:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
more-cars-and-tracks = fetchurl {
|
2019-08-06 21:09:31 +01:00
|
|
|
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-more-hq-cars-and-tracks-${version}.tar.xz";
|
2024-02-03 15:03:54 +00:00
|
|
|
sha256 = "sha256-psApv+Z1HDFvh5bzt125mo/ZvO5rjee/KhOf45iKnKk=";
|
2017-02-26 17:09:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
wip-cars-and-tracks = fetchurl {
|
2019-08-06 21:09:31 +01:00
|
|
|
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-wip-cars-and-tracks-${version}.tar.xz";
|
2024-02-03 15:03:54 +00:00
|
|
|
sha256 = "sha256-OEAbqFfO2PzHP7+eAtPNn3Ql6fYNTKzzQW8lHe9KDXM=";
|
2017-02-26 17:09:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
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
|
2024-02-03 15:04:34 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/pixmaps/
|
|
|
|
ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png"
|
2017-02-26 17:09:51 +00:00
|
|
|
'';
|
|
|
|
|
2024-02-03 15:04:34 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "Speed Dreams 2";
|
|
|
|
exec = "speed-dreams-2";
|
|
|
|
icon = "speed-dreams-2.png";
|
|
|
|
desktopName = "speed-dreams-2";
|
|
|
|
comment = "The Open Racing Car Simulator Fork";
|
|
|
|
categories = [ "Application" "Game" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-11-11 20:53:29 +00:00
|
|
|
# RPATH of binary /nix/store/.../lib64/games/speed-dreams-2/drivers/shadow_sc/shadow_sc.so contains a forbidden reference to /build/
|
|
|
|
cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ];
|
|
|
|
|
2024-02-03 15:04:34 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake copyDesktopItems ];
|
2011-04-04 06:01:53 +01:00
|
|
|
|
2024-06-20 05:39:23 +01:00
|
|
|
buildInputs = [ libpng libGLU libGL libglut libX11 plib openal freealut libXrandr xorgproto
|
2017-02-26 17:09:51 +00:00
|
|
|
libXext libSM libICE libXi libXt libXrender libXxf86vm zlib bash expat
|
2024-02-03 15:03:54 +00:00
|
|
|
SDL2 SDL2_mixer enet libjpeg openscenegraph libvorbis curl ];
|
2011-04-04 06:01:53 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Car racing game - TORCS fork with more experimental approach";
|
2023-01-21 21:41:12 +00:00
|
|
|
homepage = "https://speed-dreams.sourceforge.net/";
|
2021-01-15 04:31:39 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [raskin];
|
|
|
|
platforms = lib.platforms.linux;
|
2013-11-04 23:04:36 +00:00
|
|
|
hydraPlatforms = [];
|
2011-04-04 06:01:53 +01:00
|
|
|
};
|
|
|
|
}
|