1 { lib, stdenv, fetchFromGitHub, cmake }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "refs/tags/${version}";
11 hash = "sha256-c1wrk6JLcAH7TFPwjARlggaKXrAsLWyUQF/3WHlqoqg=";
15 substituteInPlace src/charls-template.pc \
16 --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
17 --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
20 nativeBuildInputs = [ cmake ];
22 cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
24 # note this only runs some basic tests, not the full test suite,
25 # but the recommended `charlstest -unittest` fails with an inscrutable C++ IO error
29 homepage = "https://github.com/team-charls/charls";
30 description = "A JPEG-LS library implementation in C++";
31 maintainers = with maintainers; [ bcdarwin ];
32 license = licenses.bsd3;
33 platforms = platforms.unix;