1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 wheel,
7 numpy,
8 fluidsynth,
9 stdenv,
10}:
11
12buildPythonPackage rec {
13 pname = "pyfluidsynth";
14 version = "1.3.3";
15 format = "pyproject";
16
17 src = fetchPypi {
18 pname = "pyFluidSynth";
19 inherit version;
20 hash = "sha256-1Q1LVQc+dYCyo8pHCZK2xRwnnbocVRLchRNVlfQtaIE=";
21 };
22
23 nativeBuildInputs = [
24 setuptools
25 wheel
26 ];
27
28 propagatedBuildInputs = [ numpy ];
29
30 pythonImportsCheck = [ "fluidsynth" ];
31
32 postPatch = ''
33 sed -Ezi fluidsynth.py -e \
34 's|lib = .*\\\n[^\n]*|lib = "${lib.getLib fluidsynth}/lib/libfluidsynth${stdenv.hostPlatform.extensions.sharedLibrary}"|'
35 '';
36
37 meta = with lib; {
38 description = "Python bindings for FluidSynth, a MIDI synthesizer that uses SoundFont instruments";
39 homepage = "https://github.com/nwhitehead/pyfluidsynth";
40 license = licenses.lgpl21Plus;
41 maintainers = with maintainers; [ figsoda ];
42 };
43}