2019-02-20 20:27:31 +01:00
|
|
|
{ lib, fetchPypi, buildPythonPackage, python, pkg-config, libX11
|
2017-03-17 08:34:25 +01:00
|
|
|
, SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg, portmidi, freetype
|
2013-06-09 06:12:15 +02:00
|
|
|
}:
|
2008-10-07 00:07:53 +02:00
|
|
|
|
2016-05-23 03:35:07 +02:00
|
|
|
buildPythonPackage rec {
|
2017-05-27 11:25:35 +02:00
|
|
|
pname = "pygame";
|
2019-05-30 08:49:52 +02:00
|
|
|
version = "1.9.6";
|
2007-08-09 19:33:18 +02:00
|
|
|
|
2019-02-20 20:27:31 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-05-30 08:49:52 +02:00
|
|
|
sha256 = "301c6428c0880ecd4a9e3951b80e539c33863b6ff356a443db1758de4f297957";
|
2007-08-09 19:33:18 +02:00
|
|
|
};
|
|
|
|
|
2019-02-20 20:27:31 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config SDL
|
|
|
|
];
|
|
|
|
|
2013-06-09 06:12:15 +02:00
|
|
|
buildInputs = [
|
2016-05-23 03:35:07 +02:00
|
|
|
SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg
|
2017-03-17 08:34:25 +01:00
|
|
|
portmidi libX11 freetype
|
2013-06-09 06:12:15 +02:00
|
|
|
];
|
|
|
|
|
2016-04-15 05:35:11 +02:00
|
|
|
# Tests fail because of no audio device and display.
|
|
|
|
doCheck = false;
|
2013-06-09 06:12:15 +02:00
|
|
|
|
2016-05-23 03:35:07 +02:00
|
|
|
preConfigure = ''
|
2016-04-15 05:35:11 +02:00
|
|
|
sed \
|
2019-05-03 22:30:04 +02:00
|
|
|
-e "s/origincdirs = .*/origincdirs = []/" \
|
|
|
|
-e "s/origlibdirs = .*/origlibdirs = []/" \
|
|
|
|
-e "/'\/lib\/i386-linux-gnu', '\/lib\/x86_64-linux-gnu']/d" \
|
2016-05-23 03:35:07 +02:00
|
|
|
-e "/\/include\/smpeg/d" \
|
2019-05-03 22:30:04 +02:00
|
|
|
-i buildconfig/config_unix.py
|
2016-05-23 03:35:07 +02:00
|
|
|
${lib.concatMapStrings (dep: ''
|
|
|
|
sed \
|
2019-05-03 22:30:04 +02:00
|
|
|
-e "/origincdirs =/a\ origincdirs += ['${lib.getDev dep}/include']" \
|
|
|
|
-e "/origlibdirs =/a\ origlibdirs += ['${lib.getLib dep}/lib']" \
|
|
|
|
-i buildconfig/config_unix.py
|
2016-05-23 03:35:07 +02:00
|
|
|
'') buildInputs
|
|
|
|
}
|
2019-05-03 22:30:04 +02:00
|
|
|
LOCALBASE=/ ${python.interpreter} buildconfig/config.py
|
2008-10-07 00:07:53 +02:00
|
|
|
'';
|
2007-08-09 19:33:18 +02:00
|
|
|
|
2019-02-20 20:27:31 +01:00
|
|
|
meta = with lib; {
|
2009-03-03 14:27:40 +01:00
|
|
|
description = "Python library for games";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.pygame.org/";
|
2016-05-23 03:35:07 +02:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.linux;
|
2007-08-09 19:33:18 +02:00
|
|
|
};
|
|
|
|
}
|