git.iko.soy/typeable/nixpkgs
on master help sign in
teeworlds: use wrapProgram

Replace custom wrapper by wrapProgram tool.

commitf144887ba027d74308374afb00e4476fee5aa6f6 authorRobert Helgesson <robert@rycee.net> dateSat 3 Sep 2016, 18:41 (10 years ago) parent8d977ea
1 file changed+8−8
pkgs/games/teeworlds/default.nix+8−8
pkgs/games/teeworlds/default.nix+8−8
@@ -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.