1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 pytestCheckHook, 7 cython, 8 poetry-core, 9 setuptools, 10 numpy, 11 pydicom, 12 pylibjpeg-data, 13 pylibjpeg, 14 libjpeg-tools, 15}: 16 17let 18 self = buildPythonPackage { 19 pname = "pylibjpeg-libjpeg"; 20 version = "2.3.0"; 21 pyproject = true; 22 23 disabled = pythonOlder "3.9"; 24 25 src = fetchFromGitHub { 26 owner = "pydicom"; 27 repo = "pylibjpeg-libjpeg"; 28 tag = "v${self.version}"; 29 hash = "sha256-P01pofPLTOa5ynsCkLnxiMzVfCg4tbT+/CcpPTeSViw="; 30 }; 31 32 postPatch = '' 33 substituteInPlace pyproject.toml \ 34 --replace-fail 'poetry-core >=1.8,<2' 'poetry-core' 35 rmdir lib/libjpeg 36 cp -r ${libjpeg-tools.src} lib/libjpeg 37 chmod u+w lib/libjpeg 38 ''; 39 40 build-system = [ 41 cython 42 poetry-core 43 setuptools 44 ]; 45 46 dependencies = [ numpy ]; 47 48 nativeCheckInputs = [ 49 pydicom 50 pylibjpeg-data 51 pylibjpeg 52 pytestCheckHook 53 ]; 54 55 doCheck = false; # circular test dependency with `pylibjpeg` and `pydicom` 56 57 passthru.tests.check = self.overridePythonAttrs (_: { 58 doCheck = true; 59 }); 60 61 pythonImportsCheck = [ "libjpeg" ]; 62 63 meta = { 64 description = "JPEG, JPEG-LS and JPEG XT plugin for pylibjpeg"; 65 homepage = "https://github.com/pydicom/pylibjpeg-libjpeg"; 66 changelog = "https://github.com/pydicom/pylibjpeg-libjpeg/releases/tag/v${self.version}"; 67 license = lib.licenses.gpl3Only; 68 maintainers = with lib.maintainers; [ bcdarwin ]; 69 }; 70 }; 71in 72self