summary refs log tree commit diff
path: root/pkgs/games/thePenguinMachine
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2010-12-22 10:46:33 +0000
committerMichael Raskin <7c6f434c@mail.ru>2010-12-22 10:46:33 +0000
commit0e3e7d897681e20b5baafbd19d0d98d3444e6487 (patch)
tree99f95856e92b20f8cc9569f6fd71118778b7a7af /pkgs/games/thePenguinMachine
parent3e5e7b0c74f2cd252bf40860fb89eda6bc98500a (diff)
downloadnixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.tar
nixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.tar.gz
nixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.tar.bz2
nixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.tar.lz
nixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.tar.xz
nixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.tar.zst
nixlib-0e3e7d897681e20b5baafbd19d0d98d3444e6487.zip
buildable/runnable version of the penguin machine
svn path=/nixpkgs/trunk/; revision=25231
Diffstat (limited to 'pkgs/games/thePenguinMachine')
-rw-r--r--pkgs/games/thePenguinMachine/default.nix38
1 files changed, 23 insertions, 15 deletions
diff --git a/pkgs/games/thePenguinMachine/default.nix b/pkgs/games/thePenguinMachine/default.nix
index 4ce42934b5a5..68d44364f598 100644
--- a/pkgs/games/thePenguinMachine/default.nix
+++ b/pkgs/games/thePenguinMachine/default.nix
@@ -1,4 +1,4 @@
-args: with args;
+{stdenv, fetchurl, python, pil, pygame, SDL} @ args: with args;
 stdenv.mkDerivation {
   name = "thePenguinMachine";
 
@@ -7,27 +7,35 @@ stdenv.mkDerivation {
 		sha256 = "09ljks8vj75g00h3azc83yllbfsrxwmv1c9g32gylcmsshik0dqv";
 	};
 
-  buildInputs = [python24 pil pygame SDL];
+  buildInputs = [python pil pygame SDL];
 
-  configurePhase = "
-		sed -e \"/includes = /aincludes.append('${SDL}/include/SDL')\" -i setup.py;
-		sed -e \"/includes = /aincludes.append('${pygame}/include/python2.4')\" -i setup.py;
+  configurePhase = ''
+		sed -e "/includes = /aincludes.append('${SDL}/include/SDL')" -i setup.py;
+		sed -e "/includes = /aincludes.append('$(echo ${pygame}/include/python*)')" -i setup.py;
 		cat setup.py;
-	";
-  buildPhase = "
+		export NIX_LDFLAGS="$NIX_LDFLAGS -lgcc_s"
+	'';
+  buildPhase = ''
+		sed -e "s/pygame.display.toggle_fullscreen.*/pass;/" -i tpm/Application.py
+                sed -e 's@"Surface"@"pygame.Surface"@' -i src/surfutils.c
 		python setup.py build;
 		python setup.py build_clib;
 		python setup.py build_ext;
 		python setup.py build_py;
 		python setup.py build_scripts;
-		";
-  installPhase = "
-		python setup.py install --prefix=\${out}
-		cp -r . /tmp/tpm-build
-		echo 'export PYTHONPATH=$PYTHONPATH:${pygame}/lib/python2.4/site-packages:${pil}/lib/python2.4/site-packages/PIL
-		python ThePenguinMachine.py' >/tmp/tpm-build/tpm.sh; 
-		chmod a+rx /tmp/tpm-build/tpm.sh
-		";
+		'';
+  installPhase = ''
+		python setup.py install --prefix=$out
+		ensureDir "$out"/share/tpm/
+		cp -r .  "$out"/share/tpm/build-dir
+		ensureDir "$out/bin"
+		echo "#! /bin/sh" >> "$out/bin/tpm"
+		echo "export PYTHONPATH=\"\$PYTHONPATH:$PYTHONPATH:$(echo ${pil}/lib/python*/site-packages/PIL)\"" >> "$out/bin/tpm"
+		echo "cd \"$out/share/tpm/build-dir\"" >> "$out/bin/tpm"
+		echo "export PYTHONPATH=\"\$PYTHONPATH:$PYTHONPATH:$(echo ${pil}/lib/python*/site-packages/PIL)\"" >> "$out/bin/tpm"
+		echo "${python}/bin/python \"$out\"/share/tpm/build-dir/ThePenguinMachine.py \"\$@\"" >> "$out/bin/tpm"
+		chmod a+x "$out/bin/tpm"
+		'';
 
   meta = {
     description = "