Unverified Commit 3b8b5540 authored by misuzu's avatar misuzu Committed by GitHub
Browse files

python313Packages.kivy: fix build (#372247)

parents 2c58d3f6 b6c88e8c
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  kivy,
}:

buildPythonPackage {
  pname = "kivy-garden-modernmenu";
  version = "0-unstable-2019-12-10";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "kivy-garden";
    repo = "modernmenu";
    rev = "681c3bf68b9ce2ebe653c2e6a9fcd2407bfe3e00";
    hash = "sha256-0d4UhmRtuYwnYoZajjExavlvqkhGamiEQ8GjHWYnO88=";
  };

  strictDeps = true;

  build-system = [
    setuptools
  ];

  checkInputs = [
    kivy
  ];

  pythonImportsCheck = [
    "kivy_garden.modernmenu"
  ];

  preInstallCheck = ''
    export HOME=$PWD
  '';

  meta = {
    description = "Stylized menu system for Kivy";
    homepage = "https://github.com/kivy-garden/modernmenu";
    license = lib.licenses.mit;
    maintainers = lib.teams.ngi.members;
  };
}
+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')"
    '';

  /*
+3 −3
Original line number Diff line number Diff line
@@ -6993,12 +6993,12 @@ 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 { };
  kivy-garden-modernmenu = callPackage ../development/python-modules/kivy-garden-modernmenu { };
  kiwiki-client = callPackage ../development/python-modules/kiwiki-client { };
  kiwisolver = callPackage ../development/python-modules/kiwisolver { };