Skip to content

Commit 7924a15

Browse files
jcar87CJCombrink
andauthored
thrift: add 0.21.0 (#28738)
* thrift: added version 0.21.0 - break up cmake-0.16.0.patch into parts and update due to changes in thrift * Add thrift 0.22.0 * thrift: add cmake tool requires * only add 0.21.0 --------- Co-authored-by: Carel Combrink <[email protected]>
1 parent 5c0809e commit 7924a15

File tree

6 files changed

+144
-0
lines changed

6 files changed

+144
-0
lines changed

recipes/thrift/all/conandata.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"0.21.0":
3+
url: "http://archive.apache.org/dist/thrift/0.21.0/thrift-0.21.0.tar.gz"
4+
sha256: "9a24f3eba9a4ca493602226c16d8c228037db3b9291c6fc4019bfe3bd39fc67c"
25
"0.20.0":
36
url: "https://archive.apache.org/dist/thrift/0.20.0/thrift-0.20.0.tar.gz"
47
sha256: "b5d8311a779470e1502c027f428a1db542f5c051c8e1280ccd2163fa935ff2d6"
@@ -21,6 +24,16 @@ sources:
2124
url: "https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz"
2225
sha256: "13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5"
2326
patches:
27+
"0.21.0":
28+
- patch_file: "patches/cmake-0.21.0-001-install-dir.patch"
29+
patch_description: "Patch install dir on MSVC"
30+
patch_type: "conan"
31+
- patch_file: "patches/cmake-0.21.0-002-conan-libs.patch"
32+
patch_description: "Parts of cmake-0.16.0.patch that does not need changing"
33+
patch_type: "conan"
34+
- patch_file: "patches/cmake-0.21.0-003-conan-libs.patch"
35+
patch_description: "Patch conan libs in the thrift lib cmake"
36+
patch_type: "conan"
2437
"0.20.0":
2538
- patch_file: "patches/cmake-0.16.0.patch"
2639
- patch_file: "patches/0.15.0-0002-include-cstdint.patch"

recipes/thrift/all/conanfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def requirements(self):
7272
if self.options.with_qt5:
7373
self.requires("qt/5.15.13")
7474

75+
self.tool_requires("cmake/[>=3.16]")
76+
7577
def build_requirements(self):
7678
if self.settings_build.os == "Windows":
7779
self.tool_requires("winflexbison/2.5.25")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake
2+
--- a/build/cmake/DefineInstallationPaths.cmake
3+
+++ b/build/cmake/DefineInstallationPaths.cmake
4+
@@ -20,13 +20,7 @@
5+
6+
# Define the default install paths
7+
set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)")
8+
-# For MSVC builds, install shared libs to bin/, while keeping the install
9+
-# dir for static libs as lib/.
10+
-if(MSVC AND BUILD_SHARED_LIBS)
11+
- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})")
12+
-else()
13+
- set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
14+
-endif()
15+
+set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
16+
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
17+
set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
18+
set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)")
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
2+
index 3cca31e..ffc2811 100644
3+
--- a/build/cmake/DefineOptions.cmake
4+
+++ b/build/cmake/DefineOptions.cmake
5+
@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON)
6+
# and enables the library if all are found. This means the default is to build as
7+
# much as possible but leaving out libraries if their dependencies are not met.
8+
9+
-if (NOT Boost_USE_STATIC_LIBS)
10+
- add_definitions(-DBOOST_ALL_DYN_LINK)
11+
- add_definitions(-DBOOST_TEST_DYN_LINK)
12+
-endif()
13+
-
14+
# as3
15+
option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON)
16+
if (WITH_AS3)
17+
@@ -90,6 +85,7 @@ if(WITH_CPP OR WITH_C_GLIB)
18+
find_package(OpenSSL QUIET)
19+
CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
20+
"OPENSSL_FOUND" OFF)
21+
+ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON)
22+
endif()
23+
24+
# Java
25+
@@ -106,14 +102,10 @@ else()
26+
endif()
27+
28+
# Javascript
29+
-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON)
30+
-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON
31+
- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF)
32+
+option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF)
33+
34+
# NodeJS
35+
-option(WITH_NODEJS "Build NodeJS Thrift library" ON)
36+
-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON
37+
- "BUILD_LIBRARIES;WITH_NODEJS" OFF)
38+
+option(WITH_NODEJS "Build NodeJS Thrift library" OFF)
39+
40+
# Python
41+
option(WITH_PYTHON "Build Python Thrift library" ON)
42+
diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt
43+
index 218f7dd..b879830 100644
44+
--- a/lib/c_glib/CMakeLists.txt
45+
+++ b/lib/c_glib/CMakeLists.txt
46+
@@ -71,7 +71,8 @@ set(thrift_c_glib_zlib_SOURCES
47+
)
48+
49+
# If OpenSSL is not found just ignore the OpenSSL stuff
50+
-if(OPENSSL_FOUND AND WITH_OPENSSL)
51+
+if(WITH_OPENSSL)
52+
+ find_package(OpenSSL REQUIRED)
53+
list(APPEND thrift_c_glib_SOURCES
54+
src/thrift/c_glib/transport/thrift_ssl_socket.c
55+
)
56+
@@ -83,8 +84,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL)
57+
list(APPEND SYSLIBS OpenSSL::Crypto)
58+
endif()
59+
else()
60+
- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
61+
- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
62+
+ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto)
63+
endif()
64+
endif()
65+
66+
67+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
2+
--- a/lib/cpp/CMakeLists.txt
3+
+++ b/lib/cpp/CMakeLists.txt
4+
@@ -97,7 +97,8 @@
5+
endif()
6+
7+
# If OpenSSL is not found or disabled just ignore the OpenSSL stuff
8+
-if(OPENSSL_FOUND AND WITH_OPENSSL)
9+
+if(WITH_OPENSSL)
10+
+ find_package(OpenSSL REQUIRED)
11+
list(APPEND thriftcpp_SOURCES
12+
src/thrift/transport/TSSLSocket.cpp
13+
src/thrift/transport/TSSLServerSocket.cpp
14+
@@ -112,8 +113,7 @@
15+
list(APPEND SYSLIBS OpenSSL::Crypto)
16+
endif()
17+
else()
18+
- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
19+
- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
20+
+ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto)
21+
endif()
22+
endif()
23+
24+
@@ -168,16 +168,11 @@
25+
26+
if(WITH_LIBEVENT)
27+
find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream
28+
- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS})
29+
30+
ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES})
31+
target_link_libraries(thriftnb PUBLIC thrift)
32+
- if(TARGET libevent::core AND TARGET libevent::extra)
33+
- # libevent was found via its cmake config, use modern style targets
34+
- target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra)
35+
- else()
36+
- target_link_libraries(thriftnb PUBLIC ${LIBEVENT_LIBRARIES})
37+
- endif()
38+
+ # libevent was found via its cmake config, use modern style targets
39+
+ target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra)
40+
ADD_PKGCONFIG_THRIFT(thrift-nb)
41+
endif()
42+

recipes/thrift/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
versions:
2+
"0.21.0":
3+
folder: all
24
"0.20.0":
35
folder: all
46
"0.18.1":

0 commit comments

Comments
 (0)