nixpkgs/pkgs/games/speed-dreams/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
2.8 KiB
Nix
Raw Normal View History

2021-01-15 04:31:39 +00:00
{ fetchurl, lib, stdenv, libGLU, libGL, freeglut, libX11, plib, openal, freealut, libXrandr, xorgproto,
2017-02-26 17:09:51 +00:00
libXext, libSM, libICE, libXi, libXt, libXrender, libXxf86vm, openscenegraph, expat,
libpng, zlib, bash, SDL2, enet, libjpeg, cmake, pkg-config, libvorbis, runtimeShell, curl }:
let
2022-06-10 01:23:27 +00:00
version = "2.2.3-r7616";
shortVersion = builtins.substring 0 5 version;
in
stdenv.mkDerivation rec {
inherit version;
pname = "speed-dreams";
src = fetchurl {
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-base-${version}.tar.xz";
2022-06-10 01:23:27 +00:00
sha256 = "sha256-GvB8SDZB9UivJSsQfMMon9N5MURdxTOwsaN4F0XQUCE=";
};
2017-02-26 17:09:51 +00:00
cars-and-tracks = fetchurl {
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-hq-cars-and-tracks-${version}.tar.xz";
2022-06-10 01:23:27 +00:00
sha256 = "sha256-BuryCUvBD7rKmApCNsTkRN0UJ1q6P3sdYrSzpTqdTHc=";
2017-02-26 17:09:51 +00:00
};
more-cars-and-tracks = fetchurl {
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-more-hq-cars-and-tracks-${version}.tar.xz";
2022-06-10 01:23:27 +00:00
sha256 = "sha256-GSCHYbJS352yAMczzss7tYSQXwLQV68rv/XkyGy+GoY=";
2017-02-26 17:09:51 +00:00
};
wip-cars-and-tracks = fetchurl {
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-wip-cars-and-tracks-${version}.tar.xz";
2022-06-10 01:23:27 +00:00
sha256 = "sha256-r/IOSf+UZg2e+WIHn2QNDO6qQUhpIJvh7EF2jQ7lyyA=";
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}
'';
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"
'';
2017-02-26 17:09:51 +00:00
postInstall = ''
mkdir "$out/bin"
for i in "$out"/games/*; do
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
'';
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" ];
nativeBuildInputs = [ pkg-config cmake ];
2019-11-10 16:44:34 +00:00
buildInputs = [ libpng libGLU libGL freeglut libX11 plib openal freealut libXrandr xorgproto
2017-02-26 17:09:51 +00:00
libXext libSM libICE libXi libXt libXrender libXxf86vm zlib bash expat
SDL2 enet libjpeg openscenegraph libvorbis curl ];
meta = {
description = "Car racing game - TORCS fork with more experimental approach";
homepage = "http://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;
hydraPlatforms = [];
};
}