aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/nbdkit
diff options
context:
space:
mode:
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>2020-04-09 01:39:13 +0200
committerKhem Raj <raj.khem@gmail.com>2020-04-11 15:26:27 -0700
commitf158ce33b529f0959283a303964968c14c68f519 (patch)
treeb96ae902deb9d0370cdbf7d25778d4cd72b50aa9 /meta-networking/recipes-support/nbdkit
parent7d46719656a41df705abe12dfe33e6ed551b0a69 (diff)
downloadmeta-openembedded-f158ce33b529f0959283a303964968c14c68f519.tar.gz
nbdkit: Add recipe to extend backend possibilities of nbd.
Nbdkit uses plugins to add more sources of data for nbd client. Nbdkit can also spawn nbd-client, uses unix or network socket to communicate with client, uses different plugins to serve data for nbd device eg. curl, file, custom plugins in many languages (perl, python) and some others. Fix build when printf is a macro instead of function Use BSD-3-Clause for license inherit bash-completion so these are packaged correctly Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/nbdkit')
-rw-r--r--meta-networking/recipes-support/nbdkit/nbdkit/0001-server-Fix-build-when-printf-is-a-macro.patch39
-rw-r--r--meta-networking/recipes-support/nbdkit/nbdkit_git.bb36
2 files changed, 75 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/nbdkit/nbdkit/0001-server-Fix-build-when-printf-is-a-macro.patch b/meta-networking/recipes-support/nbdkit/nbdkit/0001-server-Fix-build-when-printf-is-a-macro.patch
new file mode 100644
index 0000000000..c7ec41eb9a
--- /dev/null
+++ b/meta-networking/recipes-support/nbdkit/nbdkit/0001-server-Fix-build-when-printf-is-a-macro.patch
@@ -0,0 +1,39 @@
+From 28f07715ab4d670ce81e12776bbece043305bd83 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 11 Apr 2020 15:08:39 -0700
+Subject: [PATCH] server: Fix build when printf is a macro
+
+clang complains on x86 when building
+
+main.c:116:2: error: embedding a #include directive within macro arguments is not supported
+ ^
+
+convert nesting include into a string assignment, to same effect but
+making it compatible with clang as well
+
+Upstream-Status: Submitted [https://github.com/libguestfs/nbdkit/pull/3]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ server/main.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/server/main.c b/server/main.c
+index 748122f..c0ac874 100644
+--- a/server/main.c
++++ b/server/main.c
+@@ -112,9 +112,10 @@ static void
+ usage (void)
+ {
+ /* --{short,long}-options remain undocumented */
+- printf (
++ char const *opt_list =
+ #include "synopsis.c"
+- );
++ ;
++ printf ("%s\n", opt_list);
+ printf ("\n"
+ "Please read the nbdkit(1) manual page for full usage.\n");
+ }
+--
+2.26.0
+
diff --git a/meta-networking/recipes-support/nbdkit/nbdkit_git.bb b/meta-networking/recipes-support/nbdkit/nbdkit_git.bb
new file mode 100644
index 0000000000..a63e49ec55
--- /dev/null
+++ b/meta-networking/recipes-support/nbdkit/nbdkit_git.bb
@@ -0,0 +1,36 @@
+SUMMARY = "nbdkit is a toolkit for creating NBD servers."
+DESCRIPTION = "NBD — Network Block Device — is a protocol \
+for accessing Block Devices (hard disks and disk-like things) \
+over a Network. \
+\
+nbdkit is a toolkit for creating NBD servers."
+
+HOMEPAGE = "https://github.com/libguestfs/nbdkit"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4332a97808994cf2133a65b6c6f33eaf"
+
+SRC_URI = "git://github.com/libguestfs/nbdkit.git;protocol=https \
+ file://0001-server-Fix-build-when-printf-is-a-macro.patch \
+"
+
+PV = "1.19.6+git${SRCPV}"
+SRCREV = "257561bc9f2f01eb9f21686bcec4b863d17a26c4"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "curl xz e2fsprogs zlib"
+
+# autotools-brokensep is needed as nbdkit does not support build in external directory
+inherit pkgconfig python3native perlnative bash-completion autotools-brokensep
+
+# Those are required to build standalone
+EXTRA_OECONF = " --without-libvirt --without-libguestfs --disable-perl"
+
+# Disable some extended support (not desired for small embedded systems)
+#EXTRA_OECONF += " --disable-python"
+#EXTRA_OECONF += " --disable-ocaml"
+#EXTRA_OECONF += " --disable-rust"
+#EXTRA_OECONF += " --disable-ruby"
+#EXTRA_OECONF += " --disable-tcl"
+#EXTRA_OECONF += " --disable-lua"
+#EXTRA_OECONF += " --disable-vddk"