Skip to contentSkip to conversation

c-capnproto: add package

PATCH New Joel Carlson 2 participants 2 messages Oct 23, 2018 – Aug 1, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

Includes a patch submitted upstream to fix a compilation error hit by some toolchains.

---
Changes v1 -> v2:
- change from the call github hook to using the https URL. To use the git submodules variable I had to specify a git site method, but then it broke the download using the call github hook. I did not realize this was broken because I had a cached copy.

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...r-str.h-include-stdarg.h-for-va_list.patch | 48 +++++++++++++++++++
 package/c-capnproto/Config.in                 | 21 ++++++++
 package/c-capnproto/c-capnproto.hash          |  3 ++
 package/c-capnproto/c-capnproto.mk            | 23 +++++++++
 6 files changed, 97 insertions(+)
 create mode 100644 package/c-capnproto/0001-compiler-str.h-include-stdarg.h-for-va_list.patch
 create mode 100644 package/c-capnproto/Config.in
 create mode 100644 package/c-capnproto/c-capnproto.hash
 create mode 100644 package/c-capnproto/c-capnproto.mk
DEVELOPERS +1 -0
index a3d97eb390..57cb7b3a8b 100644
@@ -1038,6 +1038,7 @@ F:	package/x11r7/xdriver_xf86-video-imx/
 F:	package/x11r7/xdriver_xf86-video-imx-viv/
 
 N:	Joel Carlson <[email protected]>
+F:	package/c-capnproto/
 F:	package/capnproto/
 F:	package/cmocka/
 F:	package/flatcc/
package/Config.in +1 -0
index 710cde6691..1714d9ec27 100644
@@ -1590,6 +1590,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"
package/c-capnproto/0001-compiler-str.h-include-stdarg.h-for-va_list.patch new file +48 -0

48 lines not on this page · raw message

package/c-capnproto/Config.in new file +21 -0
new file mode 100644
index 0000000000..3dd1d13762
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_C_CAPNPROTO
+	bool "c-capnproto"
+	depends on BR2_USE_MMU
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
+	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
package/c-capnproto/c-capnproto.hash new file +3 -0
new file mode 100644
index 0000000000..c1f5c278f6
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256	d6a93104bc0b47afa5dbfaaa39ee89319a2f41126d4959b6e772b843a1e0afd8  c-capnproto-c-capnproto-0.3.tar.gz
+sha256	27797e6c7dce96675d79ed250584d157b7a86405db6eb6fba9644e6d96d42c57  COPYING
package/c-capnproto/c-capnproto.mk new file +23 -0
new file mode 100644
index 0000000000..11ec07b47c
@@ -0,0 +1,23 @@
+################################################################################
+#
+# c-capnproto
+#
+################################################################################
+
+C_CAPNPROTO_SHORT_VERSION = 0.3
+C_CAPNPROTO_VERSION = c-capnproto-$(C_CAPNPROTO_SHORT_VERSION)
+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 Github 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))
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 c-capnproto: add package

Quoted 10 lines · Joel Carlson

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.

Includes a patch submitted upstream to fix a compilation error hit by some toolchains.

Finally applied to master, with some changes:

- 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.

Regards,
Arnout