1{ lib 2, stdenv 3, buildPythonPackage 4, fetchFromGitHub 5, setuptools 6, pyaudio 7, numpy 8, libsndfile 9, substituteAll 10}: 11 12buildPythonPackage rec { 13 pname = "wavefile"; 14 version = "1.5"; 15 16 src = fetchFromGitHub { 17 owner = "vokimon"; 18 repo = "python-wavefile"; 19 rev = "python-wavefile-${version}"; 20 sha256 = "9sHj1gb93mCVpejRGSdLJzeFDCeTflZctE7kMWfqFrE="; 21 }; 22 23 nativeBuildInputs = [ 24 setuptools 25 ]; 26 27 buildInputs = [ 28 pyaudio 29 libsndfile 30 ]; 31 32 propagatedBuildInputs = [ 33 numpy 34 ]; 35 36 nativeCheckInputs = [ 37 pyaudio 38 numpy 39 libsndfile 40 ]; 41 42 patches = [ 43 # Fix check error 44 # OSError: libsndfile.so.1: cannot open shared object file: No such file or directory 45 (substituteAll { 46 src = ./libsndfile.py.patch; 47 libsndfile = "${lib.getLib libsndfile}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}"; 48 }) 49 ]; 50 51 doCheck = false; # all test files (test/wavefileTest.py) are failing 52 53 pythonImportsCheck = [ 54 "wavefile" 55 ]; 56 57 meta = with lib; { 58 description = "Pythonic libsndfile wrapper to read and write audio files"; 59 homepage = "https://github.com/vokimon/python-wavefile"; 60 changelog = "https://github.com/vokimon/python-wavefile#version-history"; 61 maintainers = with maintainers; [ yuu ]; 62 license = licenses.gpl3Plus; 63 }; 64}