added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
DESCRIPTION = "This is protobuf-c, a C implementation of the Google Protocol Buffers data \
serialization format. It includes libprotobuf-c, a pure C library that \
implements protobuf encoding and decoding, and protoc-c, a code generator that \
converts Protocol Buffer .proto files to C descriptor code, based on the \
original protoc. protobuf-c formerly included an RPC implementation; that code \
has been split out into the protobuf-c-rpc project."
HOMEPAGE = "https://github.com/protobuf-c/protobuf-c"
SECTION = "console/tools"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9f725889e0d77383e26cb42b0b62cea2"
DEPENDS = "protobuf-native protobuf"
SRC_URI = "git://github.com/protobuf-c/protobuf-c.git;branch=master;protocol=https"
SRCREV = "abc67a11c6db271bedbb9f58be85d6f4e2ea8389"
S = "${WORKDIR}/git"
inherit autotools pkgconfig
export PROTOC = "${STAGING_BINDIR_NATIVE}/protoc"
# After several fix attempts there is still a race between generating
# t.test-full.pb.h and compiling cxx_generate_packed_data.c despite
# BUILT_SOURCES and explicit dependencies.
PARALLEL_MAKE = ""
PACKAGE_BEFORE_PN = "${PN}-compiler"
FILES:${PN}-compiler = "${bindir}"
RDEPENDS:${PN}-compiler = "protobuf-compiler"
RDEPENDS:${PN}-dev += "${PN}-compiler"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,26 @@
From 08e46feb6553af670754e65d94c3bb6fcd4e0cf9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 31 Oct 2021 23:39:44 -0700
Subject: [PATCH] Fix build on mips/clang
clang13 crashes on mips, until its fixed upstream disable tailcall on
mips
https://bugs.llvm.org/show_bug.cgi?id=52367
Upstream-Status: Inappropriate [Clang workaround]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/google/protobuf/port_def.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -255,6 +255,7 @@
#error PROTOBUF_TAILCALL was previously defined
#endif
#if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \
+ !defined(__mips__) && \
!defined(_ARCH_PPC) && !defined(__wasm__) && \
!(defined(_MSC_VER) && defined(_M_IX86)) && \
!(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24)

View File

@@ -0,0 +1,67 @@
From a91130bb95528743a3f7253f8fe945b7505047d5 Mon Sep 17 00:00:00 2001
From: Kyungjik Min <dp.min@lge.com>
Date: Mon, 28 Dec 2020 15:56:09 +0900
Subject: [PATCH] Fix linking error with ld-gold
:Release Notes:
:Detailed Notes:
https://github.com/protocolbuffers/protobuf/issues/6113
There's a bug in the CMake build leading it to not use the version
scripts, which hides the problem (because all symbols are now public)
but doesn't solve it properly.
:Testing Performed:
:QA Notes:
N/A
:Issues Addressed:
[PLAT-130467] Fix build error for libgoogleassistant with latest
protobuf-3.11.4
---
src/libprotobuf-lite.map | 2 ++
src/libprotobuf.map | 2 ++
src/libprotoc.map | 2 ++
3 files changed, 6 insertions(+)
diff --git a/src/libprotobuf-lite.map b/src/libprotobuf-lite.map
index 391554669..a1853ca6c 100644
--- a/src/libprotobuf-lite.map
+++ b/src/libprotobuf-lite.map
@@ -3,6 +3,8 @@
extern "C++" {
*google*;
};
+ scc_info_*;
+ descriptor_table_*;
local:
*;
diff --git a/src/libprotobuf.map b/src/libprotobuf.map
index 391554669..a1853ca6c 100644
--- a/src/libprotobuf.map
+++ b/src/libprotobuf.map
@@ -3,6 +3,8 @@
extern "C++" {
*google*;
};
+ scc_info_*;
+ descriptor_table_*;
local:
*;
diff --git a/src/libprotoc.map b/src/libprotoc.map
index 391554669..a1853ca6c 100644
--- a/src/libprotoc.map
+++ b/src/libprotoc.map
@@ -3,6 +3,8 @@
extern "C++" {
*google*;
};
+ scc_info_*;
+ descriptor_table_*;
local:
*;

View File

@@ -0,0 +1,58 @@
From e3fa241637ab5a7fa78c0d474802134cff75f91e Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Fri, 28 Jun 2019 13:50:52 +0000
Subject: [PATCH] examples/Makefile: respect CXX,LDFLAGS variables, fix build
with gold
* move pkg-config call to separate variable, so that the final version
of the whole command so it's shown in log.do_compile_ptest_base
* add ../src/google/protobuf/.libs/timestamp.pb.o when linking
add_person_cpp otherwise it fails to link with gold:
i686-oe-linux-g++ -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf`
/tmp/cccjSJQs.o:addressbook.pb.cc:scc_info_Person_addressbook_2eproto: error: undefined reference to 'scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto'
/tmp/cccjSJQs.o:addressbook.pb.cc:descriptor_table_addressbook_2eproto_deps: error: undefined reference to 'descriptor_table_google_2fprotobuf_2ftimestamp_2eproto'
collect2: error: ld returned 1 exit status
Makefile:43: recipe for target 'add_person_cpp' failed
* and the same with list_people_cpp this time with pkg-config already through the variable:
i686-oe-linux-g++ -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -pthread -Icore2-32-oe-linux/protobuf/3.8.0-r0/git/src -Lcore2-32-oe-linux/protobuf/3.8.0-r0/git/src/.libs -Lcore2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot/usr/lib -lprotobuf list_people.cc addressbook.pb.cc -o list_people_cpp
/tmp/ccpaI5Su.o:addressbook.pb.cc:scc_info_Person_addressbook_2eproto: error: undefined reference to 'scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto'
/tmp/ccpaI5Su.o:addressbook.pb.cc:descriptor_table_addressbook_2eproto_deps: error: undefined reference to 'descriptor_table_google_2fprotobuf_2ftimestamp_2eproto'
collect2: error: ld returned 1 exit status
Makefile:49: recipe for target 'list_people_cpp' failed
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
examples/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/examples/Makefile b/examples/Makefile
index 1c7ec8d63..85f591231 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -2,6 +2,8 @@
.PHONY: all cpp java python clean
+PROTOBUF := $(shell pkg-config --cflags --libs protobuf)
+
all: cpp java python
cpp: add_person_cpp list_people_cpp
@@ -40,11 +42,11 @@ protoc_middleman_dart: addressbook.proto
add_person_cpp: add_person.cc protoc_middleman
pkg-config --cflags protobuf # fails if protobuf is not installed
- c++ -std=c++11 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf`
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) ../src/google/protobuf/.libs/timestamp.pb.o $(PROTOBUF) add_person.cc addressbook.pb.cc -o add_person_cpp
list_people_cpp: list_people.cc protoc_middleman
pkg-config --cflags protobuf # fails if protobuf is not installed
- c++ -std=c++11 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf`
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) ../src/google/protobuf/.libs/timestamp.pb.o $(PROTOBUF) list_people.cc addressbook.pb.cc -o list_people_cpp
add_person_dart: add_person.dart protoc_middleman_dart

View File

@@ -0,0 +1,38 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TEST_FILE="/tmp/test.data"
RETVAL=0
# Test every writing test application
for write_exe_full_path in ${DIR}/add_person_*; do
if [ -x "${write_exe_full_path}" ]; then
write_exe=`basename ${write_exe_full_path}`
echo "Generating new test file using ${write_exe}..."
printf "1234\nname\nname@example.com\n" | ${write_exe_full_path} "${TEST_FILE}"
RETVAL=$?
[ $RETVAL -eq 0 ] || exit $RETVAL
# Test every reading test application
for read_exe_full_path in ${DIR}/list_people_*; do
read_exe=`basename ${read_exe_full_path}`
echo "Test: Write with ${write_exe}; Read with ${read_exe}..."
if [ -x "${read_exe_full_path}" ]; then
${read_exe_full_path} "${TEST_FILE}"
RETVAL=$?
[ $RETVAL -eq 0 ] || exit $RETVAL
fi
done
# Cleanup...
if [ -e "${TEST_FILE}" ]; then
rm "${TEST_FILE}"
fi
fi
done
if [ $RETVAL -eq 0 ] ; then
echo "PASS: protobuf"
else
echo "FAIL: protobuf"
fi

View File

@@ -0,0 +1,108 @@
SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \
efficient yet extensible format. Google uses Protocol Buffers for almost \
all of its internal RPC protocols and file formats."
HOMEPAGE = "https://github.com/google/protobuf"
SECTION = "console/tools"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b"
DEPENDS = "zlib"
DEPENDS:append:class-target = " protobuf-native"
SRCREV = "f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c"
SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=21.x;protocol=https \
file://run-ptest \
file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
file://0001-Fix-linking-error-with-ld-gold.patch \
"
SRC_URI:append:mips:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
S = "${WORKDIR}/git"
inherit cmake pkgconfig ptest
PACKAGECONFIG ??= ""
PACKAGECONFIG:class-native ?= "compiler"
PACKAGECONFIG:class-nativesdk ?= "compiler"
PACKAGECONFIG[python] = ",,"
PACKAGECONFIG[compiler] = "-Dprotobuf_BUILD_PROTOC_BINARIES=ON,-Dprotobuf_BUILD_PROTOC_BINARIES=OFF"
EXTRA_OECMAKE += "\
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_LIBPROTOC=ON \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
"
TEST_SRC_DIR = "examples"
LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
do_compile_ptest() {
mkdir -p "${B}/${TEST_SRC_DIR}"
# Add the location of the cross-compiled header and library files
# which haven't been installed yet.
cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
cp ${S}/${TEST_SRC_DIR}/*.cc "${B}/${TEST_SRC_DIR}/"
cp ${S}/${TEST_SRC_DIR}/*.proto "${B}/${TEST_SRC_DIR}/"
cp ${S}/${TEST_SRC_DIR}/*.py "${B}/${TEST_SRC_DIR}/"
cp ${S}/${TEST_SRC_DIR}/Makefile "${B}/${TEST_SRC_DIR}/"
sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
sed -e 's|Libs:|Libs: -L${B}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
# Until out-of-tree build of examples is supported, we have to use this approach
sed -e 's|../src/google/protobuf/.libs/timestamp.pb.o|${B}/CMakeFiles/libprotobuf.dir/src/google/protobuf/timestamp.pb.cc.o|' -i "${B}/${TEST_SRC_DIR}/Makefile"
export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
# Save the pkgcfg sysroot variable, and update it to nothing so
# that it doesn't append the sysroot to the beginning of paths.
# The header and library files aren't installed to the target
# system yet. So the absolute paths were specified above.
save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR
export PKG_CONFIG_SYSROOT_DIR=
# Compile the tests
for lang in ${LANG_SUPPORT}; do
oe_runmake -C "${B}/${TEST_SRC_DIR}" ${lang}
done
# Restore the pkgconfig sysroot variable
export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir
}
do_install_ptest() {
local olddir=`pwd`
cd "${S}/${TEST_SRC_DIR}"
install -d "${D}/${PTEST_PATH}"
for i in add_person* list_people*; do
if [ -x "$i" ]; then
install "$i" "${D}/${PTEST_PATH}"
fi
done
cp "${B}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
cd "$olddir"
}
PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite"
FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
SYSROOT_DIRS += "${bindir}"
RDEPENDS:${PN}-compiler = "${PN}"
RDEPENDS:${PN}-dev += "${PN}-compiler"
RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"
MIPS_INSTRUCTION_SET = "mips"
BBCLASSEXTEND = "native nativesdk"
LDFLAGS:append:arm = " -latomic"
LDFLAGS:append:mips = " -latomic"
LDFLAGS:append:powerpc = " -latomic"
LDFLAGS:append:mipsel = " -latomic"