summary refs log tree commit diff
path: root/pkgs/games/teeworlds
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-01-13 20:36:09 +0000
committerLudovic Courtès <ludo@gnu.org>2009-01-13 20:36:09 +0000
commitdc28c92e635a35f3b72b261fc097dbe65a5c6fc2 (patch)
treedeca549e695ec00d3eee9c1df29005006591754c /pkgs/games/teeworlds
parente71dbdbb8334152dbf3083801d194b2f88cee9b4 (diff)
downloadnixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.tar
nixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.tar.gz
nixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.tar.bz2
nixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.tar.lz
nixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.tar.xz
nixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.tar.zst
nixpkgs-dc28c92e635a35f3b72b261fc097dbe65a5c6fc2.zip
Teeworlds: install all the executables (client, server, etc.).
svn path=/nixpkgs/trunk/; revision=13763
Diffstat (limited to 'pkgs/games/teeworlds')
-rw-r--r--pkgs/games/teeworlds/default.nix27
1 files changed, 22 insertions, 5 deletions
diff --git a/pkgs/games/teeworlds/default.nix b/pkgs/games/teeworlds/default.nix
index a458976e3e4..4aed1345e2c 100644
--- a/pkgs/games/teeworlds/default.nix
+++ b/pkgs/games/teeworlds/default.nix
@@ -31,18 +31,35 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
+    # Copy the graphics, sounds, etc.
     ensureDir "$out/share/${name}"
-    cp -rv data "$out/share/${name}"
+    cp -rv data other/icons "$out/share/${name}"
 
+    # Copy the executables (client, server, etc.).
     ensureDir "$out/bin"
-    cp -v teeworlds "$out/bin/.wrapped-teeworlds"
+    executables=""
+    for file in *
+    do
+      if [ -f "$file" ] && [ -x "$file" ]
+      then
+          executables="$file $executables"
+      fi
+    done
+    cp -v $executables "$out/bin"
 
-    cat > "$out/bin/teeworlds" <<EOF
+    # Make sure the programs are executed from the right directory so
+    # 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-teeworlds"
+cd "$out/share/${name}" && exec "$out/bin/.wrapped-$program"
 EOF
-    chmod +x "$out/bin/teeworlds"
+      chmod -v +x "$out/bin/$program"
+    done
 
+    # Copy the documentation.
     ensureDir "$out/doc/${name}"
     cp -v *.txt "$out/doc/${name}"
   '';