summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Jean Texier <pjtexier@koncepto.io>2019-12-11 20:07:33 +0100
committerKhem Raj <raj.khem@gmail.com>2020-01-23 14:39:21 -0800
commit5c453ae57830b379355a3bddb4bd9d556584d411 (patch)
tree1ceb8d569c606ee68ed1013874b12266d122c179
parenta7f5aed4e5514b30ad230cdad03e05ab2e8597f1 (diff)
downloadmeta-openembedded-5c453ae57830b379355a3bddb4bd9d556584d411.tar.gz
zchunk: add recipe
zchunk is a compressed file format that splits the file into independent chunks. This allows you to only download changed chunks when downloading a new version of the file, and also makes zchunk files efficient over rsync. Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-support/zchunk/zchunk/0001-zck.h-fix-build-on-musl.patch39
-rw-r--r--meta-oe/recipes-support/zchunk/zchunk/0002-unzck-fix-build-with-musl-libc.patch61
-rw-r--r--meta-oe/recipes-support/zchunk/zchunk_1.1.5.bb26
3 files changed, 126 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/zchunk/zchunk/0001-zck.h-fix-build-on-musl.patch b/meta-oe/recipes-support/zchunk/zchunk/0001-zck.h-fix-build-on-musl.patch
new file mode 100644
index 0000000000..64e0e8ed61
--- /dev/null
+++ b/meta-oe/recipes-support/zchunk/zchunk/0001-zck.h-fix-build-on-musl.patch
@@ -0,0 +1,39 @@
1From 78247d478cec254bad27f4ed97b532f4f54bf1b0 Mon Sep 17 00:00:00 2001
2From: Pierre-Jean Texier <pjtexier@koncepto.io>
3Date: Thu, 23 Jan 2020 19:14:40 +0100
4Subject: [PATCH 1/2] zck.h: fix build on musl
5
6The ssize_t type requires the <sys/types.h> header. This fixes build with musl
7libc:
8
9include/zck.h:68:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
10 68 | ssize_t zck_read(zckCtx *zck, char *dst, size_t dst_size)
11 | ^~~~~~~
12 | size_t
13include/zck.h:81:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
14 81 | ssize_t zck_write(zckCtx *zck, const char *src, const size_t src_size)
15 | ^~~~~~~
16 | size_t
17
18Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/23]
19
20Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
21---
22 include/zck.h.in | 1 +
23 1 file changed, 1 insertion(+)
24
25diff --git a/include/zck.h.in b/include/zck.h.in
26index 91d2557..b847576 100644
27--- a/include/zck.h.in
28+++ b/include/zck.h.in
29@@ -5,6 +5,7 @@
30
31 #include <stdlib.h>
32 #include <stdbool.h>
33+#include <sys/types.h>
34
35 typedef enum zck_hash {
36 ZCK_HASH_SHA1,
37--
382.7.4
39
diff --git a/meta-oe/recipes-support/zchunk/zchunk/0002-unzck-fix-build-with-musl-libc.patch b/meta-oe/recipes-support/zchunk/zchunk/0002-unzck-fix-build-with-musl-libc.patch
new file mode 100644
index 0000000000..a1c95bf362
--- /dev/null
+++ b/meta-oe/recipes-support/zchunk/zchunk/0002-unzck-fix-build-with-musl-libc.patch
@@ -0,0 +1,61 @@
1From 72c55e3da59eccdfea3778d11f83862b58af723d Mon Sep 17 00:00:00 2001
2From: Pierre-Jean Texier <pjtexier@koncepto.io>
3Date: Thu, 23 Jan 2020 22:42:40 +0100
4Subject: [PATCH 2/2] unzck: fix build with musl libc
5
6On musl libc "stdout" is a preprocessor macro whose expansion leads to
7compilation errors.
8
9Fixes:
10
11| In file included from ../git/src/unzck.c:31:
12| ../git/src/unzck.c: In function 'parse_opt':
13| ../git/src/unzck.c:78:24: error: expected identifier before '(' token
14| 78 | arguments->stdout = true;
15| | ^~~~~~
16| ../git/src/unzck.c: In function 'main':
17| ../git/src/unzck.c:141:20: error: expected identifier before '(' token
18| 141 | if(!(arguments.stdout)) {
19| | ^~~~~~
20
21Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/23]
22
23Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
24---
25 src/unzck.c | 6 +++---
26 1 file changed, 3 insertions(+), 3 deletions(-)
27
28diff --git a/src/unzck.c b/src/unzck.c
29index 8d6c62a..002492c 100644
30--- a/src/unzck.c
31+++ b/src/unzck.c
32@@ -58,7 +58,7 @@ struct arguments {
33 char *args[1];
34 zck_log_type log_level;
35 bool dict;
36- bool stdout;
37+ bool stdOut;
38 bool exit;
39 };
40
41@@ -75,7 +75,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
42 arguments->log_level = ZCK_LOG_DDEBUG;
43 break;
44 case 'c':
45- arguments->stdout = true;
46+ arguments->stdOut = true;
47 break;
48 case 'V':
49 version();
50@@ -138,7 +138,7 @@ int main (int argc, char *argv[]) {
51 snprintf(out_name + strlen(base_name) - 4, 7, ".zdict");
52
53 int dst_fd = STDOUT_FILENO;
54- if(!arguments.stdout) {
55+ if(!arguments.stdOut) {
56 dst_fd = open(out_name, O_TRUNC | O_WRONLY | O_CREAT, 0666);
57 if(dst_fd < 0) {
58 dprintf(STDERR_FILENO, "Unable to open %s", out_name);
59--
602.7.4
61
diff --git a/meta-oe/recipes-support/zchunk/zchunk_1.1.5.bb b/meta-oe/recipes-support/zchunk/zchunk_1.1.5.bb
new file mode 100644
index 0000000000..f75412f49e
--- /dev/null
+++ b/meta-oe/recipes-support/zchunk/zchunk_1.1.5.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
2AUTHOR = "Jonathan Dieter"
3
4LICENSE = "BSD-2-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=cd6e590282010ce90a94ef25dd31410f"
6
7SRC_URI = " \
8 git://github.com/zchunk/zchunk.git;protocol=https \
9 file://0001-zck.h-fix-build-on-musl.patch \
10 file://0002-unzck-fix-build-with-musl-libc.patch \
11 "
12
13SRCREV = "c01bf12feede792982f165f52f4a6c573e3a8c17"
14S = "${WORKDIR}/git"
15
16DEPENDS = "\
17 curl \
18 zstd \
19 "
20
21DEPENDS_append_libc-musl = " argp-standalone"
22LDFLAGS_append_libc-musl = " -largp"
23
24inherit meson
25
26BBCLASSEXTEND = "native nativesdk"