2 , buildPythonPackage, fetchFromGitHub, fetchpatch
3 , pkg-config, cython, docutils
5 , mesa, mtdev, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer
6 , Accelerate, ApplicationServices, AVFoundation, libcxx
9 , pillow, requests, pygments
12 buildPythonPackage rec {
16 src = fetchFromGitHub {
20 hash = "sha256-k9LIiLtlHY6H1xfVylI/Xbm7R6pCpC5UHe8GWnCwEGA=";
24 # Fixes incompatible function pointer conversion errors with clang 16.
25 # https://github.com/kivy/kivy/pull/8415
27 url = "https://github.com/kivy/kivy/commit/a0ec8ff79fcbc1b82391132a89c8fc21ef1c5c55.patch";
28 hash = "sha256-2Kpkx75uWPiEiEqkOxBKl3HENKUGVHbQV4haeI5Gl3A=";
43 ] ++ lib.optionals stdenv.isLinux [
46 ] ++ lib.optionals stdenv.isDarwin [
51 ] ++ lib.optionals withGstreamer (with gst_all_1; [
52 # NOTE: The degree to which gstreamer actually works is unclear
59 propagatedBuildInputs = [
69 # prefer pkg-config over hardcoded framework paths
70 USE_OSX_FRAMEWORKS = 0;
71 # work around python distutils compiling C++ with $CC (see issue #26709)
72 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
74 postPatch = lib.optionalString stdenv.isLinux ''
75 substituteInPlace kivy/lib/mtdev.py \
76 --replace "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
80 We cannot run tests as Kivy tries to import itself before being fully
84 pythonImportsCheck = [ "kivy" ];
87 description = "Library for rapid development of hardware-accelerated multitouch applications.";
88 homepage = "https://pypi.python.org/pypi/kivy";
89 license = licenses.mit;
90 maintainers = with maintainers; [ risson ];