Commit 462ef7ad authored by Weijia Wang's avatar Weijia Wang
Browse files

python313Packages.kivy: fix build

parent 53ae2f05
Loading
Loading
Loading
Loading
+22 −21
Original line number Diff line number Diff line
@@ -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,9 +86,15 @@ buildPythonPackage rec {
    ]
  );

  postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
  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 "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
        --replace-fail "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
    '';

  /*
+1 −3
Original line number Diff line number Diff line
@@ -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 { };