diff mbox series

[v2] zchunk: upgrade to 1.2.3

Message ID 20230222221808.2738340-1-raj.khem@gmail.com
State New
Headers show
Series [v2] zchunk: upgrade to 1.2.3 | expand

Commit Message

Khem Raj Feb. 22, 2023, 10:18 p.m. UTC
From: Ross Burton <ross.burton@arm.com>

Add patch to fix build with musl/clang combo

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Fix build with musl/clang

 ...-argp-with-source-snippet-with-clang.patch | 29 +++++++++++++++++++
 .../recipes-support/zchunk/zchunk_1.2.0.bb    | 22 --------------
 .../recipes-support/zchunk/zchunk_1.2.3.bb    | 25 ++++++++++++++++
 3 files changed, 54 insertions(+), 22 deletions(-)
 create mode 100644 meta-oe/recipes-support/zchunk/zchunk/0001-Do-not-probe-for-argp-with-source-snippet-with-clang.patch
 delete mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
 create mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.3.bb
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/zchunk/zchunk/0001-Do-not-probe-for-argp-with-source-snippet-with-clang.patch b/meta-oe/recipes-support/zchunk/zchunk/0001-Do-not-probe-for-argp-with-source-snippet-with-clang.patch
new file mode 100644
index 0000000000..b5e8e7fd9c
--- /dev/null
+++ b/meta-oe/recipes-support/zchunk/zchunk/0001-Do-not-probe-for-argp-with-source-snippet-with-clang.patch
@@ -0,0 +1,29 @@ 
+From 39b66fd1161850822142343507a5d2db241705b8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Feb 2023 14:00:29 -0800
+Subject: [PATCH] Do not probe for argp with source snippet with clang
+
+The test fails with clang erroneously
+
+Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/92]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 1817cee..d34c4b9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -57,7 +57,7 @@ if host_machine.system() == 'windows'
+ endif
+ 
+ # argp-standalone dependency (if required)
+-if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
++if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or cc.get_id() == 'clang' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
+     argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
+     if not argplib.found()
+         argplib = dependency('argp-standalone')
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb b/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
deleted file mode 100644
index 0baea5032a..0000000000
--- a/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
+++ /dev/null
@@ -1,22 +0,0 @@ 
-DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
-AUTHOR = "Jonathan Dieter"
-
-LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
-
-SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main"
-
-SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5"
-S = "${WORKDIR}/git"
-
-DEPENDS = "\
-    curl \
-    zstd \
-    "
-
-DEPENDS:append:libc-musl = " argp-standalone"
-LDFLAGS:append:libc-musl = " -largp"
-
-inherit meson pkgconfig
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-oe/recipes-support/zchunk/zchunk_1.2.3.bb b/meta-oe/recipes-support/zchunk/zchunk_1.2.3.bb
new file mode 100644
index 0000000000..87473815a7
--- /dev/null
+++ b/meta-oe/recipes-support/zchunk/zchunk_1.2.3.bb
@@ -0,0 +1,25 @@ 
+DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
+AUTHOR = "Jonathan Dieter"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
+
+SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main \
+           file://0001-Do-not-probe-for-argp-with-source-snippet-with-clang.patch"
+
+SRCREV = "f16dbeb0831eb37a9397356570327abb97860875"
+S = "${WORKDIR}/git"
+
+DEPENDS = "zstd"
+DEPENDS:append:libc-musl = " argp-standalone"
+
+inherit meson pkgconfig lib_package
+
+PACKAGECONFIG ??= "openssl zckdl"
+
+# zckdl gets packaged into zchunk-bin
+PACKAGECONFIG[zckdl] = "-Dwith-curl=enabled,-Dwith-curl=disabled,curl"
+# Use OpenSSL primitives for SHA
+PACKAGECONFIG[openssl] = "-Dwith-openssl=enabled,-Dwith-openssl=disabled,openssl"
+
+BBCLASSEXTEND = "native nativesdk"