forked from mirrors/nixpkgs
teeworlds: use wrapProgram
Replace custom wrapper by wrapProgram tool.
This commit is contained in:
parent
8d977ead38
commit
f144887ba0
|
@ -1,4 +1,6 @@
|
|||
{ fetchurl, stdenv, python, alsaLib, libX11, mesa_glu, SDL, lua5, zlib, bam, freetype }:
|
||||
{ fetchurl, stdenv, makeWrapper, python, alsaLib
|
||||
, libX11, mesa_glu, SDL, lua5, zlib, bam, freetype
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "teeworlds-0.6.3";
|
||||
|
@ -11,7 +13,9 @@ stdenv.mkDerivation rec {
|
|||
# we always want to use system libs instead of these
|
||||
postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}";
|
||||
|
||||
buildInputs = [ python alsaLib libX11 mesa_glu SDL lua5 zlib bam freetype ];
|
||||
buildInputs = [
|
||||
python makeWrapper alsaLib libX11 mesa_glu SDL lua5 zlib bam freetype
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
bam -a -v release
|
||||
|
@ -38,12 +42,8 @@ stdenv.mkDerivation rec {
|
|||
# that they can access the graphics and sounds.
|
||||
for program in $executables
|
||||
do
|
||||
mv -v "$out/bin/$program" "$out/bin/.wrapped-$program"
|
||||
cat > "$out/bin/$program" <<EOF
|
||||
#!/bin/sh
|
||||
cd "$out/share/${name}" && exec "$out/bin/.wrapped-$program" "\$@"
|
||||
EOF
|
||||
chmod -v +x "$out/bin/$program"
|
||||
wrapProgram $out/bin/$program \
|
||||
--run "cd $out/share/${name}"
|
||||
done
|
||||
|
||||
# Copy the documentation.
|
||||
|
|
Loading…
Reference in a new issue