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