at 25.11-pre 1.5 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 cython, 8 setuptools, 9 10 # nativeBuildInputs 11 pkg-config, 12 13 # buildInputs 14 libraw, 15 16 # dependencies 17 numpy, 18 19 # tests 20 imageio, 21 pytestCheckHook, 22 scikit-image, 23}: 24 25buildPythonPackage rec { 26 pname = "rawpy"; 27 version = "0.24.0"; 28 pyproject = true; 29 30 src = fetchFromGitHub { 31 owner = "letmaik"; 32 repo = "rawpy"; 33 tag = "v${version}"; 34 hash = "sha256-u/KWbviyhbMts40Gc/9shXSESwihWZQQaf3Z44gMgvs="; 35 }; 36 37 build-system = [ 38 cython 39 numpy 40 setuptools 41 ]; 42 43 nativeBuildInputs = [ 44 pkg-config 45 ]; 46 47 buildInputs = [ 48 libraw 49 ]; 50 51 dependencies = [ 52 numpy 53 ]; 54 55 env = { 56 RAWPY_USE_SYSTEM_LIBRAW = 1; 57 }; 58 59 pythonImportsCheck = [ 60 "rawpy" 61 "rawpy._rawpy" 62 ]; 63 64 # Delete the source files to load the library from the installed folder instead of the source files 65 preCheck = '' 66 rm -rf rawpy 67 ''; 68 69 nativeCheckInputs = [ 70 imageio 71 pytestCheckHook 72 scikit-image 73 ]; 74 75 disabledTests = [ 76 # rawpy._rawpy.LibRawFileUnsupportedError: b'Unsupported file format or not RAW file' 77 "testFoveonFileOpenAndPostProcess" 78 "testThumbExtractBitmap" 79 ]; 80 81 meta = { 82 description = "RAW image processing for Python, a wrapper for libraw"; 83 homepage = "https://github.com/letmaik/rawpy"; 84 license = with lib.licenses; [ 85 lgpl21Only 86 mit 87 ]; 88 maintainers = with lib.maintainers; [ GaetanLepage ]; 89 }; 90}