2016-05-23 01:35:07 +00:00
|
|
|
{ stdenv, lib, fetchurl, buildPythonPackage, python, smpeg, libX11
|
2017-03-17 07:34:25 +00:00
|
|
|
, SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg, portmidi, freetype
|
2013-06-09 04:12:15 +00:00
|
|
|
}:
|
2008-10-06 22:07:53 +00:00
|
|
|
|
2016-05-23 01:35:07 +00:00
|
|
|
buildPythonPackage rec {
|
2017-05-27 09:25:35 +00:00
|
|
|
pname = "pygame";
|
|
|
|
name = "${pname}-${version}";
|
2017-03-17 07:34:25 +00:00
|
|
|
version = "1.9.3";
|
2007-08-09 17:33:18 +00:00
|
|
|
|
2008-01-30 17:20:48 +00:00
|
|
|
src = fetchurl {
|
2017-03-17 07:34:25 +00:00
|
|
|
url = "mirror://pypi/p/pygame/pygame-${version}.tar.gz";
|
|
|
|
sha256 = "1hlydiyygl444bq5m5g8n3jsxsgrdyxlm42ipmfbw36wkf0j243m";
|
2007-08-09 17:33:18 +00:00
|
|
|
};
|
|
|
|
|
2013-06-09 04:12:15 +00:00
|
|
|
buildInputs = [
|
2016-05-23 01:35:07 +00:00
|
|
|
SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg
|
2017-03-17 07:34:25 +00:00
|
|
|
portmidi libX11 freetype
|
2013-06-09 04:12:15 +00:00
|
|
|
];
|
|
|
|
|
2016-04-15 03:35:11 +00:00
|
|
|
# Tests fail because of no audio device and display.
|
|
|
|
doCheck = false;
|
2013-06-09 04:12:15 +00:00
|
|
|
|
2016-05-23 01:35:07 +00:00
|
|
|
preConfigure = ''
|
2016-04-15 03:35:11 +00:00
|
|
|
sed \
|
2016-05-23 01:35:07 +00:00
|
|
|
-e "s/^origincdirs = .*/origincdirs = []/" \
|
|
|
|
-e "s/^origlibdirs = .*/origlibdirs = []/" \
|
|
|
|
-e "/\/include\/smpeg/d" \
|
2016-04-15 03:35:11 +00:00
|
|
|
-i config_unix.py
|
2016-05-23 01:35:07 +00:00
|
|
|
${lib.concatMapStrings (dep: ''
|
|
|
|
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
|
2008-10-06 22:07:53 +00:00
|
|
|
'';
|
2007-08-09 17:33:18 +00:00
|
|
|
|
2016-05-23 01:35:07 +00:00
|
|
|
meta = with stdenv.lib; {
|
2009-03-03 13:27:40 +00:00
|
|
|
description = "Python library for games";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = http://www.pygame.org/;
|
2016-05-23 01:35:07 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.linux;
|
2007-08-09 17:33:18 +00:00
|
|
|
};
|
|
|
|
}
|