biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pyeclib / default.nix
blobd1fec776478433002fa68847f6955dba8823d5c7
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.1";
16   pyproject = true;
18   src = fetchFromGitHub {
19     owner = "openstack";
20     repo = "pyeclib";
21     rev = "refs/tags/${version}";
22     hash = "sha256-pa3majZ68+DQGtgGCpZVRshof+w9jvpxreo4dkckLXk=";
23   };
25   postPatch = ''
26     # patch dlopen call
27     substituteInPlace src/c/pyeclib_c/pyeclib_c.c \
28       --replace-fail "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so"
30     # python's platform.platform() doesn't return "Darwin" (anymore?)
31     substituteInPlace setup.py \
32       --replace-fail '"Darwin"' '"macOS"'
33   '';
35   build-system = [
36     distutils
37     setuptools
38   ];
40   preBuild =
41     let
42       ldLibraryPathEnvName =
43         if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
44     in
45     ''
46       # required for the custom _find_library function in setup.py
47       export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}"
48     '';
50   dependencies = [ liberasurecode ];
52   nativeCheckInputs = [
53     pytestCheckHook
54     six
55   ];
57   pythonImportsCheck = [ "pyeclib" ];
59   meta = with lib; {
60     description = "This library provides a simple Python interface for implementing erasure codes";
61     homepage = "https://github.com/openstack/pyeclib";
62     license = licenses.bsd2;
63     maintainers = teams.openstack.members;
64   };