Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / charls / default.nix
blob150806c8c77e7d84b8772d194a9c85707cf77589
1 { lib, stdenv, fetchFromGitHub, cmake }:
3 stdenv.mkDerivation rec {
4   pname = "charls";
5   version = "2.4.2";
7   src = fetchFromGitHub {
8     owner = "team-charls";
9     repo = pname;
10     rev = "refs/tags/${version}";
11     hash = "sha256-c1wrk6JLcAH7TFPwjARlggaKXrAsLWyUQF/3WHlqoqg=";
12   };
14   postPatch = ''
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@
18   '';
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
26   doCheck = true;
28   meta = with lib; {
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;
34   };