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

45 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, buildPythonPackage, python, libX11
2017-03-17 07:34:25 +00:00
, SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg, portmidi, freetype
}:
2016-05-23 02:35:07 +01:00
buildPythonPackage rec {
pname = "pygame";
2018-07-22 11:17:24 +01:00
version = "1.9.4";
src = fetchurl {
2017-03-17 07:34:25 +00:00
url = "mirror://pypi/p/pygame/pygame-${version}.tar.gz";
2018-07-22 11:17:24 +01:00
sha256 = "700d1781c999af25d11bfd1f3e158ebb660f72ebccb2040ecafe5069d0b2c0b6";
};
buildInputs = [
2016-05-23 02:35:07 +01:00
SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg
2017-03-17 07:34:25 +00:00
portmidi libX11 freetype
];
# Tests fail because of no audio device and display.
doCheck = false;
2016-05-23 02:35:07 +01:00
preConfigure = ''
sed \
2016-05-23 02:35:07 +01:00
-e "s/^origincdirs = .*/origincdirs = []/" \
-e "s/^origlibdirs = .*/origlibdirs = []/" \
-e "/\/include\/smpeg/d" \
-i config_unix.py
2016-05-23 02:35:07 +01: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
'';
2016-05-23 02:35:07 +01:00
meta = with stdenv.lib; {
description = "Python library for games";
homepage = http://www.pygame.org/;
2016-05-23 02:35:07 +01:00
license = licenses.lgpl21Plus;
platforms = platforms.linux;
};
}