nixpkgs/pkgs/development/python-modules/pygame/default.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

{ 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
}:
2016-05-23 03:35:07 +02:00
buildPythonPackage rec {
pname = "pygame";
2019-05-30 08:49:52 +02:00
version = "1.9.6";
src = fetchPypi {
inherit pname version;
2019-05-30 08:49:52 +02:00
sha256 = "301c6428c0880ecd4a9e3951b80e539c33863b6ff356a443db1758de4f297957";
};
nativeBuildInputs = [
pkg-config SDL
];
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
];
# Tests fail because of no audio device and display.
doCheck = false;
2016-05-23 03:35:07 +02:00
preConfigure = ''
sed \
-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" \
-i buildconfig/config_unix.py
2016-05-23 03:35:07 +02:00
${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
2016-05-23 03:35:07 +02:00
'') buildInputs
}
LOCALBASE=/ ${python.interpreter} buildconfig/config.py
'';
meta = with lib; {
description = "Python library for games";
homepage = "http://www.pygame.org/";
2016-05-23 03:35:07 +02:00
license = licenses.lgpl21Plus;
platforms = platforms.linux;
};
}