Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 6 additions & 83 deletions ports/avro-cpp/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -1,97 +1,20 @@
diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index 19059a4..c49e9c2 100644
index 6800d330f..c9ec221d9 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -58,17 +58,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
if (WIN32 AND NOT CYGWIN AND NOT MSYS)
@@ -70,12 +70,12 @@ if (WIN32 AND NOT CYGWIN AND NOT MSYS)
add_definitions (/EHa)
add_definitions (
- -DNOMINMAX
- -DBOOST_REGEX_DYN_LINK
- -DBOOST_FILESYSTEM_DYN_LINK
-DNOMINMAX
- -DBOOST_SYSTEM_DYN_LINK
- -DBOOST_IOSTREAMS_DYN_LINK
- -DBOOST_PROGRAM_OPTIONS_DYN_LINK
- -DBOOST_ALL_NO_LIB)
+ -DNOMINMAX)
+ )
endif()

if (CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-cast -Wconversion -pedantic -Werror")
+ # Remove " -Werror" because of warning from boost-math (will require C++ 14 soon)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-cast -Wconversion -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
@@ -82,16 +77,7 @@ endif ()
find_package (Boost 1.38 REQUIRED
COMPONENTS filesystem iostreams program_options regex system)
endif ()

-include(FetchContent)
-FetchContent_Declare(
- fmt
- GIT_REPOSITORY https://github.com/fmtlib/fmt.git
- GIT_TAG 10.2.1
- GIT_PROGRESS TRUE
- USES_TERMINAL_DOWNLOAD TRUE
-)
-FetchContent_MakeAvailable(fmt)
-
+find_package(fmt CONFIG REQUIRED)
find_package(Snappy)
if (SNAPPY_FOUND)
set(SNAPPY_PKG libsnappy)
@@ -128,7 +114,7 @@ set (AVRO_SOURCE_FILES
impl/CustomAttributes.cc
)

-add_library (avrocpp SHARED ${AVRO_SOURCE_FILES})
+add_library (avrocpp ${AVRO_SOURCE_FILES})

set_property (TARGET avrocpp
APPEND PROPERTY COMPILE_DEFINITIONS AVRO_DYN_LINK)
@@ -194,6 +180,7 @@ target_include_directories(avrocpp PUBLIC
$<INSTALL_INTERFACE:include>
)

+if(BUILD_TESTING)
enable_testing()

macro (unittest name)
@@ -220,23 +207,26 @@ unittest (CommonsSchemasTests)
add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh)

add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh
- tweet_hh
- 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 cpp_reserved_words_union_typedef_hh
- union_empty_record_hh)
-
+ tweet_hh
+ 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 cpp_reserved_words_union_typedef_hh
+ union_empty_record_hh)
+endif()
include (InstallRequiredSystemLibraries)

set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}")

include (CPack)

-install (TARGETS avrocpp avrocpp_s
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
- RUNTIME DESTINATION lib)
+install(TARGETS avrocpp EXPORT unofficial-avro-cpp)

+install(
+ EXPORT unofficial-avro-cpp
+ FILE unofficial-avro-cpp-config.cmake
+ DESTINATION share/unofficial-avro-cpp
+ NAMESPACE unofficial::avro-cpp::
+)
install (TARGETS avrogencpp RUNTIME DESTINATION bin)

install (DIRECTORY include/avro DESTINATION include
if (AVRO_BUILD_TESTS OR AVRO_USE_BOOST)
38 changes: 0 additions & 38 deletions ports/avro-cpp/fix-fmt.patch

This file was deleted.

12 changes: 0 additions & 12 deletions ports/avro-cpp/fix-std32_t.patch

This file was deleted.

39 changes: 13 additions & 26 deletions ports/avro-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,39 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/avro
REF "release-${VERSION}"
SHA512 8cc6ef3cf1e0a919118c8ba5817a1866dc4f891fa95873c0fe1b4b388858fbadee8ed50406fa0006882cab40807fcf00c5a2dcd500290f3868d9d06b287eacb6
SHA512 4e7fd7ebb41f6149a499d0d38babd99d07f936143b47a60f7c568a589fb0e6369301c7230bde518b554eaeaa9ded1ed1fae2661cbd5ebc49fb5f22d97c066f05
HEAD_REF master
PATCHES
fix-cmake.patch
fix-fmt.patch
fix-std32_t.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools AVRO_BUILD_EXECUTABLES
INVERTED_FEATURES
snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/lang/c++"
OPTIONS
-DBUILD_TESTING=OFF
-DAVRO_BUILD_STATIC=${BUILD_STATIC}
-DAVRO_BUILD_SHARED=${BUILD_SHARED}
-DAVRO_BUILD_TESTS=OFF
${FEATURE_OPTIONS}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})

file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-avro-cpp/unofficial-avro-cpp-config.cmake" cmake_config)
if("snappy" IN_LIST FEATURES)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-avro-cpp/unofficial-avro-cpp-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(Boost REQUIRED COMPONENTS filesystem iostreams program_options regex system)
find_dependency(fmt CONFIG)
find_dependency(Snappy)
${cmake_config}
")
else()
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-avro-cpp/unofficial-avro-cpp-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(Boost REQUIRED COMPONENTS filesystem iostreams program_options regex system)
find_dependency(fmt CONFIG)
${cmake_config}
")
endif()

vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/avro-cpp")
vcpkg_copy_pdbs()
vcpkg_copy_tools(TOOL_NAMES avrogencpp AUTO_CLEAN)
if(AVRO_BUILD_EXECUTABLES)
vcpkg_copy_tools(TOOL_NAMES avrogencpp AUTO_CLEAN)
endif()

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

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/lang/c++/LICENSE")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
4 changes: 2 additions & 2 deletions ports/avro-cpp/usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
avro-cpp provides CMake targets:

find_package(unofficial-avro-cpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::avro-cpp::avrocpp)
find_package(avro-cpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE avro-cpp::avrocpp)
18 changes: 5 additions & 13 deletions ports/avro-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
{
"name": "avro-cpp",
"version": "1.12.0",
"port-version": 2,
"version": "1.12.1",
"description": "Apache Avro is a data serialization system",
"homepage": "https://github.com/apache/avro",
"license": "Apache-2.0",
"supports": "!uwp",
"dependencies": [
"boost-algorithm",
"boost-any",
"boost-crc",
"boost-filesystem",
"boost-format",
"boost-iostreams",
"boost-lexical-cast",
"boost-math",
"boost-program-options",
"boost-random",
"boost-tuple",
Comment on lines -9 to -19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why these are removed?

Copy link
Contributor Author

@SunBlack SunBlack Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are just needed for the tests (apache/avro#3293) and search for boost includes

"fmt",
{
"name": "vcpkg-cmake",
Expand All @@ -34,6 +23,9 @@
"dependencies": [
"snappy"
]
},
"tools": {
"description": "Build extra executables"
}
}
}
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": "05e75f00bd2a82451f3c9853885676592eef023f",
"version": "1.12.1",
"port-version": 0
},
{
"git-tree": "4ef85ccd3feb1c611ad245ab1ead9796b09b1bc9",
"version": "1.12.0",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@
"port-version": 0
},
"avro-cpp": {
"baseline": "1.12.0",
"port-version": 2
"baseline": "1.12.1",
"port-version": 0
},
"awlib": {
"baseline": "2024-04-06",
Expand Down