Skip to contentSkip to conversation

flatbuffers: new package

PATCH Superseded Fabrice Fontaine 2 participants 2 messages Dec 17, 2017 – Dec 18, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flatbuffers: new package

FlatBuffers is an efficient cross platform serialization library for C++, C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created at Google for game development and other performance-critical applications.

---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/flatbuffers/Config.in        |  9 +++++++++
 package/flatbuffers/flatbuffers.hash |  3 +++
 package/flatbuffers/flatbuffers.mk   | 21 +++++++++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/flatbuffers/Config.in
 create mode 100644 package/flatbuffers/flatbuffers.hash
 create mode 100644 package/flatbuffers/flatbuffers.mk
DEVELOPERS +1 -0
index e3f464aba6..ce48b117a3 100644
@@ -620,6 +620,7 @@ F:	package/alljoyn-tcl/
 F:	package/alljoyn-tcl-base/
 F:	package/boinc/
 F:	package/duktape/
+F:	package/flatbuffers/
 F:	package/gtksourceview/
 F:	package/gssdp/
 F:	package/gupnp/
package/Config.in +1 -0
index f86ce9f27c..cae1624cb1 100644
@@ -1453,6 +1453,7 @@ menu "Other"
 	source "package/elfutils/Config.in"
 	source "package/fftw/Config.in"
 	source "package/flann/Config.in"
+	source "package/flatbuffers/Config.in"
 	source "package/gflags/Config.in"
 	source "package/glibmm/Config.in"
 	source "package/glm/Config.in"
package/flatbuffers/Config.in new file +9 -0
new file mode 100644
index 0000000000..1793a83fae
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_FLATBUFFERS
+	bool "flatbuffers"
+	help
+	  FlatBuffers is an efficient cross platform serialization
+	  library for C++, C#, C, Go, Java, JavaScript, PHP, and
+	  Python. It was originally created at Google for game
+	  development and other performance-critical applications.
+
+	  http://google.github.io/flatbuffers/
package/flatbuffers/flatbuffers.hash new file +3 -0
new file mode 100644
index 0000000000..bd39ca385b
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256	c45029c0a0f1a88d416af143e34de96b3091642722aa2d8c090916c6d1498c2e	flatbuffers-v1.8.0.tar.gz
+sha256	7ec9661a8afafab1eee3523d6f1a193eff76314a5ab10b4ce96aefd87621b0c3	LICENSE.txt
package/flatbuffers/flatbuffers.mk new file +21 -0
new file mode 100644
index 0000000000..a176bd1f67
@@ -0,0 +1,21 @@
+################################################################################
+#
+# flatbuffers
+#
+################################################################################
+
+FLATBUFFERS_VERSION = v1.8.0
+FLATBUFFERS_SITE = $(call github,google,flatbuffers,$(FLATBUFFERS_VERSION))
+FLATBUFFERS_LICENSE = Apache-2.0
+FLATBUFFERS_LICENSE_FILES = LICENSE.txt
+FLATBUFFERS_INSTALL_STAGING = YES
+
+FLATBUFFERS_CONF_OPTS += -DFLATBUFFERS_BUILD_TESTS=OFF
+
+ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
+FLATBUFFERS_CONF_OPTS += -DFLATBUFFERS_BUILD_SHAREDLIB=ON
+else
+FLATBUFFERS_CONF_OPTS += -DFLATBUFFERS_BUILD_SHAREDLIB=OFF
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 flatbuffers: new package

Hello,

A similar patch adding this package was proposed recently:

From: Erik Tideman <[email protected]>
Subject: [Buildroot] [PATCH] flatbuffers: new package
Date: Mon, 18 Sep 2017 12:35:18 +0200

However, they were some comments, so it was marked as Changes Requested and the submitter never posted a new version. So it's nice to see you picking it up.

DEVELOPERS F: package/alljoyn-tcl/ · line 623

Quoted 9 lines · Fabrice Fontaine
DEVELOPERS +1 -0
index e3f464aba6..ce48b117a3 100644
@@ -620,6 +620,7 @@ F:	package/alljoyn-tcl/
 F:	package/alljoyn-tcl-base/
 F:	package/boinc/
 F:	package/duktape/
+F:	package/flatbuffers/

Nit: this doesn't apply to master, we don't have duktape (yet).

But more importantly, it doesn't build here. Use the following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.11-rc1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_FLATBUFFERS=y
# BR2_TARGET_ROOTFS_TAR is not set

Will fail to build with:

Quoted 1 line
Quoted 1 line
Quoted 1 line

flatbuffers v1.8.0 Building

PATH="/home/thomas/projets/buildroot/output/host/bin:/home/thomas/projets/buildroot/output/host/sbin:/usr/local/bin:/usr/bin:/bin:/home/thomas/.rvm/bin:/usr/local/sbin:/usr/sbin:/home/thomas/.rvm/bin:/home/thomas/sys/bin:/home/thomas/.gem/ruby/2.1.0/bin:/home/thomas/.rvm/bin" /usr/bin/make -j5 -C /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/ Scanning dependencies of target flathash
Scanning dependencies of target flatbuffers_shared
Scanning dependencies of target flatbuffers
Scanning dependencies of target flatc

[  3%] Building CXX object CMakeFiles/flathash.dir/src/flathash.cpp.o
[  6%] Building CXX object CMakeFiles/flatbuffers.dir/src/code_generators.cpp.o
[  9%] Building CXX object CMakeFiles/flatbuffers.dir/src/idl_parser.cpp.o

[ 15%] Building CXX object CMakeFiles/flatbuffers_shared.dir/src/code_generators.cpp.o
[ 15%] Building CXX object CMakeFiles/flatc.dir/src/code_generators.cpp.o
In file included from /home/thomas/projets/buildroot/output/host/opt/ext-toolchain/arm-buildroot-linux-uclibcgnueabi/include/c++/4.9.4/cstdint:35:0,
from /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/include/flatbuffers/hash.h:20,
from /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/src/flathash.cpp:20:
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/arm-buildroot-linux-uclibcgnueabi/include/c++/4.9.4/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from /home/thomas/projets/buildroot/output/host/opt/ext-toolchain/arm-buildroot-linux-uclibcgnueabi/include/c++/4.9.4/cstdint:35:0,
from /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/include/flatbuffers/base.h:12,
from /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/include/flatbuffers/idl.h:24,
from /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/include/flatbuffers/code_generators.h:22,
from /home/thomas/projets/buildroot/output/build/flatbuffers-v1.8.0/src/code_generators.cpp:17:
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/arm-buildroot-linux-uclibcgnueabi/include/c++/4.9.4/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^

And approximately 10 more screens of other errors. Looking at these errors, it also feels like it's using some amount of C++, so a dependency on BR2_INSTALL_LIBSTDCPP would be appropriate.

Don't you use test-pkg to test your package submissions ? It would be good to do so.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com