@@ -1,4 +1,6 @@
1−{ fetchurl, stdenv, python, alsaLib, libX11, mesa_glu, SDL, lua5, zlib, bam, freetype }:
1+{ fetchurl, stdenv, makeWrapper, python, alsaLib
2+, libX11, mesa_glu, SDL, lua5, zlib, bam, freetype
3+}:
24
35stdenv.mkDerivation rec {
46 name = "teeworlds-0.6.3";
@@ -11,7 +13,9 @@ stdenv.mkDerivation rec {
1113 # we always want to use system libs instead of these
1214 postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}";
1315
14− buildInputs = [ python alsaLib libX11 mesa_glu SDL lua5 zlib bam freetype ];
16+ buildInputs = [
17+ python makeWrapper alsaLib libX11 mesa_glu SDL lua5 zlib bam freetype
18+ ];
1519
1620 buildPhase = ''
1721 bam -a -v release
@@ -38,12 +42,8 @@ stdenv.mkDerivation rec {
3842 # that they can access the graphics and sounds.
3943 for program in $executables
4044 do
41− mv -v "$out/bin/$program" "$out/bin/.wrapped-$program"
42− cat > "$out/bin/$program" <<EOF
43− #!/bin/sh
44− cd "$out/share/${name}" && exec "$out/bin/.wrapped-$program" "\$@"
45− EOF
46− chmod -v +x "$out/bin/$program"
45+ wrapProgram $out/bin/$program \
46+ --run "cd $out/share/${name}"
4747 done
4848
4949 # Copy the documentation.