[vlc-commits] [Git][videolan/vlc][master] configure/meson: make protoc 3.4.1 compatible with protobuf 3.4.0

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Sep 21 17:09:45 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
53301c22 by Steve Lhomme at 2025-09-21T16:53:49+00:00
configure/meson: make protoc 3.4.1 compatible with protobuf 3.4.0

protoc 3.4.1 reports using libprotoc 3.4.0 instead of 3.4.1.
That's the only release before 3.22 with a minor release version not
reported properly by protoc. After that we get the proper report:
- libprotoc 3.19.5
- libprotoc 3.12.4
- libprotoc 3.6.1
- libprotoc 3.5.1

And before 3.4.1 there were no minor 3.x release versions.

Versions 3.1 to 3.22 are considered to version 1 to 22. 3.22.x then switched to 22.x.

- - - - -


2 changed files:

- configure.ac
- modules/stream_out/chromecast/meson.build


Changes:

=====================================
configure.ac
=====================================
@@ -3975,18 +3975,28 @@ AS_IF([test -n "$PKG_CONFIG"],[
     AS_IF([test "${PROTOC}" != "no"], [
         dnl silently checks the protoc version matches the protobuf library
         PROTOC_FULL_VERSION="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '//)"
-        PROTOC_MAJ_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -1)"
-        AS_IF([test "${PROTOC_MAJ_VERSION}" -lt "22" ], [
+        PROTOC_TEST_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -1)"
+        AS_IF([test "${PROTOC_TEST_VERSION}" = "3" ], [
+          PROTOC_TEST_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f 2-2)"
+        ])
+        AS_IF([test "${PROTOC_TEST_VERSION}" -lt "5" ], [
+            dnl protoc x.y.0 is compatible with protobuf x.y.*
+            PROTOBUF_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -2)"
+            PROTOBUF_MAX_VERSION="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
+            PROTOBUF_TEST="protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${PROTOBUF_MAX_VERSION}"
+        ],[
+          AS_IF([test "${PROTOC_TEST_VERSION}" -lt "22" ], [
             dnl protoc x.y.z is compatible with protobuf x.y.z
             PROTOBUF_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -3)"
             dnl the protoc version is in the x.y.z format but protobuf version is in the x.y.z.r format
             PROTOBUF_MAX_VERSION="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
             PROTOBUF_TEST="protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${PROTOBUF_MAX_VERSION}"
-        ],[
+          ],[
             dnl protoc x.y is compatible with protobuf x.y.*
             PROTOBUF_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -2)"
             PROTOBUF_MAX_VERSION="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
             PROTOBUF_TEST="protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${PROTOBUF_MAX_VERSION}"
+          ])
         ])
         AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${PROTOBUF_VERSION}])
         ($PKG_CONFIG --exists --print-errors "${PROTOBUF_TEST}") 2>&AS_MESSAGE_FD


=====================================
modules/stream_out/chromecast/meson.build
=====================================
@@ -9,8 +9,11 @@ if protobuf_dep.found()
     # protoc provide compatibility with version x.y now. But version 21.y.z
     # still outputs the previous kind of version naming up until 3.21.12.z
     # included, so the first version with the x.y format is 22.0.
+    # in 3.4.1 protoc reports a version of 3.4.0, before that there were no minor release
     protobuf_version_list = protobuf_dep.version().split('.')
-    if protobuf_dep.version().version_compare('< 3.22.0.0')
+    if protobuf_dep.version().version_compare('< 3.5.0')
+        protoc_version = '@0 at .@1@'.format(protobuf_version_list[0], protobuf_version_list[1])
+    elif protobuf_dep.version().version_compare('< 3.22.0.0')
         protoc_version = '@0 at .@1 at .@2@'.format(
             protobuf_version_list[0],
             protobuf_version_list[1],



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/53301c221183f729d5cdd22b9e68aa3603d66a54

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/53301c221183f729d5cdd22b9e68aa3603d66a54
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