From e16a8ac6dcf5abba47098f076c9940e3df4dde07 Mon Sep 17 00:00:00 2001 From: Liu Chenxin Date: Thu, 13 Jan 2022 03:34:24 +0800 Subject: [PATCH] [protobuf] fix protobuf-3.18 mingw build failure (#22369) * fix protobuf-3.18 mingw build * fix protobuf-3.18 mingw build --- ports/protobuf/fix-mingw-build.patch | 11 +++++++++++ ports/protobuf/portfile.cmake | 1 + ports/protobuf/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/p-/protobuf.json | 5 +++++ 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 ports/protobuf/fix-mingw-build.patch diff --git a/ports/protobuf/fix-mingw-build.patch b/ports/protobuf/fix-mingw-build.patch new file mode 100644 index 0000000000..8ad496c9b7 --- /dev/null +++ b/ports/protobuf/fix-mingw-build.patch @@ -0,0 +1,11 @@ +--- a/src/google/protobuf/io/zero_copy_stream_impl.cc 2021-09-15 00:48:28.000000000 +0800 ++++ b/src/google/protobuf/io/zero_copy_stream_impl.cc 2022-01-06 15:19:12.657413400 +0800 +@@ -104,7 +104,7 @@ + is_closed_(false), + errno_(0), + previous_seek_failed_(false) { +-#ifndef _MSC_VER ++#ifndef _WIN32 + int flags = fcntl(file_, F_GETFL); + flags &= ~O_NONBLOCK; + fcntl(file_, F_SETFL, flags); diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 8395eeae5d..bafe37edb0 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( 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) diff --git a/ports/protobuf/vcpkg.json b/ports/protobuf/vcpkg.json index c75206275c..18d816edcd 100644 --- a/ports/protobuf/vcpkg.json +++ b/ports/protobuf/vcpkg.json @@ -1,6 +1,7 @@ { "name": "protobuf", "version-semver": "3.18.0", + "port-version": 1, "description": "Protocol Buffers - Google's data interchange format", "homepage": "https://github.com/protocolbuffers/protobuf", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 2a4ec123ed..d26bb1a1c0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5446,7 +5446,7 @@ }, "protobuf": { "baseline": "3.18.0", - "port-version": 0 + "port-version": 1 }, "protobuf-c": { "baseline": "1.4.0", diff --git a/versions/p-/protobuf.json b/versions/p-/protobuf.json index a91d6210ae..e416cf2963 100644 --- a/versions/p-/protobuf.json +++ b/versions/p-/protobuf.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5f6aa04d94e184b89c1887946fb4684bc51c4611", + "version-semver": "3.18.0", + "port-version": 1 + }, { "git-tree": "19c2bf45c235e6126161bae36aa7ff7e1fcda479", "version-semver": "3.18.0",