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,42 @@
From a07e56e1a2e70a9b81eb0a65f345cf45a7a93a81 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 19 Dec 2019 21:56:23 -0800
Subject: [PATCH] DefineInstallationPaths.cmake: Define libdir in terms of
LIB_SUFFIX
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
build/cmake/DefineInstallationPaths.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/build/cmake/DefineInstallationPaths.cmake
+++ b/build/cmake/DefineInstallationPaths.cmake
@@ -26,11 +26,11 @@
set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
endif()
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
-set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
-set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)")
+set(CMAKE_INSTALL_DIR "lib${LIB_SUFFIX}/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
+set(PKGCONFIG_INSTALL_DIR "lib${LIB_SUFFIX}/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)")
set(DOC_INSTALL_DIR "share/doc" CACHE PATH "The subdirectory to install documentation files (default: share/doc)")
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}/bin")
-set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
+set(libdir "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
set(includedir "${CMAKE_INSTALL_PREFIX}/include")
set(cmakedir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DIR}")
--- a/build/cmake/DefineCMakeDefaults.cmake
+++ b/build/cmake/DefineCMakeDefaults.cmake
@@ -44,8 +44,8 @@
# top of the build tree rather than in hard-to-find leaf
# directories. This simplifies manual testing and the use of the build
# tree rather than installed thrift libraries.
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#

View File

@@ -0,0 +1,180 @@
From 0b9c6c4286a33961016839826e709a0e7394b28b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 21 Jan 2023 00:00:04 -0800
Subject: [PATCH] cmake: Use -idirafter instead of -isystem
isystem dirs are searched before the regular system dirs
this exposes an interesting include ordering problem when using
clang + libc++, when including C++ headers like <cstdlib>
cstdlib includes stdlib.h and in case of libc++, this should be coming
from libc++ as well, which is then eventually including system stdlib.h
libc++ has added a check for checking this order recently, which means
if cstlib ends up including system stdlib.h before libc++ provided
stdlib.h it errors out
/mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/thrift/0.17.0-r0/recipe-sysroot/usr/include/c++/v1/cstdlib:90:5: error: <cstdlib> tried including <stdlib.h> but didn't find libc++'s <stdlib.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case.
^
The reason is that include_directories with SYSTEM property adds the
directory via -system and some of these directories point to sysroot
e.g. OPENSSL_INCLUDE_DIR which ends up adding -isystem
<sysroot>/usr/include and causes the system stdlib.h to included before
libc++ stdlib.h
A fix is to use -idirafter which preserved the effects of system headers
but instead of prepending, it will append to system headers and the
issue is addressed
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
build/cmake/BoostMacros.cmake | 2 +-
lib/c_glib/CMakeLists.txt | 4 ++--
lib/c_glib/test/CMakeLists.txt | 2 +-
lib/cpp/CMakeLists.txt | 7 +++----
lib/cpp/test/CMakeLists.txt | 2 +-
test/c_glib/CMakeLists.txt | 6 +++---
test/cpp/CMakeLists.txt | 6 +++---
7 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/build/cmake/BoostMacros.cmake b/build/cmake/BoostMacros.cmake
index ffb85af..9f9d2dd 100644
--- a/build/cmake/BoostMacros.cmake
+++ b/build/cmake/BoostMacros.cmake
@@ -26,7 +26,7 @@ macro(REQUIRE_BOOST_HEADERS)
endif()
if (DEFINED Boost_INCLUDE_DIRS)
# pre-boost 1.70.0 aware cmake, otherwise it is using targets
- include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${Boost_INCLUDE_DIRS}")
endif()
endmacro()
diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt
index 218f7dd..d7a6161 100644
--- a/lib/c_glib/CMakeLists.txt
+++ b/lib/c_glib/CMakeLists.txt
@@ -83,7 +83,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL)
list(APPEND SYSLIBS OpenSSL::Crypto)
endif()
else()
- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${OPENSSL_INCLUDE_DIR}")
list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
endif()
endif()
@@ -97,7 +97,7 @@ target_link_libraries(thrift_c_glib PUBLIC ${SYSLIBS})
# If Zlib is not found just ignore the Zlib stuff
if(WITH_ZLIB)
- include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${ZLIB_INCLUDE_DIRS}")
ADD_LIBRARY_THRIFT(thrift_c_glib_zlib ${thrift_c_glib_zlib_SOURCES})
target_link_libraries(thrift_c_glib_zlib ${SYSLIBS} ${ZLIB_LIBRARIES})
target_link_libraries(thrift_c_glib_zlib thrift_c_glib)
diff --git a/lib/c_glib/test/CMakeLists.txt b/lib/c_glib/test/CMakeLists.txt
index 85c6dd0..0c8d3d2 100644
--- a/lib/c_glib/test/CMakeLists.txt
+++ b/lib/c_glib/test/CMakeLists.txt
@@ -129,7 +129,7 @@ target_link_libraries(testthriftmemorybufferreadcheck testgenc)
add_test(NAME testthriftmemorybufferreadcheck COMMAND testthriftmemorybufferreadcheck)
if(WITH_ZLIB)
- include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${ZLIB_INCLUDE_DIRS}")
add_executable(testzlibtransport testzlibtransport.c)
target_link_libraries(testzlibtransport testgenc ${ZLIB_LIBRARIES})
target_link_libraries(testzlibtransport thrift_c_glib_zlib)
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index 13b41c5..96bea53 100644
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -111,7 +111,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL)
list(APPEND SYSLIBS OpenSSL::Crypto)
endif()
else()
- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${OPENSSL_INCLUDE_DIR}")
list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
endif()
endif()
@@ -167,8 +167,7 @@ ADD_PKGCONFIG_THRIFT(thrift)
if(WITH_LIBEVENT)
find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream
- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS})
-
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${LIBEVENT_INCLUDE_DIRS}")
ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES})
target_link_libraries(thriftnb PUBLIC thrift)
if(TARGET libevent::core AND TARGET libevent::extra)
@@ -182,7 +181,7 @@ endif()
if(WITH_ZLIB)
find_package(ZLIB REQUIRED)
- include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${ZLIB_INCLUDE_DIRS}")
ADD_LIBRARY_THRIFT(thriftz ${thriftcppz_SOURCES})
target_link_libraries(thriftz PUBLIC thrift)
diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt
index 19854e1..1b36b47 100644
--- a/lib/cpp/test/CMakeLists.txt
+++ b/lib/cpp/test/CMakeLists.txt
@@ -127,7 +127,7 @@ endif ()
add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest)
if(WITH_ZLIB)
-include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${ZLIB_INCLUDE_DIRS}")
add_executable(TransportTest TransportTest.cpp)
target_link_libraries(TransportTest
testgencpp
diff --git a/test/c_glib/CMakeLists.txt b/test/c_glib/CMakeLists.txt
index 410774d..cbda860 100644
--- a/test/c_glib/CMakeLists.txt
+++ b/test/c_glib/CMakeLists.txt
@@ -21,14 +21,14 @@
include(ThriftMacros)
find_package(GLIB REQUIRED COMPONENTS gobject)
-include_directories(SYSTEM "${GLIB_INCLUDE_DIR}")
-include_directories(SYSTEM "${GLIBCONFIG_INCLUDE_DIR}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${GLIB_INCLUDE_DIR}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${GLIBCONFIG_INCLUDE_DIR}")
#Make sure gen-c_glib files can be included
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/gen-c_glib")
include_directories("${PROJECT_SOURCE_DIR}/lib/c_glib/src")
-include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${OPENSSL_INCLUDE_DIR}")
set(crosstestgencglib_SOURCES
gen-c_glib/t_test_second_service.c
diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt
index a6c1fd5..160c67b 100644
--- a/test/cpp/CMakeLists.txt
+++ b/test/cpp/CMakeLists.txt
@@ -27,13 +27,13 @@ REQUIRE_BOOST_LIBRARIES(BOOST_COMPONENTS)
include(ThriftMacros)
find_package(OpenSSL REQUIRED)
-include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${OPENSSL_INCLUDE_DIR}")
find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream
-include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${LIBEVENT_INCLUDE_DIRS}")
find_package(ZLIB REQUIRED)
-include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${ZLIB_INCLUDE_DIRS}")
#Make sure gen-cpp files can be included
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
--
2.39.1

View File

@@ -0,0 +1,67 @@
SUMMARY = "Apache Thrift"
DESCRIPTION = "A software framework, for scalable cross-language services development"
HOMEPAGE = "https://thrift.apache.org/"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c40a383cb3f747e0c7abbf1482f194f0 \
file://NOTICE;md5=2659b43daca219f99a2f2626ea128f73"
DEPENDS = "thrift-native boost flex-native bison-native openssl zlib"
SRC_URI = "https://www-eu.apache.org/dist/thrift//${PV}/${BPN}-${PV}.tar.gz \
file://0001-DefineInstallationPaths.cmake-Define-libdir-in-terms.patch \
file://0001-cmake-Use-idirafter-instead-of-isystem.patch \
"
SRC_URI[sha256sum] = "b272c1788bb165d99521a2599b31b97fa69e5931d099015d91ae107a0b0cc58f"
BBCLASSEXTEND = "native nativesdk"
CVE_PRODUCT = "apache:thrift"
inherit pkgconfig cmake python3native
export STAGING_INCDIR
export STAGING_LIBDIR
export BUILD_SYS
export HOST_SYS
EXTRA_OECMAKE = " \
-DBUILD_LIBRARIES=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_COMPILER=ON \
-DBUILD_TESTING=OFF \
-DBUILD_TUTORIALS=OFF \
-DWITH_AS3=OFF \
-DWITH_CPP=ON \
-DWITH_JAVA=OFF \
-DWITH_OPENSSL=ON \
-DWITH_QT5=OFF \
-DWITH_ZLIB=ON \
"
PACKAGECONFIG ??= "glib libevent"
PACKAGECONFIG[glib] = "-DWITH_C_GLIB=ON,-DWITH_C_GLIB=OFF,glib-2.0"
PACKAGECONFIG[libevent] = "-DWITH_LIBEVENT=ON,-DWITH_LIBEVENT=OFF,libevent"
PACKAGECONFIG[javascript] = "-DWITH_JAVASCRIPT=ON,-DWITH_JAVASCRIPT=OFF,nodejs"
PACKAGECONFIG[nodejs] = "-DWITH_NODEJS=ON,-DWITH_NODEJS=OFF,nodejs"
PACKAGECONFIG[python] = "-DWITH_PYTHON=ON,-DWITH_PYTHON=OFF,python"
do_install:append () {
ln -sf thrift ${D}/${bindir}/thrift-compiler
}
LEAD_SONAME = "libthrift.so.${PV}"
# thrift packages
PACKAGE_BEFORE_PN = "${PN}-compiler lib${BPN} lib${BPN}z lib${BPN}nb lib${BPN}-c-glib"
FILES:lib${BPN} = "${libdir}/libthrift.so.*"
FILES:lib${BPN}z = "${libdir}/libthriftz.so.*"
FILES:lib${BPN}nb = "${libdir}/libthriftnb.so.*"
FILES:lib${BPN}-c-glib = "${libdir}/libthrift_c_glib.so.*"
FILES:${PN}-compiler = "${bindir}/*"
# The thrift packages just pulls in some default dependencies but is otherwise empty
RRECOMMENDS:${PN} = "${PN}-compiler lib${BPN}"
ALLOW_EMPTY:${PN} = "1"
RRECOMMENDS:${PN}:class-native = ""
RRECOMMENDS:${PN}:class-nativesdk = ""