speed-dreams: 2.3.0-r8786 -> 2.4.2 (#479933)
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
libGLU,
|
||||
libGL,
|
||||
libglut,
|
||||
libX11,
|
||||
plib,
|
||||
openal,
|
||||
freealut,
|
||||
libXrandr,
|
||||
xorgproto,
|
||||
libXext,
|
||||
libSM,
|
||||
libICE,
|
||||
libXi,
|
||||
libXt,
|
||||
libXrender,
|
||||
libXxf86vm,
|
||||
openscenegraph,
|
||||
expat,
|
||||
libpng12,
|
||||
zlib,
|
||||
bash,
|
||||
SDL2,
|
||||
SDL2_mixer,
|
||||
enet,
|
||||
libjpeg,
|
||||
cmake,
|
||||
pkg-config,
|
||||
libvorbis,
|
||||
runtimeShell,
|
||||
curl,
|
||||
fetchgit,
|
||||
cjson,
|
||||
minizip,
|
||||
rhash,
|
||||
copyDesktopItems,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.4.2";
|
||||
pname = "speed-dreams";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://forge.a-lec.org/speed-dreams/speed-dreams-code.git";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-ZY/0tf0wFbepEUNqpaBA4qgkWDij/joqPtbiF/48oN4=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
NIX_CFLAGS_COMPILE = "-I${src}/src/libs/tgf -I${src}/src/libs/tgfdata -I${src}/src/interfaces -I${src}/src/libs/math -I${src}/src/libs/portability";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p "$out/bin"
|
||||
# Wrapper for main executable
|
||||
cat > "$out/bin/speed-dreams" <<EOF
|
||||
#!${runtimeShell}
|
||||
export LD_LIBRARY_PATH="$out/lib/games/speed-dreams-2/lib:$out/lib:${
|
||||
lib.makeLibraryPath [
|
||||
libGL
|
||||
libGLU
|
||||
libglut
|
||||
libX11
|
||||
plib
|
||||
openal
|
||||
freealut
|
||||
libXrandr
|
||||
libXext
|
||||
libSM
|
||||
libICE
|
||||
libXi
|
||||
libXt
|
||||
libXrender
|
||||
libXxf86vm
|
||||
openscenegraph
|
||||
expat
|
||||
libpng12
|
||||
zlib
|
||||
SDL2
|
||||
SDL2_mixer
|
||||
enet
|
||||
libjpeg
|
||||
libvorbis
|
||||
curl
|
||||
cjson
|
||||
minizip
|
||||
rhash
|
||||
stdenv.cc.cc.lib
|
||||
]
|
||||
}"
|
||||
if [ -e "${libGL}/lib/libGL.so.1" ]; then
|
||||
export LD_PRELOAD="${libGL}/lib/libGL.so.1''${LD_PRELOAD:+:$LD_PRELOAD}"
|
||||
fi
|
||||
export SDL_VIDEODRIVER="x11"
|
||||
exec "$out/games/speed-dreams-2" "$@"
|
||||
EOF
|
||||
chmod a+x "$out/bin/speed-dreams"
|
||||
|
||||
# Symlink for desktop icon
|
||||
mkdir -p $out/share/pixmaps/
|
||||
ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png"
|
||||
substituteInPlace "$out/share/applications/speed-dreams.desktop" \
|
||||
--replace-fail "Exec=$out/games/speed-dreams-2" "Exec=$out/bin/speed-dreams" \
|
||||
--replace-fail "Icon=/build/speed-dreams-code/speed-dreams-data/data/data/icons/icon.png" "Icon=$out/share/pixmaps/speed-dreams-2.png"
|
||||
'';
|
||||
|
||||
# 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
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libpng12
|
||||
libGLU
|
||||
libGL
|
||||
libglut
|
||||
libX11
|
||||
plib
|
||||
openal
|
||||
freealut
|
||||
libXrandr
|
||||
xorgproto
|
||||
libXext
|
||||
libSM
|
||||
libICE
|
||||
libXi
|
||||
libXt
|
||||
libXrender
|
||||
libXxf86vm
|
||||
zlib
|
||||
bash
|
||||
expat
|
||||
SDL2
|
||||
SDL2_mixer
|
||||
enet
|
||||
libjpeg
|
||||
openscenegraph
|
||||
libvorbis
|
||||
curl
|
||||
cjson
|
||||
minizip
|
||||
rhash
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Car racing game - TORCS fork with more experimental approach";
|
||||
homepage = "https://www.speed-dreams.net/";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = with lib.maintainers; [ raskin ];
|
||||
platforms = lib.platforms.linux;
|
||||
mainProgram = "speed-dreams";
|
||||
};
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
{
|
||||
fetchurl,
|
||||
lib,
|
||||
stdenv,
|
||||
libGLU,
|
||||
libGL,
|
||||
libglut,
|
||||
libX11,
|
||||
plib,
|
||||
openal,
|
||||
freealut,
|
||||
libXrandr,
|
||||
xorgproto,
|
||||
libXext,
|
||||
libSM,
|
||||
libICE,
|
||||
libXi,
|
||||
libXt,
|
||||
libXrender,
|
||||
libXxf86vm,
|
||||
openscenegraph,
|
||||
expat,
|
||||
libpng,
|
||||
zlib,
|
||||
bash,
|
||||
SDL2,
|
||||
SDL2_mixer,
|
||||
enet,
|
||||
libjpeg,
|
||||
cmake,
|
||||
pkg-config,
|
||||
libvorbis,
|
||||
runtimeShell,
|
||||
curl,
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.3.0-r8786";
|
||||
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";
|
||||
sha256 = "sha256-DUyMs9Hr1PYgmNVwBY/e6snVeGl9GX0AnZ7S+TFABKQ=";
|
||||
};
|
||||
|
||||
cars-and-tracks = fetchurl {
|
||||
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-hq-cars-and-tracks-${version}.tar.xz";
|
||||
sha256 = "sha256-WT+W6uuw4BRSbF1Cw123q3v9qSCvBQ7TcQ/Y0RV/7Js=";
|
||||
};
|
||||
|
||||
more-cars-and-tracks = fetchurl {
|
||||
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-more-hq-cars-and-tracks-${version}.tar.xz";
|
||||
sha256 = "sha256-psApv+Z1HDFvh5bzt125mo/ZvO5rjee/KhOf45iKnKk=";
|
||||
};
|
||||
|
||||
wip-cars-and-tracks = fetchurl {
|
||||
url = "mirror://sourceforge/speed-dreams/${shortVersion}/speed-dreams-src-wip-cars-and-tracks-${version}.tar.xz";
|
||||
sha256 = "sha256-OEAbqFfO2PzHP7+eAtPNn3Ql6fYNTKzzQW8lHe9KDXM=";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
postUnpack = ''
|
||||
echo Unpacking data
|
||||
tar -xf ${cars-and-tracks}
|
||||
tar -xf ${more-cars-and-tracks}
|
||||
tar -xf ${wip-cars-and-tracks}
|
||||
'';
|
||||
|
||||
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"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir "$out/bin"
|
||||
for i in "$out"/games/*; do
|
||||
echo '#!${runtimeShell}' >> "$out/bin/$(basename "$i")"
|
||||
echo "$i"' "$@"' >> "$out/bin/$(basename "$i")"
|
||||
chmod a+x "$out/bin/$(basename "$i")"
|
||||
done
|
||||
|
||||
mkdir -p $out/share/pixmaps/
|
||||
ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png"
|
||||
'';
|
||||
|
||||
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"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
# 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
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libpng
|
||||
libGLU
|
||||
libGL
|
||||
libglut
|
||||
libX11
|
||||
plib
|
||||
openal
|
||||
freealut
|
||||
libXrandr
|
||||
xorgproto
|
||||
libXext
|
||||
libSM
|
||||
libICE
|
||||
libXi
|
||||
libXt
|
||||
libXrender
|
||||
libXxf86vm
|
||||
zlib
|
||||
bash
|
||||
expat
|
||||
SDL2
|
||||
SDL2_mixer
|
||||
enet
|
||||
libjpeg
|
||||
openscenegraph
|
||||
libvorbis
|
||||
curl
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Car racing game - TORCS fork with more experimental approach";
|
||||
homepage = "https://speed-dreams.sourceforge.net/";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = with lib.maintainers; [ raskin ];
|
||||
platforms = lib.platforms.linux;
|
||||
hydraPlatforms = [ ];
|
||||
};
|
||||
}
|
||||
@@ -12616,12 +12616,6 @@ with pkgs;
|
||||
|
||||
tibia = pkgsi686Linux.callPackage ../games/tibia { };
|
||||
|
||||
speed_dreams = callPackage ../games/speed-dreams {
|
||||
# Torcs wants to make shared libraries linked with plib libraries (it provides static).
|
||||
# i686 is the only platform I know than can do that linking without plib built with -fPIC
|
||||
libpng = libpng12;
|
||||
};
|
||||
|
||||
ultrastar-creator = libsForQt5.callPackage ../tools/misc/ultrastar-creator { };
|
||||
|
||||
ultrastar-manager = libsForQt5.callPackage ../tools/misc/ultrastar-manager { };
|
||||
|
||||
Reference in New Issue
Block a user