about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyeclib/default.nix
blob: 2c4169ea73cacf07534898b686fc7ddcf30b4e5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lib, buildPythonPackage, fetchPypi, liberasurecode, six }:

buildPythonPackage rec {
  pname = "pyeclib";
  version = "1.6.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-gBHjHuia5/uZymkWZgyH4BCEZqmWK9SXowAQIJdOO7E=";
  };

  postPatch = ''
    # patch dlopen call
    substituteInPlace src/c/pyeclib_c/pyeclib_c.c \
      --replace "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so"
  '';

  preBuild = ''
    # required for the custom find_library function in setup.py
    export LD_LIBRARY_PATH="${lib.makeLibraryPath [ liberasurecode ]}"
  '';

  buildInputs = [ liberasurecode ];

  checkInputs = [ six ];

  pythonImportsCheck = [ "pyeclib" ];

  meta = with lib; {
    description = "This library provides a simple Python interface for implementing erasure codes.";
    homepage = "https://github.com/openstack/pyeclib";
    license = licenses.bsd2;
    maintainers = teams.openstack.members;
  };
}