2010-12-22 11:46:33 +01:00
|
|
|
{stdenv, fetchurl, python, pil, pygame, SDL} @ args: with args;
|
2008-01-30 18:20:48 +01:00
|
|
|
stdenv.mkDerivation {
|
2007-08-09 20:11:57 +02:00
|
|
|
name = "thePenguinMachine";
|
|
|
|
|
2008-01-30 18:20:48 +01:00
|
|
|
src = fetchurl {
|
2007-08-09 20:11:57 +02:00
|
|
|
url = http://www.migniot.com/matrix/projects/thepenguinmachine/ThePenguinMachine.tar.gz;
|
|
|
|
sha256 = "09ljks8vj75g00h3azc83yllbfsrxwmv1c9g32gylcmsshik0dqv";
|
|
|
|
};
|
|
|
|
|
2010-12-22 11:46:33 +01:00
|
|
|
buildInputs = [python pil pygame SDL];
|
2007-08-09 20:11:57 +02:00
|
|
|
|
2010-12-22 11:46:33 +01:00
|
|
|
configurePhase = ''
|
|
|
|
sed -e "/includes = /aincludes.append('${SDL}/include/SDL')" -i setup.py;
|
|
|
|
sed -e "/includes = /aincludes.append('$(echo ${pygame}/include/python*)')" -i setup.py;
|
2007-08-09 20:11:57 +02:00
|
|
|
cat setup.py;
|
2010-12-22 11:46:33 +01:00
|
|
|
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
|
2007-08-09 20:11:57 +02:00
|
|
|
python setup.py build;
|
|
|
|
python setup.py build_clib;
|
|
|
|
python setup.py build_ext;
|
|
|
|
python setup.py build_py;
|
|
|
|
python setup.py build_scripts;
|
2010-12-22 11:46:33 +01:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
python setup.py install --prefix=$out
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out"/share/tpm/
|
2010-12-22 11:46:33 +01:00
|
|
|
cp -r . "$out"/share/tpm/build-dir
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/bin"
|
2010-12-22 11:46:33 +01:00
|
|
|
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"
|
|
|
|
'';
|
2007-08-09 20:11:57 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "
|
|
|
|
The Penguin Machine - an Incredible Machine clone.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
}
|