2020-04-24 23:36:52 +00:00
|
|
|
{ lib, fetchPypi, buildPythonPackage, python, pkg-config, libX11
|
2020-12-09 12:39:15 +00:00
|
|
|
, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, libpng, libjpeg, portmidi, freetype
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygame";
|
2020-12-26 04:20:00 +00:00
|
|
|
version = "2.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-26 04:20:00 +00:00
|
|
|
sha256 = "8b1e7b63f47aafcdd8849933b206778747ef1802bd3d526aca45ed77141e4001";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-12-09 12:39:15 +00:00
|
|
|
pkg-config SDL2
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-12-09 12:39:15 +00:00
|
|
|
SDL2 SDL2_image SDL2_mixer SDL2_ttf libpng libjpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
portmidi libX11 freetype
|
|
|
|
];
|
|
|
|
|
|
|
|
# Tests fail because of no audio device and display.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed \
|
|
|
|
-e "s/origincdirs = .*/origincdirs = []/" \
|
|
|
|
-e "s/origlibdirs = .*/origlibdirs = []/" \
|
2020-12-09 12:39:15 +00:00
|
|
|
-e "/linux-gnu/d" \
|
2020-04-24 23:36:52 +00:00
|
|
|
-i buildconfig/config_unix.py
|
|
|
|
${lib.concatMapStrings (dep: ''
|
|
|
|
sed \
|
|
|
|
-e "/origincdirs =/a\ origincdirs += ['${lib.getDev dep}/include']" \
|
|
|
|
-e "/origlibdirs =/a\ origlibdirs += ['${lib.getLib dep}/lib']" \
|
|
|
|
-i buildconfig/config_unix.py
|
|
|
|
'') buildInputs
|
|
|
|
}
|
|
|
|
LOCALBASE=/ ${python.interpreter} buildconfig/config.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for games";
|
|
|
|
homepage = "http://www.pygame.org/";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|