nixpkgs/pkgs/development/libraries/msgpack-c/default.nix
2023-07-18 09:49:20 +08:00

45 lines
983 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, gtest
, zlib
}:
stdenv.mkDerivation (finalAttrs: {
pname = "msgpack-c";
version = "6.0.0";
src = fetchFromGitHub {
owner = "msgpack";
repo = "msgpack-c";
rev = "refs/tags/c-${finalAttrs.version}";
hash = "sha256-TfC37QKwqvHxsLPgsEqJYkb7mpRQekbntbBPV4v4FO8=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
];
cmakeFlags = [
"-DMSGPACK_BUILD_EXAMPLES=OFF" # examples are not installed even if built
] ++ lib.optional (!finalAttrs.doCheck) "-DMSGPACK_BUILD_TESTS=OFF";
checkInputs = [
gtest
zlib
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
meta = with lib; {
description = "MessagePack implementation for C";
homepage = "https://github.com/msgpack/msgpack-c";
changelog = "https://github.com/msgpack/msgpack-c/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = licenses.boost;
maintainers = with maintainers; [ nickcao ];
};
})