diff options
| author | Khem Raj <raj.khem@gmail.com> | 2019-12-19 18:30:21 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2019-12-20 16:07:50 -0800 |
| commit | 20b42c1de7b21979121869d35714bbb4419faec8 (patch) | |
| tree | 31b58a24763103460b86e8d89f969deb0a1889d4 | |
| parent | 89461fecb74a9e110e4c7d6d0878e2f7f0eac1e4 (diff) | |
| download | meta-openembedded-20b42c1de7b21979121869d35714bbb4419faec8.tar.gz | |
avro-c: Update to 1.9.1
Backport a patch to fix build with musl ( already in future 1.10.x release)
Add a cmake patch to fix build on mulilibbed env
delete already upstreamed patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
5 files changed, 131 insertions, 57 deletions
diff --git a/meta-oe/recipes-support/avro/avro-c/0001-Allow-avro-C-to-be-built-on-musl-based-systems.patch b/meta-oe/recipes-support/avro/avro-c/0001-Allow-avro-C-to-be-built-on-musl-based-systems.patch new file mode 100644 index 0000000000..8964d6b72f --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c/0001-Allow-avro-C-to-be-built-on-musl-based-systems.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 9b39a985bcd6cd34f0820f3680f145d46c0e56bd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Titouan Christophe <titouan.christophe@railnova.eu> | ||
| 3 | Date: Sun, 8 Dec 2019 01:55:59 +0100 | ||
| 4 | Subject: [PATCH] Allow avro C to be built on musl based systems. | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | The type `ssize_t` is defined in sys/types.h, and nowhere else | ||
| 10 | in the musl standard C library, so it should be included for the | ||
| 11 | compilation to succeed. | ||
| 12 | |||
| 13 | This fixes several errors like: | ||
| 14 | |||
| 15 | In file included from src/generic.c:29:0: | ||
| 16 | src/generic.c: In function ‘avro_generic_value_new’: | ||
| 17 | src/avro_generic_internal.h:63:39: | ||
| 18 | error: ‘ssize_t’ undeclared (first use in this function); | ||
| 19 | did you mean ‘size_t’? | ||
| 20 | |||
| 21 | Upstream-Status: Backport | ||
| 22 | Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu> | ||
| 23 | --- | ||
| 24 | lang/c/src/avro_generic_internal.h | 2 ++ | ||
| 25 | 1 file changed, 2 insertions(+) | ||
| 26 | |||
| 27 | diff --git a/lang/c/src/avro_generic_internal.h b/lang/c/src/avro_generic_internal.h | ||
| 28 | index 709403c03..9843ed652 100644 | ||
| 29 | --- a/lang/c/src/avro_generic_internal.h | ||
| 30 | +++ b/lang/c/src/avro_generic_internal.h | ||
| 31 | @@ -24,6 +24,8 @@ extern "C" { | ||
| 32 | #define CLOSE_EXTERN | ||
| 33 | #endif | ||
| 34 | |||
| 35 | +#include <sys/types.h> | ||
| 36 | + | ||
| 37 | #include "avro/generic.h" | ||
| 38 | #include "avro/schema.h" | ||
| 39 | #include "avro/value.h" | ||
| 40 | -- | ||
| 41 | 2.24.1 | ||
| 42 | |||
diff --git a/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch b/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch deleted file mode 100644 index 01235d8ef3..0000000000 --- a/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | From 518bb8ccfb3f3fc143fbd571782f3e40573d01b5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 10 Apr 2017 09:15:04 -0700 | ||
| 4 | Subject: [PATCH] avro-c: Fix build with clang compiler | ||
| 5 | |||
| 6 | Clang advertizes itself to be compatible with gcc 4.2.1 | ||
| 7 | while that was true several years ago, it now supports | ||
| 8 | a lot more newer features, the test to just check gcc | ||
| 9 | version should be supplanted with clang check as well | ||
| 10 | so atomic support in clang can be asserted as well | ||
| 11 | |||
| 12 | Fixes | ||
| 13 | |||
| 14 | lang/c/src/avro/refcount.h:301:2: error: "No atomic implementation!" | ||
| 15 | |||
| 16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 17 | --- | ||
| 18 | lang/c/src/avro/refcount.h | 3 ++- | ||
| 19 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/lang/c/src/avro/refcount.h b/lang/c/src/avro/refcount.h | ||
| 22 | index 69afa4fc..d76ba057 100644 | ||
| 23 | --- a/lang/c/src/avro/refcount.h | ||
| 24 | +++ b/lang/c/src/avro/refcount.h | ||
| 25 | @@ -118,7 +118,8 @@ avro_refcount_dec(volatile int *refcount) | ||
| 26 | * GCC intrinsics | ||
| 27 | */ | ||
| 28 | |||
| 29 | -#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40500 | ||
| 30 | +#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40500 \ | ||
| 31 | +|| defined(__clang__) | ||
| 32 | |||
| 33 | static inline void | ||
| 34 | avro_refcount_set(volatile int *refcount, int value) | ||
| 35 | -- | ||
| 36 | 2.12.2 | ||
| 37 | |||
diff --git a/meta-oe/recipes-support/avro/avro-c/0001-cmake-Use-GNUInstallDirs-instead-of-hard-coded-paths.patch b/meta-oe/recipes-support/avro/avro-c/0001-cmake-Use-GNUInstallDirs-instead-of-hard-coded-paths.patch new file mode 100644 index 0000000000..6496b92dfe --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c/0001-cmake-Use-GNUInstallDirs-instead-of-hard-coded-paths.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From f24f863f3a8ca86f44123a58613f62c3b511da1e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 19 Dec 2019 18:23:41 -0800 | ||
| 4 | Subject: [PATCH] cmake: Use GNUInstallDirs instead of hard-coded paths | ||
| 5 | |||
| 6 | This ensures that it can be built on platforms where libdir is not | ||
| 7 | /usr/lib e.g. ppc64 | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://github.com/apache/avro/pull/749] | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | lang/c/CMakeLists.txt | 2 +- | ||
| 13 | lang/c/src/CMakeLists.txt | 16 +++++++++------- | ||
| 14 | 2 files changed, 10 insertions(+), 8 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/lang/c/CMakeLists.txt b/lang/c/CMakeLists.txt | ||
| 17 | index 11cbf018e..6c8d7aaf3 100644 | ||
| 18 | --- a/lang/c/CMakeLists.txt | ||
| 19 | +++ b/lang/c/CMakeLists.txt | ||
| 20 | @@ -16,7 +16,7 @@ | ||
| 21 | # specific language governing permissions and limitations | ||
| 22 | # under the License. | ||
| 23 | # | ||
| 24 | -cmake_minimum_required(VERSION 2.4) | ||
| 25 | +cmake_minimum_required(VERSION 3.1) | ||
| 26 | project(AvroC) | ||
| 27 | enable_testing() | ||
| 28 | |||
| 29 | diff --git a/lang/c/src/CMakeLists.txt b/lang/c/src/CMakeLists.txt | ||
| 30 | index 6f5659750..c1761c8de 100644 | ||
| 31 | --- a/lang/c/src/CMakeLists.txt | ||
| 32 | +++ b/lang/c/src/CMakeLists.txt | ||
| 33 | @@ -106,17 +106,19 @@ install(DIRECTORY | ||
| 34 | DESTINATION include | ||
| 35 | FILES_MATCHING PATTERN "*.h") | ||
| 36 | |||
| 37 | +include(GNUInstallDirs) | ||
| 38 | + | ||
| 39 | if (WIN32) | ||
| 40 | install(TARGETS avro-static | ||
| 41 | - RUNTIME DESTINATION bin | ||
| 42 | - LIBRARY DESTINATION lib | ||
| 43 | - ARCHIVE DESTINATION lib | ||
| 44 | + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 45 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| 46 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| 47 | ) | ||
| 48 | else(WIN32) | ||
| 49 | install(TARGETS avro-static avro-shared | ||
| 50 | - RUNTIME DESTINATION bin | ||
| 51 | - LIBRARY DESTINATION lib | ||
| 52 | - ARCHIVE DESTINATION lib | ||
| 53 | + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 54 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| 55 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| 56 | ) | ||
| 57 | endif(WIN32) | ||
| 58 | |||
| 59 | @@ -126,7 +128,7 @@ set(prefix ${CMAKE_INSTALL_PREFIX}) | ||
| 60 | set(VERSION ${AVRO_VERSION}) | ||
| 61 | configure_file(avro-c.pc.in avro-c.pc) | ||
| 62 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/avro-c.pc | ||
| 63 | - DESTINATION lib/pkgconfig) | ||
| 64 | + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
| 65 | |||
| 66 | add_executable(avrocat avrocat.c) | ||
| 67 | target_link_libraries(avrocat avro-static) | ||
| 68 | -- | ||
| 69 | 2.24.1 | ||
| 70 | |||
diff --git a/meta-oe/recipes-support/avro/avro-c_1.8.1.bb b/meta-oe/recipes-support/avro/avro-c_1.8.1.bb deleted file mode 100644 index 276fe2b5ae..0000000000 --- a/meta-oe/recipes-support/avro/avro-c_1.8.1.bb +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | SUMMARY = "Apache Avro data serialization system." | ||
| 2 | HOMEPAGE = "http://apr.apache.org/" | ||
| 3 | SECTION = "libs" | ||
| 4 | |||
| 5 | LICENSE = "Apache-2.0" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=73bdf70f268f0b3b9c5a83dd7a6f3324" | ||
| 7 | |||
| 8 | DEPENDS = "jansson zlib xz" | ||
| 9 | PV .= "+git${SRCPV}" | ||
| 10 | |||
| 11 | SRCREV = "4b3677c32b879e0e7f717eb95f9135ac654da760" | ||
| 12 | SRC_URI = "git://github.com/apache/avro \ | ||
| 13 | file://0001-avro-c-Fix-build-with-clang-compiler.patch;patchdir=../../ \ | ||
| 14 | " | ||
| 15 | |||
| 16 | S = "${WORKDIR}/git/lang/c" | ||
| 17 | |||
| 18 | LDFLAGS_append_libc-uclibc = " -lm" | ||
| 19 | |||
| 20 | inherit cmake | ||
diff --git a/meta-oe/recipes-support/avro/avro-c_1.9.1.bb b/meta-oe/recipes-support/avro/avro-c_1.9.1.bb new file mode 100644 index 0000000000..8954c9802f --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c_1.9.1.bb | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | SUMMARY = "Apache Avro data serialization system." | ||
| 2 | HOMEPAGE = "http://apr.apache.org/" | ||
| 3 | SECTION = "libs" | ||
| 4 | |||
| 5 | LICENSE = "Apache-2.0" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=6d502b41f76179fc84e536236f359cae" | ||
| 7 | |||
| 8 | DEPENDS = "jansson zlib xz" | ||
| 9 | |||
| 10 | BRANCH = "branch-1.9" | ||
| 11 | SRCREV = "89218262cde62e98fcb3778b86cd3f03056c54f3" | ||
| 12 | SRC_URI = "git://github.com/apache/avro;branch=${BRANCH} \ | ||
| 13 | file://0001-Allow-avro-C-to-be-built-on-musl-based-systems.patch;patchdir=../../ \ | ||
| 14 | file://0001-cmake-Use-GNUInstallDirs-instead-of-hard-coded-paths.patch;patchdir=../../ \ | ||
| 15 | " | ||
| 16 | |||
| 17 | S = "${WORKDIR}/git/lang/c" | ||
| 18 | |||
| 19 | inherit cmake | ||
