at 23.05-pre 1.3 kB view raw
1{ lib, stdenv, buildPythonPackage, fetchFromGitHub, liberasurecode, six }: 2 3buildPythonPackage rec { 4 pname = "pyeclib"; 5 version = "unstable-2022-03-11"; 6 7 src = fetchFromGitHub { 8 owner = "openstack"; 9 repo = "pyeclib"; 10 rev = "b50040969a03f7566ffcb468336e875d21486113"; 11 sha256 = "sha256-nYYjocStC0q/MC6pum3J4hlXiu/R5xODwIE97Ho3iEY="; 12 }; 13 14 postPatch = '' 15 # patch dlopen call 16 substituteInPlace src/c/pyeclib_c/pyeclib_c.c \ 17 --replace "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so" 18 # python's platform.platform() doesn't return "Darwin" (anymore?) 19 substituteInPlace setup.py \ 20 --replace '"Darwin"' '"macOS"' 21 ''; 22 23 preBuild = let 24 ldLibraryPathEnvName = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; 25 in '' 26 # required for the custom _find_library function in setup.py 27 export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}" 28 ''; 29 30 buildInputs = [ liberasurecode ]; 31 32 checkInputs = [ six ]; 33 34 pythonImportsCheck = [ "pyeclib" ]; 35 36 meta = with lib; { 37 description = "This library provides a simple Python interface for implementing erasure codes."; 38 homepage = "https://github.com/openstack/pyeclib"; 39 license = licenses.bsd2; 40 maintainers = teams.openstack.members; 41 }; 42}