1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 gtest,
7 zlib,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "msgpack-c";
12 version = "6.1.0";
13
14 src = fetchFromGitHub {
15 owner = "msgpack";
16 repo = "msgpack-c";
17 tag = "c-${finalAttrs.version}";
18 hash = "sha256-yL1+6w9l1Ccgrh8WXqvHv2yrb9QH+TrHIAFLXGoVuT0=";
19 };
20
21 strictDeps = true;
22
23 nativeBuildInputs = [
24 cmake
25 ];
26
27 cmakeFlags = [
28 (lib.cmakeBool "MSGPACK_BUILD_EXAMPLES" false) # examples are not installed even if built
29 (lib.cmakeBool "MSGPACK_BUILD_TESTS" finalAttrs.finalPackage.doCheck)
30 ];
31
32 checkInputs = [
33 gtest
34 zlib
35 ];
36
37 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
38
39 meta = with lib; {
40 description = "MessagePack implementation for C";
41 homepage = "https://github.com/msgpack/msgpack-c";
42 changelog = "https://github.com/msgpack/msgpack-c/blob/${finalAttrs.src.rev}/CHANGELOG.md";
43 license = licenses.boost;
44 maintainers = with maintainers; [ nickcao ];
45 };
46})