1{ lib, buildPythonPackage, fetchPypi, liberasurecode, six }:
2
3buildPythonPackage rec {
4 pname = "pyeclib";
5 version = "1.6.0";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "sha256-gBHjHuia5/uZymkWZgyH4BCEZqmWK9SXowAQIJdOO7E=";
10 };
11
12 postPatch = ''
13 # patch dlopen call
14 substituteInPlace src/c/pyeclib_c/pyeclib_c.c \
15 --replace "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so"
16 '';
17
18 preBuild = ''
19 # required for the custom find_library function in setup.py
20 export LD_LIBRARY_PATH="${lib.makeLibraryPath [ liberasurecode ]}"
21 '';
22
23 buildInputs = [ liberasurecode ];
24
25 checkInputs = [ six ];
26
27 pythonImportsCheck = [ "pyeclib" ];
28
29 meta = with lib; {
30 description = "This library provides a simple Python interface for implementing erasure codes.";
31 homepage = "https://github.com/openstack/pyeclib";
32 license = licenses.bsd2;
33 maintainers = teams.openstack.members;
34 };
35}