1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 cargo, 6 rustPlatform, 7 rustc, 8 numpy, 9 pydicom, 10 pylibjpeg-data, 11 pytestCheckHook, 12}: 13 14buildPythonPackage rec { 15 pname = "pylibjpeg-rle"; 16 version = "2.2.0"; 17 pyproject = true; 18 19 src = fetchFromGitHub { 20 owner = "pydicom"; 21 repo = "pylibjpeg-rle"; 22 tag = "v${version}"; 23 hash = "sha256-hAtseH4akBCKhlWsPGXeQRYUK0BiytFrLFCmeg7nUXY="; 24 }; 25 26 cargoDeps = rustPlatform.fetchCargoVendor { 27 inherit pname version src; 28 hash = "sha256-QprjrR/AelrC+6n7uWZicO9QH0OAJCR7DSE1JuQOMCI="; 29 }; 30 31 build-system = [ 32 cargo 33 rustPlatform.cargoSetupHook 34 rustPlatform.maturinBuildHook 35 rustc 36 ]; 37 38 dependencies = [ 39 numpy 40 ]; 41 42 nativeCheckInputs = [ 43 pydicom 44 pylibjpeg-data 45 pytestCheckHook 46 ]; 47 48 preCheck = '' 49 mv rle/tests . 50 rm -r rle 51 ''; 52 53 pythonImportsCheck = [ 54 "rle" 55 "rle.rle" 56 "rle.utils" 57 ]; 58 59 meta = { 60 description = "Fast DICOM RLE plugin for pylibjpeg"; 61 homepage = "https://github.com/pydicom/pylibjpeg-rle"; 62 changelog = "https://github.com/pydicom/pylibjpeg-rle/releases/tag/${src.tag}"; 63 license = lib.licenses.mit; 64 maintainers = with lib.maintainers; [ bcdarwin ]; 65 }; 66}