Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[protobuf] Update to version 3.19.3 #21485

Closed
wants to merge 20 commits into from
Closed
11 changes: 0 additions & 11 deletions ports/protobuf/fix-mingw-build.patch

This file was deleted.

10 changes: 5 additions & 5 deletions ports/protobuf/fix-static-build.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff --git a/cmake/install.cmake b/cmake/install.cmake
index ef5bb13..e2d4acb 100644
index 4e1c5de..d3aa865 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -33,7 +33,7 @@ if (protobuf_BUILD_PROTOC_BINARIES)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT protoc)
@@ -32,7 +32,7 @@ if (protobuf_BUILD_PROTOC_BINARIES)
install(TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
- if (UNIX AND NOT APPLE)
+ if (UNIX AND NOT APPLE AND NOT protobuf_MSVC_STATIC_RUNTIME)
set_property(TARGET protoc
Expand Down
13 changes: 0 additions & 13 deletions ports/protobuf/fix-uwp-build.patch

This file was deleted.

38 changes: 18 additions & 20 deletions ports/protobuf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO protocolbuffers/protobuf
REF v3.18.0
SHA512 2c8ff451b54120e4670f7ea8c92c0c7d70f4bb781979f74f59ddcb7c9cc74fe3e8910fc579d2686fb0e1aafa35fb9548ccab667accf2358c71cfd17ba38d7826
REF cc7b1b53234cd7a8f50d90ac3933b240dcf4cd97 #3.19.3
SHA512 0e16a795a43715c636f5cc8ae70f972a178263cfe70b3ebf7310db934eca5337136a89cb8994347adedc92fa3c44f7f05bf1d20a1ec0d458eb40960d8bc58cc0
HEAD_REF master
PATCHES
fix-static-build.patch
fix-default-proto-file-path.patch
fix-uwp-build.patch
fix-mingw-build.patch
)

string(COMPARE EQUAL "${TARGET_TRIPLET}" "${HOST_TRIPLET}" protobuf_BUILD_PROTOC_BINARIES)
Expand Down Expand Up @@ -58,52 +56,52 @@ function(protobuf_try_remove_recurse_wait PATH_TO_REMOVE)
endif()
endfunction()

protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/include)
protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/debug/include")

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake"
"\${_IMPORT_PREFIX}/bin/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}"
"\${_IMPORT_PREFIX}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}"
)
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/protobuf/protobuf-targets-debug.cmake DEBUG_MODULE)
file(READ "${CURRENT_PACKAGES_DIR}/debug/share/protobuf/protobuf-targets-debug.cmake" DEBUG_MODULE)
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}")
string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}" DEBUG_MODULE "${DEBUG_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake" "${DEBUG_MODULE}")
endif()

protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share)
protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/debug/share")

if(protobuf_BUILD_PROTOC_BINARIES)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_copy_tools(TOOL_NAMES protoc AUTO_CLEAN)
else()
vcpkg_copy_tools(TOOL_NAMES protoc protoc-3.18.0.0 AUTO_CLEAN)
vcpkg_copy_tools(TOOL_NAMES protoc protoc-3.19.3.0 AUTO_CLEAN)
endif()
else()
file(COPY ${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
file(COPY "${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools")
endif()

vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-config.cmake
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-config.cmake"
"if(protobuf_MODULE_COMPATIBLE)"
"if(ON)"
)
if(NOT protobuf_BUILD_LIBPROTOC)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-module.cmake
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-module.cmake"
"_protobuf_find_libraries(Protobuf_PROTOC protoc)"
""
)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin)
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin)
protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/bin")
protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h"
"\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_"
"\#ifndef PROTOBUF_USE_DLLS\n\#define PROTOBUF_USE_DLLS\n\#endif // PROTOBUF_USE_DLLS\n\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_"
)
Expand All @@ -112,7 +110,7 @@ endif()
vcpkg_copy_pdbs()
set(packages protobuf protobuf-lite)
foreach(_package IN LISTS packages)
set(_file ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_package}.pc)
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_package}.pc")
if(EXISTS "${_file}")
vcpkg_replace_string(${_file} "-l${_package}" "-l${_package}d")
endif()
Expand All @@ -121,8 +119,8 @@ endforeach()
vcpkg_fixup_pkgconfig()

if(NOT protobuf_BUILD_PROTOC_BINARIES)
configure_file(${CMAKE_CURRENT_LIST_DIR}/protobuf-targets-vcpkg-protoc.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-targets-vcpkg-protoc.cmake COPYONLY)
configure_file("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets-vcpkg-protoc.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-targets-vcpkg-protoc.cmake" COPYONLY)
endif()

configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
4 changes: 2 additions & 2 deletions ports/protobuf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "protobuf",
"version-semver": "3.18.0",
"port-version": 1,
"version-semver": "3.19.3",
"description": "Protocol Buffers - Google's data interchange format",
"homepage": "https://github.com/protocolbuffers/protobuf",
"license": "BSD-3-Clause",
"dependencies": [
{
"name": "protobuf",
Expand Down
13 changes: 13 additions & 0 deletions ports/protozero/fix-builderror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9702d6..bd41cbe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,7 @@ if(MSVC)
add_definitions(/W3)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
else()
- add_definitions(-std=c++11 -Wall -Wextra -pedantic -Wsign-compare -Wunused-parameter -Wno-float-equal -Wno-covered-switch-default)
+ add_definitions(-std=c++17 -Wall -Wextra -pedantic -Wsign-compare -Wunused-parameter -Wno-float-equal -Wno-covered-switch-default)
if(WERROR)
add_definitions(-Werror)
endif()
11 changes: 5 additions & 6 deletions ports/protozero/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mapbox/protozero
SHA512 d09a34865c535264c52f9c605ccb6f453c357f5e3a7b0dc72b097de288eabc6985a5b81ddbe79c47d0af2d8f74e33bd380fefce47acb15d8d51d5c151d71786b
REF v1.7.0
HEAD_REF master
PATCHES fix-builderror.patch
)


vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug")
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
8 changes: 7 additions & 1 deletion ports/protozero/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "protozero",
"version-semver": "1.7.0",
"port-version": 1,
"description": "Minimalist protocol buffer decoder and encoder in C++",
"homepage": "https://github.com/mapbox/protozero",
"license": "BSD-2-Clause",
"dependencies": [
"protobuf"
"protobuf",
{
"name": "vcpkg-cmake",
"host": true
}
]
}
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5465,8 +5465,8 @@
"port-version": 0
},
"protobuf": {
"baseline": "3.18.0",
"port-version": 1
"baseline": "3.19.3",
"port-version": 0
},
"protobuf-c": {
"baseline": "1.4.0",
Expand All @@ -5478,7 +5478,7 @@
},
"protozero": {
"baseline": "1.7.0",
"port-version": 0
"port-version": 1
},
"proxygen": {
"baseline": "2021.06.14.00",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/protobuf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "78b4bbda932796c36959dc1314b9d5cf600ae765",
"version-semver": "3.19.3",
"port-version": 0
},
{
"git-tree": "5f6aa04d94e184b89c1887946fb4684bc51c4611",
"version-semver": "3.18.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/protozero.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "50ca21eda1bfb2821729951826fb42ce7ba28c8c",
"version-semver": "1.7.0",
"port-version": 1
},
{
"git-tree": "23f6ec11be6bbf623dc7590b128027ccb7f69727",
"version-semver": "1.7.0",
Expand Down