nixpkgs/pkgs/development/python-modules/glymur/default.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

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