git: 27272a57d063 - main - science/paraview: Fix build with protobuf 22+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Thu, 14 Dec 2023 17:03:52 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=27272a57d0631c04d53f5a2671990ca3abc8c2ca

commit 27272a57d0631c04d53f5a2671990ca3abc8c2ca
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-12-14 16:23:18 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-12-14 17:03:09 +0000

    science/paraview: Fix build with protobuf 22+
---
 science/paraview/Makefile             |   1 +
 science/paraview/files/patch-protobuf | 181 ++++++++++++++++++++++++++++++++++
 2 files changed, 182 insertions(+)

diff --git a/science/paraview/Makefile b/science/paraview/Makefile
index 2e42363cbee1..69f31ebfc0b8 100644
--- a/science/paraview/Makefile
+++ b/science/paraview/Makefile
@@ -94,6 +94,7 @@ CMAKE_ARGS+=	-DPARAVIEW_BUILD_SHARED_LIBS=ON \
 CMAKE_ARGS+=	-DVTK_FORBID_DOWNLOADS:BOOL=ON
 .endif
 MAKE_ENV=	XDG_CONFIG_HOME=${WRKDIR}
+USE_CXXSTD=	c++17
 
 SHEBANG_GLOB=	*.py
 SHEBANG_FILES=	VTK/Examples/SearchScript.sh	\
diff --git a/science/paraview/files/patch-protobuf b/science/paraview/files/patch-protobuf
new file mode 100644
index 000000000000..b17fc4d08614
--- /dev/null
+++ b/science/paraview/files/patch-protobuf
@@ -0,0 +1,181 @@
+--- VTK/CMake/vtkCompilerChecks.cmake.orig	2023-09-22 14:35:37 UTC
++++ VTK/CMake/vtkCompilerChecks.cmake
+@@ -33,7 +33,7 @@ if(NOT VTK_IGNORE_CMAKE_CXX11_CHECKS)
+   # Needed to make sure libraries and executables not built by the
+   # vtkModuleMacros still have the C++11 compiler flags enabled
+   # Wrap this in an escape hatch for unknown compilers
+-  set(CMAKE_CXX_STANDARD 11)
++  set(CMAKE_CXX_STANDARD 17)
+   set(CMAKE_CXX_STANDARD_REQUIRED True)
+   set(CMAKE_CXX_EXTENSIONS False)
+ endif()
+--- VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfExprLex.cxx.orig	2023-09-22 14:35:37 UTC
++++ VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfExprLex.cxx
+@@ -706,9 +706,9 @@ extern int dice_yylex (void);
+  */
+ YY_DECL
+ {
+-  register yy_state_type yy_current_state;
+-  register char *yy_cp, *yy_bp;
+-  register int yy_act;
++  yy_state_type yy_current_state;
++  char *yy_cp, *yy_bp;
++  int yy_act;
+     
+ 
+ 
+@@ -756,7 +756,7 @@ YY_DECL
+ yy_match:
+     do
+       {
+-      register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
++      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+       if ( yy_accept[yy_current_state] )
+         {
+         (yy_last_accepting_state) = yy_current_state;
+@@ -1091,9 +1091,9 @@ case YY_STATE_EOF(INITIAL):
+  */
+ static int yy_get_next_buffer (void)
+ {
+-      register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+-  register char *source = (yytext_ptr);
+-  register int number_to_move, i;
++      char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
++  char *source = (yytext_ptr);
++  int number_to_move, i;
+   int ret_val;
+ 
+   if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+@@ -1217,14 +1217,14 @@ static int yy_get_next_buffer (void)
+ 
+     static yy_state_type yy_get_previous_state (void)
+ {
+-  register yy_state_type yy_current_state;
+-  register char *yy_cp;
++  yy_state_type yy_current_state;
++  char *yy_cp;
+     
+   yy_current_state = (yy_start);
+ 
+   for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+     {
+-    register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
++    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+     if ( yy_accept[yy_current_state] )
+       {
+       (yy_last_accepting_state) = yy_current_state;
+@@ -1249,10 +1249,10 @@ static int yy_get_next_buffer (void)
+  */
+     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+ {
+-  register int yy_is_jam;
+-      register char *yy_cp = (yy_c_buf_p);
++  int yy_is_jam;
++      char *yy_cp = (yy_c_buf_p);
+ 
+-  register YY_CHAR yy_c = 1;
++  YY_CHAR yy_c = 1;
+   if ( yy_accept[yy_current_state] )
+     {
+     (yy_last_accepting_state) = yy_current_state;
+@@ -1270,9 +1270,9 @@ static int yy_get_next_buffer (void)
+   return yy_is_jam ? 0 : yy_current_state;
+ }
+ 
+-    static void yyunput (int c, register char * yy_bp )
++    static void yyunput (int c, char * yy_bp )
+ {
+-  register char *yy_cp;
++  char *yy_cp;
+     
+     yy_cp = (yy_c_buf_p);
+ 
+@@ -1282,10 +1282,10 @@ static int yy_get_next_buffer (void)
+   if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+     { /* need to shift things up to make room */
+     /* +2 for EOB chars. */
+-    register int number_to_move = (yy_n_chars) + 2;
+-    register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
++    int number_to_move = (yy_n_chars) + 2;
++    char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+           YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+-    register char *source =
++    char *source =
+         &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+ 
+     while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+@@ -1862,7 +1862,7 @@ int dice_yylex_destroy  (void)
+ #ifndef yytext_ptr
+ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+ {
+-  register int i;
++  int i;
+       for ( i = 0; i < n; ++i )
+     s1[i] = s2[i];
+ }
+@@ -1871,7 +1871,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * 
+ #ifdef YY_NEED_STRLEN
+ static int yy_flex_strlen (yyconst char * s )
+ {
+-  register int n;
++  int n;
+       for ( n = 0; s[n]; ++n )
+     ;
+ 
+--- VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfExprYacc.cxx.orig	2023-09-22 14:35:37 UTC
++++ VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfExprYacc.cxx
+@@ -270,7 +270,7 @@ union yyalloc
+ #   define YYCOPY(To, From, Count)                \
+       do                                        \
+         {                                        \
+-          register YYSIZE_T yyi;                \
++          YYSIZE_T yyi;                \
+           for (yyi = 0; yyi < (Count); yyi++)        \
+             (To)[yyi] = (From)[yyi];                \
+         }                                        \
+@@ -800,7 +800,7 @@ yystrlen (yystr)
+      const char *yystr;
+ #   endif
+ {
+-  register const char *yys = yystr;
++  const char *yys = yystr;
+ 
+   while (*yys++ != '\0')
+     continue;
+@@ -825,8 +825,8 @@ yystpcpy (yydest, yysrc)
+      const char *yysrc;
+ #   endif
+ {
+-  register char *yyd = yydest;
+-  register const char *yys = yysrc;
++  char *yyd = yydest;
++  const char *yys = yysrc;
+ 
+   while ((*yyd++ = *yys++) != '\0')
+     continue;
+@@ -945,8 +945,8 @@ yyparse ()
+ #endif
+ {
+   
+-  register int yystate;
+-  register int yyn;
++  int yystate;
++  int yyn;
+   int yyresult;
+   /* Number of tokens to shift before error messages enabled.  */
+   int yyerrstatus;
+@@ -964,12 +964,12 @@ yyparse ()
+   /* The state stack.  */
+   short        yyssa[YYINITDEPTH];
+   short *yyss = yyssa;
+-  register short *yyssp;
++  short *yyssp;
+ 
+   /* The semantic value stack.  */
+   YYSTYPE yyvsa[YYINITDEPTH];
+   YYSTYPE *yyvs = yyvsa;
+-  register YYSTYPE *yyvsp;
++  YYSTYPE *yyvsp;
+ 
+ 
+