python313Packages.kivy: fix build

This commit is contained in:
Weijia Wang
2025-01-09 00:37:41 +01:00
parent 53ae2f054b
commit 462ef7ad82
2 changed files with 23 additions and 24 deletions
@@ -4,29 +4,27 @@
buildPythonPackage,
fetchFromGitHub,
pkg-config,
cython_0,
cython,
docutils,
setuptools,
kivy-garden,
mtdev,
SDL2,
SDL2_image,
SDL2_ttf,
SDL2_mixer,
Accelerate,
ApplicationServices,
AVFoundation,
libcxx,
withGstreamer ? true,
gst_all_1,
packaging,
pillow,
pygments,
requests,
filetype,
}:
buildPythonPackage rec {
pname = "kivy";
version = "2.3.1";
pyproject = true;
src = fetchFromGitHub {
owner = "kivy";
@@ -35,10 +33,13 @@ buildPythonPackage rec {
hash = "sha256-q8BoF/pUTW2GMKBhNsqWDBto5+nASanWifS9AcNRc8Q=";
};
build-system = [
setuptools
cython
];
nativeBuildInputs = [
pkg-config
cython_0
docutils
];
buildInputs =
@@ -51,12 +52,6 @@ buildPythonPackage rec {
++ lib.optionals stdenv.hostPlatform.isLinux [
mtdev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
Accelerate
ApplicationServices
AVFoundation
libcxx
]
++ lib.optionals withGstreamer (
with gst_all_1;
[
@@ -68,12 +63,12 @@ buildPythonPackage rec {
]
);
propagatedBuildInputs = [
dependencies = [
kivy-garden
packaging
pillow
docutils
pygments
requests
filetype
];
KIVY_NO_CONFIG = 1;
@@ -91,10 +86,16 @@ buildPythonPackage rec {
]
);
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace kivy/lib/mtdev.py \
--replace "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
'';
postPatch =
''
substituteInPlace pyproject.toml \
--replace-fail "setuptools~=69.2.0" "setuptools" \
--replace-fail "wheel~=0.44.0" "wheel"
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace kivy/lib/mtdev.py \
--replace-fail "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
'';
/*
We cannot run tests as Kivy tries to import itself before being fully
+1 -3
View File
@@ -6996,9 +6996,7 @@ self: super: with self; {
kitchen = callPackage ../development/python-modules/kitchen { };
kivy = callPackage ../development/python-modules/kivy {
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate ApplicationServices AVFoundation;
};
kivy = callPackage ../development/python-modules/kivy { };
kivy-garden = callPackage ../development/python-modules/kivy-garden { };