depot/third_party/nixpkgs/pkgs/development/python-modules/glymur/default.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

57 lines
1.2 KiB
Nix

{ lib, stdenv
, buildPythonPackage
, fetchFromGitHub
, numpy
, scikitimage
, openjpeg
, procps
, pytestCheckHook
, contextlib2
, mock
, importlib-resources
, isPy27
, lxml
}:
buildPythonPackage rec {
pname = "glymur";
version = "0.9.3";
src = fetchFromGitHub {
owner = "quintusdias";
repo = pname;
rev = "v${version}";
sha256 = "1xlpax56qg5qqh0s19xidgvv2483sc684zj7rh6zw1m1z9m37drr";
};
propagatedBuildInputs = [
numpy
] ++ lib.optionals isPy27 [ contextlib2 mock importlib-resources ];
checkInputs = [
scikitimage
procps
pytestCheckHook
lxml
];
postConfigure = ''
substituteInPlace glymur/config.py \
--replace "path = read_config_file(libname)" "path = '${openjpeg}/lib/lib' + libname + ${if stdenv.isDarwin then "'.dylib'" else "'.so'"}"
'';
disabledTestPaths = [
# this test involves glymur's different ways of finding the openjpeg path on
# fsh systems by reading an .rc file and such, and is obviated by the patch
# in postConfigure
"tests/test_config.py"
];
meta = with lib; {
description = "Tools for accessing JPEG2000 files";
homepage = "https://github.com/quintusdias/glymur";
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}