2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, numpy
|
|
|
|
, scikitimage
|
|
|
|
, openjpeg
|
|
|
|
, procps
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, contextlib2
|
|
|
|
, mock
|
|
|
|
, importlib-resources
|
|
|
|
, isPy27
|
2021-12-06 16:07:01 +00:00
|
|
|
, lxml
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "glymur";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "0.9.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "quintusdias";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "1xlpax56qg5qqh0s19xidgvv2483sc684zj7rh6zw1m1z9m37drr";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optional isPy27 [ contextlib2 mock importlib-resources ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
scikitimage
|
|
|
|
procps
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
2021-12-06 16:07:01 +00:00
|
|
|
lxml
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace glymur/config.py \
|
2021-05-20 23:08:51 +00:00
|
|
|
--replace "path = read_config_file(libname)" "path = '${openjpeg}/lib/lib' + libname + ${if stdenv.isDarwin then "'.dylib'" else "'.so'"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tools for accessing JPEG2000 files";
|
|
|
|
homepage = "https://github.com/quintusdias/glymur";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|