2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
|
|
|
cmake,
|
|
|
|
ninja,
|
|
|
|
scikit-build-core,
|
|
|
|
charls,
|
|
|
|
eigen,
|
|
|
|
fmt,
|
|
|
|
numpy,
|
|
|
|
pillow,
|
|
|
|
pybind11,
|
|
|
|
setuptools,
|
|
|
|
pathspec,
|
|
|
|
pyproject-metadata,
|
|
|
|
setuptools-scm,
|
2024-02-29 20:09:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pillow-jpls";
|
|
|
|
version = "1.3.2";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "planetmarshall";
|
|
|
|
repo = "pillow-jpls";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-Rc4/S8BrYoLdn7eHDBaoUt1Qy+h0TMAN5ixCAuRmfPU=";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
postPatch = ''
|
2024-06-05 15:53:02 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail '"conan~=2.0.16",' "" \
|
|
|
|
--replace-fail '"pybind11~=2.11.1",' '"pybind11",'
|
2024-02-29 20:09:43 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [
|
2024-02-29 20:09:43 +00:00
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pybind11
|
|
|
|
scikit-build-core
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
buildInputs = [
|
|
|
|
charls
|
|
|
|
eigen
|
|
|
|
fmt
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
dependencies = [
|
2024-02-29 20:09:43 +00:00
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
pathspec
|
|
|
|
pyproject-metadata
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pypaBuildFlags = [
|
|
|
|
"-C"
|
|
|
|
"cmake.args='--preset=sysdeps'"
|
|
|
|
];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# Prevent importing from build during test collection:
|
2024-02-29 20:09:43 +00:00
|
|
|
preCheck = ''rm -rf pillow_jpls'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pillow_jpls" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "JPEG-LS plugin for the Python Pillow library";
|
2024-02-29 20:09:43 +00:00
|
|
|
homepage = "https://github.com/planetmarshall/pillow-jpls";
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/planetmarshall/pillow-jpls/releases/tag/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|