diff options
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | 0002-fix-for-flatbuffers-v2.patch | 56 | ||||
-rw-r--r-- | PKGBUILD | 7 |
3 files changed, 64 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = libsigmf-git pkgdesc = A header-only C++ library for working with SigMF metadata pkgver = r13.8ac7dbc - pkgrel = 1 + pkgrel = 2 url = https://github.com/deepsig/libsigmf arch = any license = Apache @@ -13,8 +13,9 @@ pkgbase = libsigmf-git conflicts = libsigmf source = git+https://github.com/deepsig/libsigmf.git source = 0001-cmake-fix-installation-of-fbs-files.patch + source = 0002-fix-for-flatbuffers-v2.patch sha256sums = SKIP sha256sums = 03012d41f55c1a2f7a61f952c79d14e80bba1f2ee508d77a3d94fe78f3ab394c + sha256sums = 9eae8483e26085999654ef9a633648b7025eca2c7a16b19b471ad7c189c47e04 pkgname = libsigmf-git - diff --git a/0002-fix-for-flatbuffers-v2.patch b/0002-fix-for-flatbuffers-v2.patch new file mode 100644 index 000000000000..7b5de9a86b69 --- /dev/null +++ b/0002-fix-for-flatbuffers-v2.patch @@ -0,0 +1,56 @@ +From 1caa1c81657ac96d73275564e146f8465a5dad18 Mon Sep 17 00:00:00 2001 +From: japm48 <japm48gh@gmail.com> +Date: Sat, 25 Sep 2021 00:35:56 +0200 +Subject: [PATCH] Fix for flatbuffers v2 + +--- + src/flatbuffers_json_visitor.h | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/flatbuffers_json_visitor.h b/src/flatbuffers_json_visitor.h +index 1c310ad..f8571d6 100644 +--- a/src/flatbuffers_json_visitor.h ++++ b/src/flatbuffers_json_visitor.h +@@ -197,6 +197,15 @@ json_vector_to_chararray(flatbuffers::FlatBufferBuilder &fbb, const json &jvec, + } + + ++inline bool check_type_is_vector(const flatbuffers::TypeCode &tc) { ++#if FLATBUFFERS_VERSION_MAJOR >= 2 ++ return tc.is_repeating; ++#else ++ return tc.is_vector; ++#endif ++} ++ ++ + /** + * Iterate through a typetable-- I'll be honest here. This is kind of bullshit. We need to create all of + * the types like Strings, Lists, Vectors, and other flatbuffer types before we create our table. I'm not +@@ -217,7 +226,7 @@ inline void IterateType(const flatbuffers::TypeTable *type_table, FromSigMFVisit + for (size_t i = 0; i < type_table->num_elems; i++) { + auto type_code = type_table->type_codes[i]; + auto type = static_cast<flatbuffers::ElementaryType>(type_code.base_type); +- auto is_vector = type_code.is_vector != 0; ++ auto is_vector = check_type_is_vector(type_code); + auto ref_idx = type_code.sequence_ref; + const flatbuffers::TypeTable *ref = nullptr; + if (ref_idx >= 0) { ref = type_table->type_refs[ref_idx](); } +@@ -277,7 +286,7 @@ inline void IterateType(const flatbuffers::TypeTable *type_table, FromSigMFVisit + for (size_t i = 0; i < type_table->num_elems; i++) { + auto type_code = type_table->type_codes[i]; + auto type = static_cast<flatbuffers::ElementaryType>(type_code.base_type); +- auto is_vector = type_code.is_vector != 0; ++ auto is_vector = check_type_is_vector(type_code); + auto ref_idx = type_code.sequence_ref; + const flatbuffers::TypeTable *ref = nullptr; + if (ref_idx >= 0) { ref = type_table->type_refs[ref_idx](); } +@@ -490,7 +499,7 @@ FlatBufferToJson(const uint8_t *buffer_root, const flatbuffers::TypeTable *typet + // Gather all of the underlying info about this element in table + auto type_code = typetable->type_codes[i]; + auto type = static_cast<flatbuffers::ElementaryType>(type_code.base_type); +- auto is_vector = type_code.is_vector != 0; ++ auto is_vector = check_type_is_vector(type_code); + auto ref_idx = type_code.sequence_ref; + const flatbuffers::TypeTable *ref = nullptr; + if (ref_idx >= 0) { ref = typetable->type_refs[ref_idx](); } @@ -2,7 +2,7 @@ _pkgname=libsigmf pkgname=$_pkgname-git pkgver=r13.8ac7dbc -pkgrel=1 +pkgrel=2 pkgdesc="A header-only C++ library for working with SigMF metadata" arch=(any) url="https://github.com/deepsig/libsigmf" @@ -13,9 +13,11 @@ provides=("$_pkgname") conflicts=("$_pkgname") source=("git+$url.git" "0001-cmake-fix-installation-of-fbs-files.patch" + "0002-fix-for-flatbuffers-v2.patch" ) sha256sums=('SKIP' - '03012d41f55c1a2f7a61f952c79d14e80bba1f2ee508d77a3d94fe78f3ab394c') + '03012d41f55c1a2f7a61f952c79d14e80bba1f2ee508d77a3d94fe78f3ab394c' + '9eae8483e26085999654ef9a633648b7025eca2c7a16b19b471ad7c189c47e04') pkgver() { cd "$_pkgname" @@ -25,6 +27,7 @@ pkgver() { prepare() { cd "$_pkgname" patch -p1 < "$srcdir/0001-cmake-fix-installation-of-fbs-files.patch" + patch -p1 < "$srcdir/0002-fix-for-flatbuffers-v2.patch" } build() { |