2023-01-11 17:05:25 -05:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "charls";
|
2023-05-21 18:22:11 +00:00
|
|
|
version = "2.4.2";
|
2023-01-11 17:05:25 -05:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "team-charls";
|
2025-03-07 01:06:27 +01:00
|
|
|
repo = "charls";
|
2025-01-03 21:24:13 +01:00
|
|
|
tag = version;
|
2023-05-21 18:22:11 +00:00
|
|
|
hash = "sha256-c1wrk6JLcAH7TFPwjARlggaKXrAsLWyUQF/3WHlqoqg=";
|
2023-01-11 17:05:25 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/charls-template.pc \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
|
|
|
|
|
|
|
|
# note this only runs some basic tests, not the full test suite,
|
|
|
|
# but the recommended `charlstest -unittest` fails with an inscrutable C++ IO error
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/team-charls/charls";
|
|
|
|
description = "JPEG-LS library implementation in C++";
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|