2021-05-03 20:48:10 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, substituteAll
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
|
|
|
, setuptools-scm
|
|
|
|
, pythonRelaxDepsHook
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, packaging
|
|
|
|
|
|
|
|
# native dependencies
|
2021-05-03 20:48:10 +00:00
|
|
|
, portmidi
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# optional-dependencies
|
|
|
|
, pygame
|
2021-05-03 20:48:10 +00:00
|
|
|
, python-rtmidi
|
2024-04-21 15:54:59 +00:00
|
|
|
, rtmidi-python
|
|
|
|
|
|
|
|
# tests
|
2021-05-03 20:48:10 +00:00
|
|
|
, pytestCheckHook
|
2024-01-02 11:29:13 +00:00
|
|
|
, pythonOlder
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mido";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.3.2";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Ouootu1zD3N9WxLaNXjevp3FAFj6Nw/pzt7ZGJtnw0g=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./libportmidi-cdll.patch;
|
2024-01-02 11:29:13 +00:00
|
|
|
libportmidi = "${portmidi.out}/lib/libportmidi${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2020-07-18 16:06:22 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2023-11-16 04:20:00 +00:00
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonRelaxDepsHook
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"packaging"
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
|
|
|
packaging
|
|
|
|
];
|
|
|
|
|
|
|
|
optional-dependencies = {
|
|
|
|
ports-pygame = [ pygame ];
|
|
|
|
ports-rtmidi = [ python-rtmidi ];
|
|
|
|
ports-rtmidi-python = [ rtmidi-python ];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"mido"
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "MIDI Objects for Python";
|
|
|
|
homepage = "https://mido.readthedocs.io";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/mido/mido/releases/tag/${version}";
|
2020-07-18 16:06:22 +00:00
|
|
|
license = licenses.mit;
|
2021-05-03 20:48:10 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|