teeworlds: use wrapProgram

Replace custom wrapper by wrapProgram tool.

+8 -8
+8 -8
pkgs/games/teeworlds/default.nix
··· 1 - { fetchurl, stdenv, python, alsaLib, libX11, mesa_glu, SDL, lua5, zlib, bam, freetype }: 2 3 stdenv.mkDerivation rec { 4 name = "teeworlds-0.6.3"; ··· 11 # we always want to use system libs instead of these 12 postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}"; 13 14 - buildInputs = [ python alsaLib libX11 mesa_glu SDL lua5 zlib bam freetype ]; 15 16 buildPhase = '' 17 bam -a -v release ··· 38 # that they can access the graphics and sounds. 39 for program in $executables 40 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" 47 done 48 49 # Copy the documentation.
··· 1 + { fetchurl, stdenv, makeWrapper, python, alsaLib 2 + , libX11, mesa_glu, SDL, lua5, zlib, bam, freetype 3 + }: 4 5 stdenv.mkDerivation rec { 6 name = "teeworlds-0.6.3"; ··· 13 # we always want to use system libs instead of these 14 postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}"; 15 16 + buildInputs = [ 17 + python makeWrapper alsaLib libX11 mesa_glu SDL lua5 zlib bam freetype 18 + ]; 19 20 buildPhase = '' 21 bam -a -v release ··· 42 # that they can access the graphics and sounds. 43 for program in $executables 44 do 45 + wrapProgram $out/bin/$program \ 46 + --run "cd $out/share/${name}" 47 done 48 49 # Copy the documentation.