2 , buildPythonPackage, fetchFromGitHub, fetchpatch
3 , pkg-config, cython_0, docutils
5 , mesa, mtdev, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer
6 , Accelerate, ApplicationServices, AVFoundation, libcxx
9 , packaging, pillow, pygments, requests
12 buildPythonPackage rec {
16 src = fetchFromGitHub {
20 hash = "sha256-QJ490vjpEj/JSE9OzSvDpkCruaTFdlThUHIEAMm0BZ4=";
34 ] ++ lib.optionals stdenv.isLinux [
37 ] ++ lib.optionals stdenv.isDarwin [
42 ] ++ lib.optionals withGstreamer (with gst_all_1; [
43 # NOTE: The degree to which gstreamer actually works is unclear
50 propagatedBuildInputs = [
61 # prefer pkg-config over hardcoded framework paths
62 USE_OSX_FRAMEWORKS = 0;
63 # work around python distutils compiling C++ with $CC (see issue #26709)
64 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
66 postPatch = lib.optionalString stdenv.isLinux ''
67 substituteInPlace kivy/lib/mtdev.py \
68 --replace "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
72 We cannot run tests as Kivy tries to import itself before being fully
76 pythonImportsCheck = [ "kivy" ];
79 description = "Library for rapid development of hardware-accelerated multitouch applications.";
80 homepage = "https://pypi.python.org/pypi/kivy";
81 license = licenses.mit;
82 maintainers = with maintainers; [ risson ];