nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at r-updates 57 lines 1.2 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pytestCheckHook, 6 flit-core, 7 numpy, 8 pydicom, 9 pylibjpeg-data, 10 pylibjpeg-libjpeg, 11 pylibjpeg-openjpeg, 12 pylibjpeg-rle, 13}: 14 15buildPythonPackage rec { 16 pname = "pylibjpeg"; 17 version = "2.1.0"; 18 pyproject = true; 19 20 src = fetchFromGitHub { 21 owner = "pydicom"; 22 repo = "pylibjpeg"; 23 tag = "v${version}"; 24 hash = "sha256-jMdNzruzr2VgEntFF5BBoK3yrq0VegtJNXAkCpHjsks="; 25 }; 26 27 build-system = [ flit-core ]; 28 29 dependencies = [ numpy ]; 30 31 optional-dependencies = 32 let 33 extras = { 34 libjpeg = [ pylibjpeg-libjpeg ]; 35 openjpeg = [ pylibjpeg-openjpeg ]; 36 rle = [ pylibjpeg-rle ]; 37 }; 38 in 39 extras // { all = lib.concatLists (lib.attrValues extras); }; 40 41 nativeCheckInputs = [ 42 pytestCheckHook 43 pydicom 44 pylibjpeg-data 45 pylibjpeg-libjpeg 46 ]; 47 48 pythonImportsCheck = [ "pylibjpeg" ]; 49 50 meta = { 51 description = "Python framework for decoding JPEG images, with a focus on supporting Pydicom"; 52 homepage = "https://github.com/pydicom/pylibjpeg"; 53 changelog = "https://github.com/pydicom/pylibjpeg/releases/tag/v${version}"; 54 license = lib.licenses.mit; 55 maintainers = with lib.maintainers; [ bcdarwin ]; 56 }; 57}