Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 48 lines 1.2 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 openslide, 7 pillow, 8 pytestCheckHook, 9 pythonOlder, 10}: 11 12buildPythonPackage rec { 13 pname = "openslide"; 14 version = "1.3.1"; 15 pyproject = true; 16 17 disabled = pythonOlder "3.9"; 18 19 src = fetchFromGitHub { 20 owner = "openslide"; 21 repo = "openslide-python"; 22 rev = "refs/tags/v${version}"; 23 hash = "sha256-GokWpRuon8lnxNzxsYGYrQBQDhGPxl8HDaO7fR+2Ldo="; 24 }; 25 26 postPatch = '' 27 substituteInPlace openslide/lowlevel.py \ 28 --replace-fail "return cdll.LoadLibrary(name)" "return cdll.LoadLibrary(f'${lib.getLib openslide}/lib/{name}')" 29 ''; 30 31 build-system = [ setuptools ]; 32 33 dependencies = [ pillow ]; 34 35 pythonImportsCheck = [ "openslide" ]; 36 37 nativeCheckInputs = [ pytestCheckHook ]; 38 39 preCheck = ''rm -rf openslide/''; 40 41 meta = { 42 description = "Python bindings to the OpenSlide library for reading whole-slide microscopy images"; 43 homepage = "https://github.com/openslide/openslide-python"; 44 changelog = "https://github.com/openslide/openslide-python/blob/${src.rev}/CHANGELOG.md"; 45 license = lib.licenses.lgpl21Only; 46 maintainers = with lib.maintainers; [ bcdarwin ]; 47 }; 48}