From e4be43c6d007921355b335921adaac9b2b291e6a Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Wed, 11 Jan 2023 17:05:25 -0500 Subject: [PATCH] charls: init at 2.4.1 --- pkgs/development/libraries/charls/default.nix | 35 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/libraries/charls/default.nix diff --git a/pkgs/development/libraries/charls/default.nix b/pkgs/development/libraries/charls/default.nix new file mode 100644 index 000000000000..e7b8a54820e3 --- /dev/null +++ b/pkgs/development/libraries/charls/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "charls"; + version = "2.4.1"; + + src = fetchFromGitHub { + owner = "team-charls"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-l0qcJeQfRqpwR7vNmYZx00kGlPkK7nEYuslydjxj7ss="; + }; + + 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 = "A JPEG-LS library implementation in C++"; + maintainers = with maintainers; [ bcdarwin ]; + license = licenses.bsd3; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f33f49a051fc..39972ac4bad0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18865,6 +18865,8 @@ with pkgs; cgui = callPackage ../development/libraries/cgui {}; + charls = callPackage ../development/libraries/charls { }; + check = callPackage ../development/libraries/check { inherit (darwin.apple_sdk.frameworks) CoreServices; };