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