pygame: fix build, add all deps, use buildPythonPackage

This commit is contained in:
Domen Kožar 2014-11-26 21:50:48 +01:00
parent 3ff9a7507a
commit 9047f389bf

View file

@ -1,8 +1,8 @@
{ stdenv, fetchurl, python, pkgconfig
, SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg
{ stdenv, fetchurl, buildPythonPackage, pkgconfig, smpeg, libX11
, SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg, portmidi
}:
stdenv.mkDerivation {
buildPythonPackage {
name = "pygame-1.9.1";
src = fetchurl {
@ -11,24 +11,21 @@ stdenv.mkDerivation {
};
buildInputs = [
python pkgconfig SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg
pkgconfig SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg
smpeg portmidi libX11
];
patches = [ ./pygame-v4l.patch ];
configurePhase = ''
for i in ${SDL_image} ${SDL_mixer} ${SDL_ttf} ${libpng} ${libjpeg}; do
preConfigure = ''
for i in ${SDL_image} ${SDL_mixer} ${SDL_ttf} ${libpng} ${libjpeg} ${portmidi} ${libX11}; do
sed -e "/origincdirs =/a'$i/include'," -i config_unix.py
sed -e "/origlibdirs =/aoriglibdirs += '$i/lib'," -i config_unix.py
done
yes Y | LOCALBASE=/ python config.py
LOCALBASE=/ python config.py
'';
buildPhase = "python setup.py build";
installPhase = "python setup.py install --prefix=$out";
meta = {
description = "Python library for games";
homepage = "http://www.pygame.org/";