Skip to content

Commit

Permalink
[avro-cpp] Update to latest version (2022-11-07) (microsoft#27825)
Browse files Browse the repository at this point in the history
* [avro-cpp] Update to 1.11.1

* [avro-cpp] Update version file

* [Avro-cpp] Add "licence" to port file

Co-authored-by: MonicaLiu <110024546+MonicaLiu0311@users.noreply.github.com>

* [Avro-cpp] Fix HEAD_REF branch (revert to master)

* [avro-cpp] Update version file

* [avro-cpp] Fix build 'test' feature, update version

* [avro-cpp] Update version

* [avro-cpp] Update 'usage' file and replace deprecated function

* [avro-cpp] Update version

* [avro-cpp] Update 'usage' file

* [avro-cpp] Update version

* [avro-cpp] Update 'usage' file

* [avro-cpp] Update version

Co-authored-by: MonicaLiu <110024546+MonicaLiu0311@users.noreply.github.com>
  • Loading branch information
2 people authored and lukaszmoroz committed Nov 24, 2022
1 parent 3e3524d commit d3d3b50
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 68 deletions.
33 changes: 0 additions & 33 deletions ports/avro-cpp/fix-windows-build.patch

This file was deleted.

30 changes: 20 additions & 10 deletions ports/avro-cpp/install.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index bf764ce4..e84524d0 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -48,6 +48,8 @@ list(GET AVRO_VERSION 2 AVRO_VERSION_PATCH)
diff --git "a/lang/c++/CMakeLists.txt" "b/lang/c++/CMakeLists.txt"
index 52d6ac8a..39d59cd8 100644
--- "a/lang/c++/CMakeLists.txt"
+++ "b/lang/c++/CMakeLists.txt"
@@ -51,6 +51,8 @@ list(GET AVRO_VERSION 2 AVRO_VERSION_PATCH)
project (Avro-cpp)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})

Expand All @@ -11,7 +11,17 @@ index bf764ce4..e84524d0 100644
if (WIN32 AND NOT CYGWIN AND NOT MSYS)
add_definitions (/EHa)
add_definitions (
@@ -125,12 +127,12 @@ set_target_properties (avrocpp PROPERTIES
@@ -64,7 +66,8 @@ if (WIN32 AND NOT CYGWIN AND NOT MSYS)
endif()

if (CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror")
+ # Remove " -Werror" because of warning from boost-math (will require C++ 14 soon)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
if (AVRO_ADD_PROTECTOR_FLAGS)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstack-protector-all -D_GLIBCXX_DEBUG")
# Unset _GLIBCXX_DEBUG for avrogencpp.cc because using Boost Program Options
@@ -131,12 +134,12 @@ set_target_properties (avrocpp PROPERTIES
set_target_properties (avrocpp_s PROPERTIES
VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}.${AVRO_VERSION_PATCH})

Expand All @@ -26,7 +36,7 @@ index bf764ce4..e84524d0 100644

macro (gen file ns)
add_custom_command (OUTPUT ${file}.hh
@@ -160,37 +162,42 @@ gen (primitivetypes pt)
@@ -166,37 +169,41 @@ gen (primitivetypes pt)
gen (cpp_reserved_words cppres)

add_executable (avrogencpp impl/avrogencpp.cc)
Expand All @@ -39,8 +49,9 @@ index bf764ce4..e84524d0 100644
+endif()

macro (unittest name)
add_executable (${name} test/${name}.cc)
- add_executable (${name} test/${name}.cc)
- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
+ add_executable (${name} test/${name}.cc impl/json/JsonIO.cc impl/json/JsonDom.cc)
+ target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name})
Expand Down Expand Up @@ -87,12 +98,11 @@ index bf764ce4..e84524d0 100644
+ union_array_union_hh union_map_union_hh union_conflict_hh
+ recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh
+ primitivetypes_hh empty_record_hh)
+
+endif()

include (InstallRequiredSystemLibraries)

@@ -201,9 +208,9 @@ include (CPack)
@@ -207,9 +214,9 @@ include (CPack)
install (TARGETS avrocpp avrocpp_s
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
Expand Down
25 changes: 11 additions & 14 deletions ports/avro-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,31 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/avro
REF 2ab8fa85d05f04387bd5d63b10ad1c8fd2243616
SHA512 fd21f0919b0e5e884bdf4d66c4d5ba056f04c426b309ec0b5ab26642a5f6b00d46f4dd965431b10130bc5f0d81699e2195780e90e127f63049ee5763403ef7c8
REF e44b680621328c4e6524bd2983af1ce11afeebed
SHA512 932f642f272997b5c0be467d3a3ccc354c6edf425c36b33aa7e61984f67312c712bb1d74cb1a5fd8066169104851e73830f0ed3fdb450e005a5c5bef33c34f20
HEAD_REF master
PATCHES
install.patch
fix-windows-build.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
test BUILD_TESTING
INVERTED_FEATURES
snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy
snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/lang/c++
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/lang/c++"
OPTIONS
-DBUILD_TESTING=OFF
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DAVRO_ADD_PROTECTOR_FLAGS=1
)

vcpkg_install_cmake(ADD_BIN_TO_PATH)
vcpkg_cmake_install(ADD_BIN_TO_PATH)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL ${SOURCE_PATH}/lang/c++/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/lang/c++/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
9 changes: 9 additions & 0 deletions ports/avro-cpp/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The package avro-cpp can be used from CMake via:

find_path(AVROCPP_INCLUDE_DIR avro/Encoder.hh)
find_library(AVROCPP_LIBRARY_DEBUG avrocpp PATH_SUFFIXES "debug/lib" REQUIRED)
get_filename_component(AVROCPP_ROOT_FIND_DIR ${AVROCPP_INCLUDE_DIR} DIRECTORY)
find_library(AVROCPP_LIBRARY_RELEASE avrocpp PATHS "${AVROCPP_ROOT_FIND_DIR}/lib/" REQUIRED NO_DEFAULT_PATH)

target_include_directories(main PRIVATE "${AVROCPP_INCLUDE_DIR}")
target_link_libraries(main PRIVATE optimized "${AVROCPP_LIBRARY_RELEASE}" debug "${AVROCPP_LIBRARY_DEBUG}")
30 changes: 21 additions & 9 deletions ports/avro-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
{
"name": "avro-cpp",
"version-date": "2021-06-01",
"port-version": 1,
"version-date": "2022-11-07",
"description": "Apache Avro is a data serialization system",
"homepage": "https://github.com/apache/avro",
"license": "Apache-2.0",
"supports": "!(windows & static)",
"dependencies": [
"boost-algorithm",
"boost-any",
"boost-crc",
"boost-filesystem",
"boost-format",
"boost-iostreams",
"boost-lexical-cast",
"boost-math",
"boost-program-options",
"boost-random",
"boost-test",
"boost-thread",
"bzip2",
"liblzma",
"libzip",
"zlib",
"zstd"
"boost-tuple",
{
"name": "vcpkg-cmake",
"host": true
},
"zlib"
],
"features": {
"snappy": {
"description": "Support Snappy for compression",
"dependencies": [
"snappy"
]
},
"test": {
"description": "Build tests",
"dependencies": [
"boost-asio",
"boost-bind",
"boost-smart-ptr",
"boost-test",
"boost-thread"
]
}
}
}
5 changes: 5 additions & 0 deletions versions/a-/avro-cpp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "08f82323ee0bb00a297cc1318c04dd3bce5d963e",
"version-date": "2022-11-07",
"port-version": 0
},
{
"git-tree": "7804bfb279bdea0b9e270f010e1683b9b8d7ee38",
"version-date": "2021-06-01",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@
"port-version": 3
},
"avro-cpp": {
"baseline": "2021-06-01",
"port-version": 1
"baseline": "2022-11-07",
"port-version": 0
},
"aws-c-auth": {
"baseline": "0.6.3",
Expand Down

0 comments on commit d3d3b50

Please sign in to comment.