1 { lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "0f7xd66vc1lzjbn7jzd5kyqrgxpsfxi4zc7iymhb5xrwyxipjl1g";
15 # Fixed a compilation error with GCC 10.0 to 11.0. June 1, 2020.
16 # Should be included in the next release after 1.12.0
17 url = "https://github.com/google/flatbuffers/commit/988164f6e1675bbea9c852e2d6001baf4d1fcf59.patch";
18 sha256 = "0d8c2bywqmkhdi0a41cry85wy4j58pl0vd6h5xpfqm3fr8w0mi9s";
19 excludes = [ "src/idl_gen_cpp.cpp" ];
22 # Fixed a compilation error with GCC 10.0 to 11.0. July 6, 2020.
23 # Should be included in the next release after 1.12.0
24 url = "https://github.com/google/flatbuffers/pull/6020/commits/44c7a4cf439b0a298720b5a448bcc243a882b0c9.patch";
25 sha256 = "126xwkvnlc4ignjhxv9jygfd9j6kr1jx39hyk0ddpcmvzfqsccf4";
29 preConfigure = lib.optional stdenv.buildPlatform.isDarwin ''
33 nativeBuildInputs = [ cmake ];
35 cmakeFlags = [ "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" ];
37 # tests fail to compile
39 # doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
43 description = "Memory Efficient Serialization Library";
45 FlatBuffers is an efficient cross platform serialization library for
46 games and other memory constrained apps. It allows you to directly
47 access serialized data without unpacking/parsing it first, while still
48 having great forwards/backwards compatibility.
50 maintainers = [ maintainers.teh ];
51 license = licenses.asl20;
52 platforms = platforms.unix;
53 homepage = "https://google.github.io/flatbuffers/";