2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pkg-config,
|
|
|
|
cython_0,
|
|
|
|
docutils,
|
|
|
|
kivy-garden,
|
|
|
|
mesa,
|
|
|
|
mtdev,
|
|
|
|
SDL2,
|
|
|
|
SDL2_image,
|
|
|
|
SDL2_ttf,
|
|
|
|
SDL2_mixer,
|
|
|
|
Accelerate,
|
|
|
|
ApplicationServices,
|
|
|
|
AVFoundation,
|
|
|
|
libcxx,
|
|
|
|
withGstreamer ? true,
|
|
|
|
gst_all_1,
|
|
|
|
packaging,
|
|
|
|
pillow,
|
|
|
|
pygments,
|
|
|
|
requests,
|
2021-02-19 19:06:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "kivy";
|
|
|
|
version = "2.3.0";
|
2021-02-19 19:06:45 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kivy";
|
|
|
|
repo = "kivy";
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-QJ490vjpEj/JSE9OzSvDpkCruaTFdlThUHIEAMm0BZ4=";
|
2021-02-19 19:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2024-04-21 15:54:59 +00:00
|
|
|
cython_0
|
2021-02-19 19:06:45 +00:00
|
|
|
docutils
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
SDL2
|
|
|
|
SDL2_image
|
|
|
|
SDL2_ttf
|
|
|
|
SDL2_mixer
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
mesa
|
|
|
|
mtdev
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
Accelerate
|
|
|
|
ApplicationServices
|
|
|
|
AVFoundation
|
|
|
|
libcxx
|
|
|
|
]
|
|
|
|
++ lib.optionals withGstreamer (
|
|
|
|
with gst_all_1;
|
|
|
|
[
|
|
|
|
# NOTE: The degree to which gstreamer actually works is unclear
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-bad
|
|
|
|
]
|
|
|
|
);
|
2021-02-19 19:06:45 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
kivy-garden
|
2024-04-21 15:54:59 +00:00
|
|
|
packaging
|
2021-02-19 19:06:45 +00:00
|
|
|
pillow
|
|
|
|
pygments
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
KIVY_NO_CONFIG = 1;
|
|
|
|
KIVY_NO_ARGS = 1;
|
|
|
|
KIVY_NO_FILELOG = 1;
|
2021-10-28 06:52:43 +00:00
|
|
|
# prefer pkg-config over hardcoded framework paths
|
|
|
|
USE_OSX_FRAMEWORKS = 0;
|
|
|
|
# work around python distutils compiling C++ with $CC (see issue #26709)
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
|
2021-02-19 19:06:45 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isLinux ''
|
2021-02-19 19:06:45 +00:00
|
|
|
substituteInPlace kivy/lib/mtdev.py \
|
|
|
|
--replace "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
|
|
|
|
'';
|
|
|
|
|
|
|
|
/*
|
|
|
|
We cannot run tests as Kivy tries to import itself before being fully
|
|
|
|
installed.
|
|
|
|
*/
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "kivy" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library for rapid development of hardware-accelerated multitouch applications";
|
2021-02-19 19:06:45 +00:00
|
|
|
homepage = "https://pypi.python.org/pypi/kivy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ risson ];
|
|
|
|
};
|
|
|
|
}
|