Quellcode durchsuchen

c-capnproto: add package

Adds the c-capnproto package. This creates a C plugin for the regular
capnproto capnpc compiler. It supports only serialization (no RPC).

Since it depends on capnproto, the package selects capnproto and has the
same requirements as capnproto.

The host version is always needed for the code generator, which is what
gets called by packages using it. The target version is also always
needed for the library. Therefore, no Config.in.host option is needed.

We need to use the git download method because the package has
submodules. The submodule is gtest, which is not really needed, but it's
complicated to remove the dependency.

The version is the latest upstream git hash. It is version 0.3 with just
two patches applied: one to the README file, and a fix submitted by us.

Signed-off-by: Joel Carlson <JoelsonCarl@gmail.com>
[Arnout:
 - use latest upstream version which has patch already applied;
 - mark in Config.in that dependencies come from capnproto;
 - add some newlines to .mk file;
 - updated commit message.]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Joel Carlson vor 6 Jahren
Ursprung
Commit
b6a06140cd

+ 1 - 0
DEVELOPERS

@@ -1139,6 +1139,7 @@ F:	package/x11r7/xdriver_xf86-video-imx/
 F:	package/x11r7/xdriver_xf86-video-imx-viv/
 
 N:	Joel Carlson <JoelsonCarl@gmail.com>
+F:	package/c-capnproto/
 F:	package/capnproto/
 F:	package/cmocka/
 F:	package/flatcc/

+ 1 - 0
package/Config.in

@@ -1662,6 +1662,7 @@ menu "Other"
 	source "package/bctoolbox/Config.in"
 	source "package/bdwgc/Config.in"
 	source "package/boost/Config.in"
+	source "package/c-capnproto/Config.in"
 	source "package/capnproto/Config.in"
 	source "package/clang/Config.in"
 	source "package/clapack/Config.in"

+ 21 - 0
package/c-capnproto/Config.in

@@ -0,0 +1,21 @@
+config BR2_PACKAGE_C_CAPNPROTO
+	bool "c-capnproto"
+	depends on BR2_USE_MMU # capnproto
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # capnproto
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # capnproto
+	depends on BR2_INSTALL_LIBSTDCPP # capnproto
+	depends on BR2_TOOLCHAIN_HAS_THREADS # capnproto
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC # capnproto
+	select BR2_PACKAGE_CAPNPROTO
+	help
+	  A C plugin for Cap'n Proto. Generates the code generator
+	  plugin for C. Requires regular Cap'n Proto and only
+	  provides serialization (no RPC).
+
+comment "c-capnproto needs host and target gcc >= 4.8 w/ C++, threads, atomic"
+	depends on BR2_USE_MMU
+	depends on!BR2_HOST_GCC_AT_LEAST_4_8 || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || \
+		!BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_TOOLCHAIN_HAS_ATOMIC

+ 3 - 0
package/c-capnproto/c-capnproto.hash

@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  88c454f4f4bad87c9b60cd739c7da5605c1085c0e92b317dd72d547bbb804279  c-capnproto-9053ebe6eeb2ae762655b982e27c341cb568366d.tar.gz
+sha256  27797e6c7dce96675d79ed250584d157b7a86405db6eb6fba9644e6d96d42c57  COPYING

+ 24 - 0
package/c-capnproto/c-capnproto.mk

@@ -0,0 +1,24 @@
+################################################################################
+#
+# c-capnproto
+#
+################################################################################
+
+C_CAPNPROTO_VERSION = 9053ebe6eeb2ae762655b982e27c341cb568366d
+C_CAPNPROTO_SITE = https://github.com/opensourcerouting/c-capnproto.git
+C_CAPNPROTO_SITE_METHOD = git
+C_CAPNPROTO_GIT_SUBMODULES = YES
+C_CAPNPROTO_LICENSE = MIT
+C_CAPNPROTO_LICENSE_FILES = COPYING
+C_CAPNPROTO_INSTALL_STAGING = YES
+
+# Fetched from git with no configure script
+C_CAPNPROTO_AUTORECONF = YES
+
+# As a plugin for capnproto's capnpc, requires capnproto. Needs to be on the
+# host to generate C code from message definitions.
+C_CAPNPROTO_DEPENDENCIES = host-c-capnproto capnproto
+HOST_C_CAPNPROTO_DEPENDENCIES = host-capnproto
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))