nixpkgs/pkgs/games/trigger/default.nix
Jörg Thalheim dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00

41 lines
1.1 KiB
Nix

{ fetchurl, stdenv, runtimeShell
, SDL2, freealut, SDL2_image, openal, physfs, zlib, libGLU_combined, glew }:
stdenv.mkDerivation rec {
name = "trigger-rally-0.6.5";
src = fetchurl {
url = "mirror://sourceforge/trigger-rally/${name}.tar.gz";
sha256 = "095s4sx0s1ijlarkh84rvzlv4nxh9llrsal1lb3m3pf0v228gnzj";
};
buildInputs = [ SDL2 freealut SDL2_image openal physfs zlib libGLU_combined glew ];
preConfigure = ''
sed s,/usr/local,$out, -i bin/*defs
cd src
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${SDL2.dev}/include/SDL2"
export makeFlags="$makeFlags prefix=$out"
'';
enableParallelBuilding = true;
postInstall = ''
mkdir -p $out/bin
cat <<EOF > $out/bin/trigger-rally
#!${runtimeShell}
exec $out/games/trigger-rally "$@"
EOF
chmod +x $out/bin/trigger-rally
'';
meta = {
description = "Rally";
homepage = http://trigger-rally.sourceforge.net/;
license = stdenv.lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
};
}