2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
2024-09-19 14:19:46 +00:00
|
|
|
distutils,
|
2024-06-05 15:53:02 +00:00
|
|
|
fetchFromGitHub,
|
|
|
|
liberasurecode,
|
2024-09-19 14:19:46 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
six,
|
|
|
|
}:
|
2021-10-08 15:17:17 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyeclib";
|
2024-10-29 11:11:06 +00:00
|
|
|
version = "1.6.2";
|
2024-09-19 14:19:46 +00:00
|
|
|
pyproject = true;
|
2021-10-08 15:17:17 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openstack";
|
|
|
|
repo = "pyeclib";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-10-29 11:11:06 +00:00
|
|
|
hash = "sha256-LZQNJU7QEoHo+RWvHnQkNxBg6t322u/c3PyBhy1eVZc=";
|
2021-10-08 15:17:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
# python's platform.platform() doesn't return "Darwin" (anymore?)
|
|
|
|
substituteInPlace setup.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail '"Darwin"' '"macOS"'
|
2021-10-08 15:17:17 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [
|
|
|
|
distutils
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
preBuild =
|
|
|
|
let
|
2024-09-26 11:04:55 +00:00
|
|
|
ldLibraryPathEnvName =
|
|
|
|
if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
|
2024-06-05 15:53:02 +00:00
|
|
|
in
|
|
|
|
''
|
|
|
|
# required for the custom _find_library function in setup.py
|
|
|
|
export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}"
|
|
|
|
'';
|
2021-10-08 15:17:17 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [ liberasurecode ];
|
2021-10-08 15:17:17 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
six
|
|
|
|
];
|
2021-10-08 15:17:17 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "pyeclib" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "This library provides a simple Python interface for implementing erasure codes";
|
2021-10-08 15:17:17 +00:00
|
|
|
homepage = "https://github.com/openstack/pyeclib";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = teams.openstack.members;
|
|
|
|
};
|
|
|
|
}
|