From b43e610586f8d20ea007ea5d963e50a2fd3bc8ed Mon Sep 17 00:00:00 2001 From: Pierre Lamot Date: Tue, 28 Oct 2025 11:40:48 +0100 Subject: [PATCH] contrib: protobuf: prioritize internal include path over zlib include directories --- ...nal-include-path-over-zlib-include-d.patch | 31 +++++++++++++++++++ contrib/src/protobuf/rules.mak | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 contrib/src/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch diff --git a/contrib/src/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch b/contrib/src/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch new file mode 100644 index 0000000000..ed5be9c413 --- /dev/null +++ b/contrib/src/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch @@ -0,0 +1,31 @@ +From 951c32bb0ee6467c2ae35b8402513ed2cf3292db Mon Sep 17 00:00:00 2001 +From: Pierre Lamot +Date: Tue, 28 Oct 2025 11:30:43 +0100 +Subject: [PATCH] prioritize internal include path over zlib include + directories + +this fix compilation when older protobuf headers are present in zlib include +path +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 04cb330..f8579a1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -296,9 +296,9 @@ else (MSVC) + endif (MSVC) + + include_directories( +- ${ZLIB_INCLUDE_DIRECTORIES} + ${protobuf_BINARY_DIR} +- ${protobuf_SOURCE_DIR}/src) ++ ${protobuf_SOURCE_DIR}/src ++ ${ZLIB_INCLUDE_DIRECTORIES}) + + if (protobuf_UNICODE) + add_definitions(-DUNICODE -D_UNICODE) +-- +2.43.0 + diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak index e46fc10919..0d5a19bd4f 100644 --- a/contrib/src/protobuf/rules.mak +++ b/contrib/src/protobuf/rules.mak @@ -48,6 +48,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc $(RM) -Rf $@ $(UNPACK_DIR) && mkdir -p $(UNPACK_DIR) tar $(TAR_VERBOSE)xzfo "$<" -C $(UNPACK_DIR) --strip-components=1 $(APPLY) $(SRC)/protobuf/0001-Fix-9947-make-the-ABI-identical-between-debug-and-no.patch + $(APPLY) $(SRC)/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch # add a dummy install command to disable some installation sed -i.old '1s;^;function (noinstall ...)\nendfunction()\n;' $(UNPACK_DIR)/cmake/install.cmake # don't install pkg-config files (on top of the target ones) @@ -73,6 +74,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc protobuf: protobuf-$(PROTOBUF_PACKAGE).tar.gz .sum-protobuf $(UNPACK) $(APPLY) $(SRC)/protobuf/0001-Fix-9947-make-the-ABI-identical-between-debug-and-no.patch + $(APPLY) $(SRC)/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch # add a dummy install command to disable some installation sed -i.old '1s;^;function (noinstall ...)\nendfunction()\n;' $(UNPACK_DIR)/cmake/install.cmake # don't build libprotoc