[vlc-commits] [Git][videolan/vlc][master] 3 commits: contrib: protobuf: don't prefix the protoc binary name

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 18 09:51:03 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
38c15b26 by Steve Lhomme at 2024-04-18T08:47:38+00:00
contrib: protobuf: don't prefix the protoc binary name

It only generates C++ files which are not platform specific.

We already assume that a "protoc" binary with the proper version is a valid protoc version.

- - - - -
fe873a47 by Steve Lhomme at 2024-04-18T08:47:38+00:00
contrib: protobuf: don't check for host-protoc

It only existed in the VLC repository but we don't build it anymore.

- - - - -
d5f62142 by Steve Lhomme at 2024-04-18T08:47:38+00:00
configure: don't check for host-protoc

It only existed in the VLC repository but we don't build it anymore.

- - - - -


2 changed files:

- configure.ac
- contrib/src/protobuf/rules.mak


Changes:

=====================================
configure.ac
=====================================
@@ -600,16 +600,6 @@ AS_IF([test -n "${CONTRIB_DIR}"], [
     ])
   ])
 
-  AS_IF([test -z "$PROTOC"], [
-    AC_MSG_CHECKING([if contribs provide protoc])
-    AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-protoc${BUILDEXEEXT}"], [
-      PROTOC="${CONTRIB_DIR}/../bin/${host_alias}-protoc${BUILDEXEEXT}"
-      AC_MSG_RESULT([yes])
-    ],[
-      AC_MSG_RESULT([no])
-    ])
-  ])
-
   AS_IF([test "${SYS}" = "darwin"], [
     export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
     export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
@@ -3925,53 +3915,25 @@ PKG_WITH_MODULES([CHROMECAST],[protobuf-lite], [],[
 ], [(Chromecast streaming support)], [auto])
 
 AC_ARG_VAR(PROTOC, [protobuf compiler])
-dnl Intentionally using prefixed binaries for native tool in contribs
 AS_IF([test -n "$PKG_CONFIG"],[
-    AC_CHECK_TOOL(PROTOC, protoc, no)
+    AC_PATH_PROGS(PROTOC, [protoc], no, ["${CONTRIB_DIR}/../bin:$PATH"])
     AS_IF([test "${PROTOC}" != "no"], [
         dnl silently checks the protoc version matches the protobuf library
         PROTOBUF_VERSION="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
         protoc_ver_next="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
         AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${PROTOBUF_VERSION}])
-        AS_IF([test -n "$PKG_CONFIG"],[
-            ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${protoc_ver_next}") 2>&5
-            ac_status=$?
-            AS_IF([test $ac_status = 0],[
-                protoc_matching=yes
-                AC_MSG_RESULT([yes])
-            ],[
-                protoc_matching=no
-                AC_MSG_RESULT([no])
-            ])
+        ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${protoc_ver_next}") 2>&AS_MESSAGE_FD
+        ac_status=$?
+        AS_IF([test $ac_status = 0],[
+            protoc_matching=yes
+            AC_MSG_RESULT([yes])
+        ],[
+            protoc_matching=no
+            AC_MSG_RESULT([no])
         ])
     ],[
         protoc_matching=no
     ])
-    AS_IF([test "${protoc_matching}" != "yes"], [
-        dnl Reset cache from the previous test
-        unset PROTOC
-        unset ac_cv_prog_PROTOC
-        dnl checking plain 'protoc' (possibly a second time)
-        AC_CHECK_PROG(PROTOC, protoc, no)
-
-        AS_IF([test "${PROTOC}" != "no"], [
-            dnl silently checks the protoc version matches the protobuf library
-            PROTOBUF_VERSION="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
-            protoc_ver_next="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
-            AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${PROTOBUF_VERSION}])
-            ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${protoc_ver_next}") 2>&5
-            ac_status=$?
-            AS_IF([test $ac_status = 0],[
-                protoc_matching=yes
-                AC_MSG_RESULT([yes])
-            ],[
-                AC_MSG_RESULT([no])
-                AS_IF([test "${enable_chromecast}" != "no"], [
-                    AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
-                ])
-            ])
-        ])
-    ])
 ])
 AC_SUBST([PROTOBUF_VERSION])
 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${enable_chromecast}" != "no" -a "${protoc_matching}" = yes])


=====================================
contrib/src/protobuf/rules.mak
=====================================
@@ -20,9 +20,6 @@ endif
 endif
 PKGS.tools.protoc.path = $(BUILDBINDIR)/$(HOST)-protoc
 
-ifeq ($(shell $(HOST)-protoc --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2),$(PROTOBUF_MAJVERSION))
-PKGS_FOUND += protoc
-endif
 ifeq ($(shell protoc --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2),$(PROTOBUF_MAJVERSION))
 PKGS_FOUND += protoc
 endif
@@ -59,9 +56,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc
 	sed -i.orig -e 's,install(DIRECTORY ,noinstall(DIRECTORY ,' $(UNPACK_DIR)/cmake/install.cmake
 	sed -i.orig -e 's,install(TARGETS ,noinstall(TARGETS ,' $(UNPACK_DIR)/cmake/install.cmake
 	sed -i.orig -e 's,noinstall(TARGETS protoc,install(TARGETS protoc,' $(UNPACK_DIR)/cmake/install.cmake
-	# set the binary prefix
-	echo "set_target_properties(protoc PROPERTIES PREFIX \"$(HOST)-\")" >> $(UNPACK_DIR)/cmake/protoc.cmake
-	# disable libprotobuf-ltie
+	# disable libprotobuf-lite
 	# sed -i.orig -e 's,libprotobuf-lite, ,' $(UNPACK_DIR)/cmake/install.cmake
 	# sed -i.orig -e 's,include(libprotobuf-lite,#include(libprotobuf-lite,' $(UNPACK_DIR)/cmake/CMakeLists.txt
 	$(MOVE)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bd7b87511c714270bc74d024c438d0566afa1efe...d5f62142e8caf1623b61c059199d2d142157e2c5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bd7b87511c714270bc74d024c438d0566afa1efe...d5f62142e8caf1623b61c059199d2d142157e2c5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list