1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, python3
6}:
7
8stdenv.mkDerivation rec {
9 pname = "flatbuffers";
10 version = "23.5.26";
11
12 src = fetchFromGitHub {
13 owner = "google";
14 repo = "flatbuffers";
15 rev = "v${version}";
16 hash = "sha256-e+dNPNbCHYDXUS/W+hMqf/37fhVgEGzId6rhP3cToTE=";
17 };
18
19 nativeBuildInputs = [ cmake python3 ];
20
21 cmakeFlags = [
22 "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}"
23 "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
24 ];
25
26 doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
27 checkTarget = "test";
28
29 meta = with lib; {
30 description = "Memory Efficient Serialization Library";
31 longDescription = ''
32 FlatBuffers is an efficient cross platform serialization library for
33 games and other memory constrained apps. It allows you to directly
34 access serialized data without unpacking/parsing it first, while still
35 having great forwards/backwards compatibility.
36 '';
37 homepage = "https://google.github.io/flatbuffers/";
38 license = licenses.asl20;
39 maintainers = [ maintainers.teh ];
40 mainProgram = "flatc";
41 platforms = platforms.unix;
42 };
43}