Unverified Commit 415a5dd3 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

python312Packages.openslide: init at 1.3.1 (#350823)

parents cb8162b2 bec88bb0
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  openslide,
  pillow,
  pytestCheckHook,
  pythonOlder,
}:

buildPythonPackage rec {
  pname = "openslide";
  version = "1.3.1";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "openslide";
    repo = "openslide-python";
    rev = "refs/tags/v${version}";
    hash = "sha256-GokWpRuon8lnxNzxsYGYrQBQDhGPxl8HDaO7fR+2Ldo=";
  };

  postPatch = ''
    substituteInPlace openslide/lowlevel.py \
      --replace-fail "return cdll.LoadLibrary(name)" "return cdll.LoadLibrary(f'${lib.getLib openslide}/lib/{name}')"
  '';

  build-system = [ setuptools ];

  dependencies = [ pillow ];

  pythonImportsCheck = [ "openslide" ];

  nativeCheckInputs = [ pytestCheckHook ];

  preCheck = ''rm -rf openslide/'';

  meta = {
    description = "Python bindings to the OpenSlide library for reading whole-slide microscopy images";
    homepage = "https://github.com/openslide/openslide-python";
    changelog = "https://github.com/openslide/openslide-python/blob/${src.rev}/CHANGELOG.md";
    license = lib.licenses.lgpl21Only;
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -9415,6 +9415,8 @@ self: super: with self; {
  opensimplex = callPackage ../development/python-modules/opensimplex { };
  openslide = callPackage ../development/python-modules/openslide { inherit (pkgs) openslide; };
  openstackdocstheme = callPackage ../development/python-modules/openstackdocstheme { };
  openstacksdk = callPackage ../development/python-modules/openstacksdk { };