Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
003868b4 by Steve Lhomme at 2026-01-16T07:42:17+00:00
contrib: protobuf: only allow the exact same version of installed protobuf
We don't know exactly which compatibility is allowed or not. It doesn't hurt to
rebuild when we're not sure. And then we can use the PROTOBUF_VERSION variable
consistently.
(cherry picked from commit fc75a318d85232bed66adaf72e70b11deb94f975) (rebased)
rebased:
- in 4.0 protoc is also handled here
- - - - -
7c2189a3 by Steve Lhomme at 2026-01-16T07:42:17+00:00
contrib: protobuf: build using CMake
Just like protoc.
(cherry picked from commit 262eeeced8c9ced604758141eaef8b5bf70300d8) (edited)
edited:
- 4.0 was using the autotools macros to build out of tree
- 4.0 also handles protoc
- - - - -
84bc1197 by Steve Lhomme at 2026-01-16T07:42:17+00:00
contrib: protobuf: disable protoc using a patch
There is no protobuf_BUILD_PROTOC_BINARIES option in 3.4.1.
And older CMake and/or macOS patching doesn't work well with a dummy function.
- - - - -
2 changed files:
- + contrib/src/protobuf/0001-don-t-build-and-install-protoc-libprotoc.patch
- contrib/src/protobuf/rules.mak
Changes:
=====================================
contrib/src/protobuf/0001-don-t-build-and-install-protoc-libprotoc.patch
=====================================
@@ -0,0 +1,45 @@
+From a5fbd5d2b7358ff1e5b34828bf001a29b7123cd8 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <[email protected]>
+Date: Wed, 14 Jan 2026 11:18:27 +0100
+Subject: [PATCH] don't build and install protoc/libprotoc
+
+---
+ cmake/install.cmake | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/install.cmake b/cmake/install.cmake
+index 441bf5532..eda5acaad 100644
+--- a/cmake/install.cmake
++++ b/cmake/install.cmake
+@@ -8,7 +8,7 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
+ foreach(_library
+ libprotobuf-lite
+ libprotobuf
+- libprotoc)
++ )
+ set_property(TARGET ${_library}
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ $<BUILD_INTERFACE:${protobuf_source_dir}/src>
+@@ -19,8 +19,8 @@ foreach(_library
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library})
+ endforeach()
+
+-install(TARGETS protoc EXPORT protobuf-targets
+- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
++# install(TARGETS protoc EXPORT protobuf-targets
++# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc
${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION
"${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+
+@@ -101,7 +101,7 @@ configure_file(protobuf-options.cmake
+ ${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY)
+
+ # Allows the build directory to be used as a find directory.
+-export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
++export(TARGETS libprotobuf-lite libprotobuf
+ NAMESPACE protobuf::
+ FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
+ )
+--
+2.52.0.windows.1
+
=====================================
contrib/src/protobuf/rules.mak
=====================================
@@ -3,7 +3,7 @@ PROTOBUF_VERSION := 3.4.1
PROTOBUF_URL :=
$(GITHUB)/google/protobuf/releases/download/v$(PROTOBUF_VERSION)/protobuf-cpp-$(PROTOBUF_VERSION).tar.gz
PKGS += protobuf
-ifeq ($(call need_pkg, "protobuf-lite >= 3.1.0 protobuf-lite < 3.2.0"),)
+ifeq ($(call need_pkg, "protobuf-lite = $(PROTOBUF_VERSION)"),)
PKGS_FOUND += protobuf
endif
@@ -14,27 +14,25 @@ $(TARBALLS)/protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz:
DEPS_protobuf = zlib $(DEPS_zlib)
-PROTOBUFVARS := DIST_LANG="cpp"
+PROTOBUF_COMMON_CONF := -Dprotobuf_BUILD_TESTS=OFF
-Dprotobuf_DEBUG_POSTFIX:STRING=
+PROTOBUF_CONF := $(PROTOBUF_COMMON_CONF)
protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf
$(UNPACK)
$(RM) -Rf $(UNPACK_DIR)
mv protobuf-$(PROTOBUF_VERSION) protobuf-$(PROTOBUF_VERSION)-cpp
- # don't build benchmarks and conformance
- sed -i.orig 's, conformance benchmarks,,' "$(UNPACK_DIR)/Makefile.am"
- sed -i.orig 's, benchmarks/Makefile conformance/Makefile,,'
"$(UNPACK_DIR)/configure.ac"
- # don't use gmock or any sub project to configure
- sed -i.orig 's,AC_CONFIG_SUBDIRS,dnl AC_CONFIG_SUBDIRS,'
"$(UNPACK_DIR)/configure.ac"
+ $(APPLY)
$(SRC)/protobuf/0001-don-t-build-and-install-protoc-libprotoc.patch
+ # don't build libprotoc
+ sed -i.orig -e 's,include(libprotoc,#include(libprotoc,'
$(UNPACK_DIR)/cmake/CMakeLists.txt
# don't build protoc
- sed -i.orig 's,bin_PROGRAMS,#bin_PROGRAMS,'
"$(UNPACK_DIR)/src/Makefile.am"
- sed -i.orig 's,BUILT_SOURCES,#BUILT_SOURCES,'
"$(UNPACK_DIR)/src/Makefile.am"
- sed -i.orig 's,libprotobuf-lite.la libprotobuf.la
libprotoc.la,libprotobuf-lite.la libprotobuf.la,'
"$(UNPACK_DIR)/src/Makefile.am"
+ sed -i.orig -e 's,include(protoc,#include(protoc,'
$(UNPACK_DIR)/cmake/CMakeLists.txt
# force include <algorithm>
sed -i.orig 's,#ifdef _MSC_VER,#if 1,'
"$(UNPACK_DIR)/src/google/protobuf/repeated_field.h"
$(MOVE)
-.protobuf: protobuf
- $(RECONF)
- cd $< && $(HOSTVARS) $(PROTOBUFVARS) ./configure $(HOSTCONF)
--with-protoc="$(PROTOC)"
- $(MAKE) -C $< && $(MAKE) -C $< install
+.protobuf: protobuf toolchain.cmake
+ $(CMAKECLEAN)
+ $(HOSTVARS) $(CMAKE) -S $</cmake $(PROTOBUF_CONF)
+ +$(CMAKEBUILD)
+ $(CMAKEINSTALL)
touch $@
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/feada68ef67ff6d94e39e7b63ffdef3203aa5563...84bc1197088570417ef505e99f7e7e2b380a854d
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/feada68ef67ff6d94e39e7b63ffdef3203aa5563...84bc1197088570417ef505e99f7e7e2b380a854d
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits