2020-01-04 14:23:47 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
|
2016-10-20 14:36:59 +01:00
|
|
|
|
2020-01-04 14:23:47 +00:00
|
|
|
stdenv.mkDerivation (rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "flatbuffers";
|
2019-11-02 18:35:07 +00:00
|
|
|
version = "1.11.0";
|
2016-10-20 14:36:59 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "flatbuffers";
|
|
|
|
rev = "v${version}";
|
2019-11-02 18:35:07 +00:00
|
|
|
sha256 = "1gl8pnykzifh7pnnvl80f5prmj5ga60dp44inpv9az2k9zaqx3qr";
|
2016-10-20 14:36:59 +01:00
|
|
|
};
|
|
|
|
|
2018-10-20 14:33:09 +01:00
|
|
|
preConfigure = stdenv.lib.optional stdenv.buildPlatform.isDarwin ''
|
|
|
|
rm BUILD
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2016-10-20 14:36:59 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-10-20 14:33:09 +01:00
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
2016-10-20 14:36:59 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
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 = [ stdenv.lib.maintainers.teh ];
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-10-20 14:33:09 +01:00
|
|
|
homepage = https://google.github.io/flatbuffers/;
|
2016-10-20 14:36:59 +01:00
|
|
|
};
|
2020-01-04 14:23:47 +00:00
|
|
|
} // stdenv.lib.optionalAttrs stdenv.hostPlatform.isMusl {
|
|
|
|
# Remove when updating to the next version.
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/google/flatbuffers/commit/2b52494047fb6e97af03e1801b42adc7ed3fd78a.diff";
|
|
|
|
sha256 = "01k07ws0f4w7nnl8nli795wgjm4p94lxd3kva4yf7nf3pg4p8arx";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
})
|