ocamlPackages.hxd: 0.3.2 -> 0.3.3 (#364231)
[NixPkgs.git] / pkgs / development / python-modules / pyeclib / default.nix
blob9cad362d224324357b4971da785d522ba8aabbf8
2   lib,
3   stdenv,
4   buildPythonPackage,
5   distutils,
6   fetchFromGitHub,
7   liberasurecode,
8   pytestCheckHook,
9   setuptools,
10   six,
13 buildPythonPackage rec {
14   pname = "pyeclib";
15   version = "1.6.2";
16   pyproject = true;
18   src = fetchFromGitHub {
19     owner = "openstack";
20     repo = "pyeclib";
21     rev = "refs/tags/${version}";
22     hash = "sha256-LZQNJU7QEoHo+RWvHnQkNxBg6t322u/c3PyBhy1eVZc=";
23   };
25   postPatch = ''
26     # python's platform.platform() doesn't return "Darwin" (anymore?)
27     substituteInPlace setup.py \
28       --replace-fail '"Darwin"' '"macOS"'
29   '';
31   build-system = [
32     distutils
33     setuptools
34   ];
36   preBuild =
37     let
38       ldLibraryPathEnvName =
39         if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
40     in
41     ''
42       # required for the custom _find_library function in setup.py
43       export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}"
44     '';
46   dependencies = [ liberasurecode ];
48   nativeCheckInputs = [
49     pytestCheckHook
50     six
51   ];
53   pythonImportsCheck = [ "pyeclib" ];
55   meta = with lib; {
56     description = "This library provides a simple Python interface for implementing erasure codes";
57     homepage = "https://github.com/openstack/pyeclib";
58     license = licenses.bsd2;
59     maintainers = teams.openstack.members;
60   };