Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 pytestCheckHook, 7 cmake, 8 ninja, 9 scikit-build-core, 10 charls, 11 eigen, 12 fmt, 13 numpy, 14 pillow, 15 pybind11, 16 setuptools, 17 pathspec, 18 pyproject-metadata, 19 setuptools-scm, 20}: 21 22buildPythonPackage rec { 23 pname = "pillow-jpls"; 24 version = "1.3.2"; 25 pyproject = true; 26 27 disabled = pythonOlder "3.7"; 28 29 src = fetchFromGitHub { 30 owner = "planetmarshall"; 31 repo = "pillow-jpls"; 32 tag = "v${version}"; 33 hash = "sha256-Rc4/S8BrYoLdn7eHDBaoUt1Qy+h0TMAN5ixCAuRmfPU="; 34 }; 35 36 env.SETUPTOOLS_SCM_PRETEND_VERSION = version; 37 38 dontUseCmakeConfigure = true; 39 40 postPatch = '' 41 substituteInPlace pyproject.toml \ 42 --replace-fail '"conan~=2.0.16",' "" \ 43 --replace-fail '"pybind11~=2.11.1",' '"pybind11",' 44 ''; 45 46 build-system = [ 47 cmake 48 ninja 49 pybind11 50 scikit-build-core 51 setuptools 52 setuptools-scm 53 ]; 54 55 buildInputs = [ 56 charls 57 eigen 58 fmt 59 ]; 60 61 dependencies = [ 62 numpy 63 pillow 64 pathspec 65 pyproject-metadata 66 ]; 67 68 pypaBuildFlags = [ 69 "-C" 70 "cmake.args=--preset=sysdeps" 71 ]; 72 73 nativeCheckInputs = [ pytestCheckHook ]; 74 75 # Prevent importing from build during test collection: 76 preCheck = ''rm -rf pillow_jpls''; 77 78 pythonImportsCheck = [ "pillow_jpls" ]; 79 80 meta = with lib; { 81 description = "JPEG-LS plugin for the Python Pillow library"; 82 homepage = "https://github.com/planetmarshall/pillow-jpls"; 83 changelog = "https://github.com/planetmarshall/pillow-jpls/releases/tag/v${version}"; 84 license = licenses.bsd3; 85 maintainers = with maintainers; [ bcdarwin ]; 86 }; 87}