python311Packages.mido: fix build, set up optional dependencies

This commit is contained in:
Martin Weinelt 2024-03-27 04:41:58 +01:00
parent 4913815067
commit 97011cdd1c
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
1 changed files with 34 additions and 8 deletions

View File

@ -3,12 +3,27 @@
, buildPythonPackage
, fetchPypi
, substituteAll
, portmidi
, python-rtmidi
, pytestCheckHook
, pythonOlder
# build-system
, setuptools
, setuptools-scm
, pythonRelaxDepsHook
# dependencies
, packaging
# native dependencies
, portmidi
# optional-dependencies
, pygame
, python-rtmidi
, rtmidi-python
# tests
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
@ -20,7 +35,7 @@ buildPythonPackage rec {
src = fetchPypi {
inherit pname version;
sha256 = "sha256-Ouootu1zD3N9WxLaNXjevp3FAFj6Nw/pzt7ZGJtnw0g=";
hash = "sha256-Ouootu1zD3N9WxLaNXjevp3FAFj6Nw/pzt7ZGJtnw0g=";
};
patches = [
@ -30,15 +45,26 @@ buildPythonPackage rec {
})
];
nativeBuildInputs = [
build-system = [
setuptools
setuptools-scm
pythonRelaxDepsHook
];
propagatedBuildInputs = [
python-rtmidi
pythonRelaxDeps = [
"packaging"
];
dependencies = [
packaging
];
optional-dependencies = {
ports-pygame = [ pygame ];
ports-rtmidi = [ python-rtmidi ];
ports-rtmidi-python = [ rtmidi-python ];
};
nativeCheckInputs = [
pytestCheckHook
];