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