pygame: fix for python 3

This commit is contained in:
Nikolay Amiantov 2016-05-23 04:35:07 +03:00
parent 2964212b45
commit e072200d18

View File

@ -1,9 +1,10 @@
{ stdenv, fetchurl, buildPythonPackage, pkgconfig, smpeg, libX11 { stdenv, lib, fetchurl, buildPythonPackage, python, smpeg, libX11
, SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg, portmidi, isPy3k, , SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg, portmidi, isPy3k,
}: }:
buildPythonPackage { buildPythonPackage rec {
name = "pygame-1.9.1"; name = "pygame-${version}";
version = "1.9.1";
src = fetchurl { src = fetchurl {
url = "http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz"; url = "http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz";
@ -11,30 +12,35 @@ buildPythonPackage {
}; };
buildInputs = [ buildInputs = [
pkgconfig SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg
smpeg portmidi libX11 smpeg portmidi libX11
]; ];
# /nix/store/94kswjlwqnc0k2bnwgx7ckx0w2kqzaxj-stdenv/setup: line 73: python: command not found
disabled = isPy3k;
# Tests fail because of no audio device and display. # Tests fail because of no audio device and display.
doCheck = false; doCheck = false;
patches = [ ./pygame-v4l.patch ]; patches = [ ./pygame-v4l.patch ];
preConfigure = stdenv.lib.concatMapStrings (dep: '' preConfigure = ''
sed \ sed \
-e "/origincdirs =/a'${dep.dev or dep.out}/include'," \ -e "s/^origincdirs = .*/origincdirs = []/" \
-e "/origlibdirs =/aoriglibdirs += '${dep.lib or dep.out}/lib'," \ -e "s/^origlibdirs = .*/origlibdirs = []/" \
-e "/\/include\/smpeg/d" \
-i config_unix.py -i config_unix.py
'') [ SDL_image SDL_mixer SDL_ttf libpng libjpeg portmidi libX11 ] + '' ${lib.concatMapStrings (dep: ''
LOCALBASE=/ python config.py sed \
-e "/^origincdirs =/aorigincdirs += ['${lib.getDev dep}/include']" \
-e "/^origlibdirs =/aoriglibdirs += ['${lib.getLib dep}/lib']" \
-i config_unix.py
'') buildInputs
}
LOCALBASE=/ ${python.interpreter} config.py
''; '';
meta = { meta = with stdenv.lib; {
description = "Python library for games"; description = "Python library for games";
homepage = "http://www.pygame.org/"; homepage = "http://www.pygame.org/";
license = stdenv.lib.licenses.lgpl21Plus; license = licenses.lgpl21Plus;
platforms = platforms.linux;
}; };
} }