about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix
blob: 1cdfb4b9c87032fa35ef37a41a2fef706026d9db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ lib
, stdenv
, fetchFromGitHub
, cmake
, version
, sha256
, patches ? [ ]
, preConfigure ? null
}:

stdenv.mkDerivation rec {
  pname = "flatbuffers";
  inherit version;

  src = fetchFromGitHub {
    owner = "google";
    repo = "flatbuffers";
    rev = "v${version}";
    inherit sha256;
  };

  inherit patches preConfigure;

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [
    "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}"
  ];

  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
  checkTarget = "test";

  meta = with lib; {
    description = "Memory Efficient Serialization Library";
    longDescription = ''
      FlatBuffers is an efficient cross platform serialization library for
      games and other memory constrained apps. It allows you to directly
      access serialized data without unpacking/parsing it first, while still
      having great forwards/backwards compatibility.
    '';
    maintainers = [ maintainers.teh ];
    license = licenses.asl20;
    platforms = platforms.unix;
    homepage = "https://google.github.io/flatbuffers/";
  };
}