At work we need protobuf 3 instead of the old protobuf 2 we have in the
ports tree.  It would be great if we could update the in-tree version
from 2.4.1 to something more recent.

protobuf 3.6.0 was released a couple of days ago.  The diff below is
based on the protobuf 3.5.1 port in openbsd-wip plus an attempt at
updating the fixes for the regression tests from the in-tree port.

devel/protobuf-c would need to be bumped to 1.3.0 since that is the
first version with proto3 support. I'll send an update for that in a
separate mail.

The diff for protobuf 3.6.0 below is obviously not yet perfect.  Even
with my best efforts to port the relevant parts of Greg Steuck's fixes
sthen committed for the 2.4.1 tests, there are a few that abort with
this trace:

#0  thrkill () at -:3
#1  0x00000ff87f07adde in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2  0x00000ff8ff9f8e97 in testing::internal::GTestLog::~GTestLog() () from 
/usr/local/lib/libgtest.so.1.0
#3  0x00000ff95858c8ea in 
testing::internal::ThreadLocal<testing::Sequence*>::~ThreadLocal() ()
   from /usr/local/lib/libgmock.so.0.0
#4  0x00000ff87f00c39c in _libc___cxa_finalize (dso=0x0) at 
/usr/src/lib/libc/stdlib/atexit.c:177
#5  0x00000ff87f078c61 in _libc_exit (status=0) at 
/usr/src/lib/libc/stdlib/exit.c:54
#6  0x00000ff67e6025fd in _start ()

As a result, 4 out of 7 tests report failures. Does that ring a bell for
anyone?


I checked sqlports for direct dependents of protobuf and protobuf-c and
found these:

        audio/clementine
        audio/mumble
        audio/umurmur
        games/pokerth
        net/dnsdist
        net/mosh
        net/ocserv
        sysutils/collectd,-prometheus
        sysutils/riemann-c-client
        x11/kde4/marble

Except for mumble and pokerth, the above ports build, their 'make test'
(if applicable) looks fine and they pass light runtime testing as well,
so I think I'm in good shape.

audio/mumble:

        In file included from Mumble.pb.cc:4:
        In file included from ./Mumble.pb.h:25:
        In file included from 
/usr/local/include/google/protobuf/generated_message_table_driven.h:34:
        In file included from /usr/local/include/google/protobuf/map.h:49:
        In file included from 
/usr/local/include/google/protobuf/map_type_handler.h:35:
        In file included from 
/usr/local/include/google/protobuf/wire_format_lite_inl.h:43:
        /usr/local/include/google/protobuf/message_lite.h:117:3: fatal error: 
unknown type name 'constexpr'
          constexpr const T& get() const { return reinterpret_cast<const 
T&>(union_); }
          ^

games/pokerth:

        ===>  Configuring for pokerth-1.1.2
        cd /usr/ports/pobj/pokerth-1.1.2/pokerth-1.1.2-rc &&  protoc 
--cpp_out=src/third_party/protobuf chatcleaner.proto &&  protoc 
--cpp_out=src/third_party/protobuf pokerth.proto
        [libprotobuf WARNING 
/usr/ports/pobj/protobuf-3.6.0/protobuf-3.6.0/src/google/protobuf/compiler/parser.cc:562]
        No syntax specified for the proto file: chatcleaner.proto. Please use 
'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. 
(Defaulted to proto2 syntax.)
        [libprotobuf WARNING 
/usr/ports/pobj/protobuf-3.6.0/protobuf-3.6.0/src/google/protobuf/compiler/parser.cc:562]
        No syntax specified for the proto file: pokerth.proto. Please use 
'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. 
(Defaulted to proto2 syntax.)
        pokerth.proto:704:26: Expected enum value or number range.
        *** Error 1 in . (Makefile:59 'pre-configure')


And finally, here's my diff for protobuf 3.6.0:


Index: protobuf/Makefile
===================================================================
RCS file: /var/cvs/ports/devel/protobuf/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- protobuf/Makefile   26 Jul 2017 22:45:18 -0000      1.19
+++ protobuf/Makefile   21 Jun 2018 08:28:29 -0000
@@ -2,13 +2,15 @@
 
 COMMENT =              c++ protocol buffers
 
-V =                    2.4.1
-DISTNAME =             protobuf-$V
-REVISION =             6
-
-SHARED_LIBS +=         protobuf        1.0   # 7.0
-SHARED_LIBS +=         protoc          1.0   # 7.0
-SHARED_LIBS +=         protobuf-lite   1.0   # 7.0
+V =                    3.6.0
+DISTNAME =             protobuf-cpp-$V
+PKGNAME =              protobuf-$V
+
+WRKDIST =               ${WRKDIR}/protobuf-${V}
+
+SHARED_LIBS +=         protobuf        2.0   # 11.0
+SHARED_LIBS +=         protoc          2.0   # 11.0
+SHARED_LIBS +=         protobuf-lite   2.0   # 11.0
 
 CATEGORIES =           devel
 
@@ -22,6 +24,8 @@ WANTLIB +=    c m pthread ${COMPILER_LIBCXX
 MASTER_SITES =         
https://github.com/google/protobuf/releases/download/v$V/
 
 TEST_DEPENDS = devel/gtest
+
+COMPILER =             base-clang ports-gcc
 
 SEPARATE_BUILD =       Yes
 USE_GMAKE =            Yes
Index: protobuf/distinfo
===================================================================
RCS file: /var/cvs/ports/devel/protobuf/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- protobuf/distinfo   18 Jan 2015 03:13:40 -0000      1.3
+++ protobuf/distinfo   20 Jun 2018 13:16:13 -0000
@@ -1,2 +1,2 @@
-SHA256 (protobuf-2.4.1.tar.gz) = 6saWm2F/OXJH6AUmfaKw2z/55akWOxI1A6GS+7V3ZWc=
-SIZE (protobuf-2.4.1.tar.gz) = 1935301
+SHA256 (protobuf-cpp-3.6.0.tar.gz) = 
w8qwVZZNVU5P2FBn/j6etFyZFc689Tfpf6+qJFN2vOE=
+SIZE (protobuf-cpp-3.6.0.tar.gz) = 4454101
Index: protobuf/patches/patch-Makefile_in
===================================================================
RCS file: protobuf/patches/patch-Makefile_in
diff -N protobuf/patches/patch-Makefile_in
--- protobuf/patches/patch-Makefile_in  17 May 2017 20:23:45 -0000      1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-Makefile_in,v 1.3 2017/05/17 20:23:45 sthen Exp $
-
-Index: Makefile.in
---- Makefile.in.orig
-+++ Makefile.in
-@@ -957,27 +957,6 @@ uninstall-am: uninstall-pkgconfigDATA
-       uninstall-pkgconfigDATA
- 
- 
--# Build gtest before we build protobuf tests.  We don't add gtest to SUBDIRS
--# because then "make check" would also build and run all of gtest's own tests,
--# which takes a lot of time and is generally not useful to us.  Also, we don't
--# want "make install" to recurse into gtest since we don't want to overwrite
--# the installed version of gtest if there is one.
--check-local:
--      @echo "Making lib/libgtest.a lib/libgtest_main.a in gtest"
--      @cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la 
lib/libgtest_main.la
--
--# We would like to clean gtest when "make clean" is invoked.  But we have to
--# be careful because clean-local is also invoked during "make distclean", but
--# "make distclean" already recurses into gtest because it's listed among the
--# DIST_SUBDIRS.  distclean will delete gtest/Makefile, so if we then try to
--# cd to the directory again and "make clean" it will fail.  So, check that the
--# Makefile exists before recursing.
--clean-local:
--      @if test -e gtest/Makefile; then \
--        echo "Making clean in gtest"; \
--        cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
--      fi
--
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
Index: protobuf/patches/patch-configure
===================================================================
RCS file: protobuf/patches/patch-configure
diff -N protobuf/patches/patch-configure
--- protobuf/patches/patch-configure    17 May 2017 20:23:45 -0000      1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,37 +0,0 @@
-$OpenBSD: patch-configure,v 1.5 2017/05/17 20:23:45 sthen Exp $
-
-Index: configure
---- configure.orig
-+++ configure
-@@ -904,7 +904,6 @@ CXX
- CXXFLAGS
- CCC
- CXXCPP'
--ac_subdirs_all='gtest'
- 
- # Initialize some variables set by options.
- ac_init_help=
-@@ -15569,7 +15568,7 @@ test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
-       # FIXME: -fPIC is required for -shared on many architectures,
-       # so we specify it here, but the right way would probably be to
-       # properly detect whether it is actually required.
--      CFLAGS="-shared -fPIC -Wl,-z,defs $CFLAGS $PTHREAD_CFLAGS"
-+      CFLAGS="-shared -fPIC $CFLAGS $PTHREAD_CFLAGS"
-       LIBS="$PTHREAD_LIBS $LIBS"
-       CC="$PTHREAD_CC"
- 
-@@ -15947,14 +15946,6 @@ $as_echo "$as_me: WARNING: could not find an STL hash_
-    fi
- 
- 
--# HACK:  Make gtest's configure script pick up our copy of CFLAGS and 
CXXFLAGS,
--#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gtest
--#   too.
--export CFLAGS
--export CXXFLAGS
--
--
--subdirs="$subdirs gtest"
- 
- 
- ac_config_files="$ac_config_files Makefile src/Makefile protobuf.pc 
protobuf-lite.pc"
Index: protobuf/patches/patch-src_Makefile_in
===================================================================
RCS file: /var/cvs/ports/devel/protobuf/patches/patch-src_Makefile_in,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_Makefile_in
--- protobuf/patches/patch-src_Makefile_in      17 May 2017 20:23:45 -0000      
1.3
+++ protobuf/patches/patch-src_Makefile_in      20 Jun 2018 23:10:53 -0000
@@ -1,78 +1,140 @@
-$OpenBSD: patch-src_Makefile_in,v 1.3 2017/05/17 20:23:45 sthen Exp $
+$OpenBSD$
 
 Index: src/Makefile.in
 --- src/Makefile.in.orig
 +++ src/Makefile.in
-@@ -156,8 +156,8 @@ protobuf_lazy_descriptor_test_OBJECTS =  \
+@@ -475,10 +475,7 @@ protobuf_lazy_descriptor_test_OBJECTS =  \
        $(am_protobuf_lazy_descriptor_test_OBJECTS) \
        $(nodist_protobuf_lazy_descriptor_test_OBJECTS)
  protobuf_lazy_descriptor_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
--      libprotobuf.la $(top_builddir)/gtest/lib/libgtest.la \
--      $(top_builddir)/gtest/lib/libgtest_main.la
-+      libprotobuf.la
-+protobuf_lazy_descriptor_test_LDADD = -L${LOCALBASE}/lib -lgtest -lgtest_main
- protobuf_lazy_descriptor_test_LINK = $(LIBTOOL) --tag=CXX \
+-      libprotobuf.la libprotoc.la \
+-      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++      libprotobuf.la libprotoc.la
+ protobuf_lazy_descriptor_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
        $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) \
-@@ -224,8 +224,8 @@ nodist_protobuf_test_OBJECTS = $(am__objects_8)
+@@ -498,9 +495,7 @@ protobuf_lite_arena_test_OBJECTS =  \
+       $(am_protobuf_lite_arena_test_OBJECTS) \
+       $(nodist_protobuf_lite_arena_test_OBJECTS)
+ protobuf_lite_arena_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+-      libprotobuf-lite.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++      libprotobuf-lite.la
+ protobuf_lite_arena_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+       $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+@@ -521,9 +516,7 @@ nodist_protobuf_lite_test_OBJECTS = $(am__objects_10)
+ protobuf_lite_test_OBJECTS = $(am_protobuf_lite_test_OBJECTS) \
+       $(nodist_protobuf_lite_test_OBJECTS)
+ protobuf_lite_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+-      libprotobuf-lite.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++      libprotobuf-lite.la
+ protobuf_lite_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+       $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+@@ -660,9 +653,7 @@ nodist_protobuf_test_OBJECTS = $(am__objects_13)
  protobuf_test_OBJECTS = $(am_protobuf_test_OBJECTS) \
        $(nodist_protobuf_test_OBJECTS)
  protobuf_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la \
--      libprotoc.la $(top_builddir)/gtest/lib/libgtest.la \
--      $(top_builddir)/gtest/lib/libgtest_main.la
+-      libprotoc.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
 +      libprotoc.la
-+protobuf_test_LDADD = -L${LOCALBASE}/lib -lgtest -lgtest_main
- protobuf_test_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(protobuf_test_CXXFLAGS) \
-       $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-@@ -237,7 +237,8 @@ am_test_plugin_OBJECTS = test_plugin-mock_code_generat
-       test_plugin-file.$(OBJEXT) test_plugin-test_plugin.$(OBJEXT)
+ protobuf_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+       $(protobuf_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+@@ -676,7 +667,7 @@ am_test_plugin_OBJECTS = google/protobuf/compiler/test
+       google/protobuf/compiler/test_plugin-test_plugin.$(OBJEXT)
  test_plugin_OBJECTS = $(am_test_plugin_OBJECTS)
  test_plugin_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la \
--      libprotoc.la $(top_builddir)/gtest/lib/libgtest.la
+-      libprotoc.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
 +      libprotoc.la
-+test_plugin_LDADD = -L${LOCALBASE}/lib -lgtest
  am__zcgunzip_SOURCES_DIST = google/protobuf/testing/zcgunzip.cc
- @HAVE_ZLIB_TRUE@am_zcgunzip_OBJECTS = zcgunzip.$(OBJEXT)
- zcgunzip_OBJECTS = $(am_zcgunzip_OBJECTS)
-@@ -692,11 +693,9 @@ COMMON_TEST_SOURCES = \
-   google/protobuf/testing/file.h
- 
+ @HAVE_ZLIB_TRUE@am_zcgunzip_OBJECTS =  \
+ @HAVE_ZLIB_TRUE@      google/protobuf/testing/zcgunzip.$(OBJEXT)
+@@ -701,7 +692,7 @@ AM_V_at = $(am__v_at_@AM_V@)
+ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+ am__v_at_0 = @
+ am__v_at_1 = 
+-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
++DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I${LOCALBASE}/include
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ am__mv = mv -f
+@@ -1858,12 +1849,9 @@ GOOGLEMOCK_BUILD_DIR = ../third_party/googletest/googl
+ GOOGLETEST_SRC_DIR = $(srcdir)/../third_party/googletest/googletest
+ GOOGLEMOCK_SRC_DIR = $(srcdir)/../third_party/googletest/googlemock
  protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      $(top_builddir)/gtest/lib/libgtest.la       \
--                      $(top_builddir)/gtest/lib/libgtest_main.la
-+                      -L${LOCALBASE}/lib -lgtest -lgtest_main
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++                    -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
  
--protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include         \
--                         -I$(top_builddir)/gtest/include
+-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
+-                         -I$(GOOGLEMOCK_SRC_DIR)/include
 +protobuf_test_CPPFLAGS = -I${LOCALBASE}/include
  
  # Disable optimization for tests unless the user explicitly asked for it,
  # since test_util.cc takes forever to compile with optimization (with GCC).
-@@ -738,11 +737,9 @@ nodist_protobuf_test_SOURCES = $(protoc_outputs)
- 
+@@ -1952,12 +1940,9 @@ nodist_protobuf_test_SOURCES = $(protoc_outputs)
  # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
  protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
--                      $(top_builddir)/gtest/lib/libgtest.la       \
--                      $(top_builddir)/gtest/lib/libgtest_main.la
-+                      -L${LOCALBASE}/lib -lgtest -lgtest_main
- 
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include    \
--                                         -I$(top_builddir)/gtest/include  \
-+protobuf_lazy_descriptor_test_CPPFLAGS = -I${LOCALBASE}/include  \
+                       libprotoc.la                                   \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++                    -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
+ 
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                                         -I$(GOOGLETEST_SRC_DIR)/include \
++protobuf_lazy_descriptor_test_CPPFLAGS = -I${LOCALBASE}/include          \
                                           -DPROTOBUF_TEST_NO_DESCRIPTORS
  
  protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
-@@ -764,10 +761,9 @@ nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outp
+@@ -1980,12 +1965,9 @@ COMMON_LITE_TEST_SOURCES = \
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
+-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++                         -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
+ 
+-protobuf_lite_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                             -I$(GOOGLETEST_SRC_DIR)/include
++protobuf_lite_test_CPPFLAGS = -I${LOCALBASE}/include
+ 
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES = \
+@@ -1998,12 +1980,9 @@ nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outp
+ # gtest when building the test internally our memory sanitizer doesn't detect
+ # memory leaks (don't know why).
+ protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
++                               -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
+ 
+-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
+-                                    -I$(GOOGLETEST_SRC_DIR)/include
++protobuf_lite_arena_test_CPPFLAGS = -I${LOCALBASE}/include
+ 
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES = \
+@@ -2014,9 +1993,9 @@ nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lit
  
  # Test plugin binary.
  test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    $(top_builddir)/gtest/lib/libgtest.la
-+                    -L${LOCALBASE}/lib -lgtest
- 
--test_plugin_CPPFLAGS = -I$(top_srcdir)/gtest/include         \
--                       -I$(top_builddir)/gtest/include
-+test_plugin_CPPFLAGS = -I${LOCALBASE}/include
+-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
++                  -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
  
+-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
++test_plugin_CPPFLAGS = -I${$LOCALBASE}/include
  test_plugin_SOURCES = \
    google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \
Index: 
protobuf/patches/patch-src_google_protobuf_compiler_command_line_interface_cc
===================================================================
RCS file: 
protobuf/patches/patch-src_google_protobuf_compiler_command_line_interface_cc
diff -N 
protobuf/patches/patch-src_google_protobuf_compiler_command_line_interface_cc
--- 
protobuf/patches/patch-src_google_protobuf_compiler_command_line_interface_cc   
    8 Apr 2018 08:35:14 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_compiler_command_line_interface_cc,v 1.1 
2018/04/08 08:35:14 jasper Exp $
-
-Unbreak with clang6
-https://github.com/google/protobuf/commit/5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74
-
-Index: src/google/protobuf/compiler/command_line_interface.cc
---- src/google/protobuf/compiler/command_line_interface.cc.orig
-+++ src/google/protobuf/compiler/command_line_interface.cc
-@@ -781,7 +781,7 @@ bool CommandLineInterface::ParseArguments(int argc, co
- 
-   // If no --proto_path was given, use the current working directory.
-   if (proto_path_.empty()) {
--    proto_path_.push_back(make_pair<string, string>("", "."));
-+    proto_path_.push_back(std::pair<string, string>("", "."));
-   }
- 
-   // Check some errror cases.
-@@ -910,7 +910,7 @@ bool CommandLineInterface::InterpretArgument(const str
-         cerr << disk_path << ": warning: directory does not exist." << endl;
-       }
- 
--      proto_path_.push_back(make_pair<string, string>(virtual_path, 
disk_path));
-+      proto_path_.push_back(std::pair<string, string>(virtual_path, 
disk_path));
-     }
- 
-   } else if (name == "-o" || name == "--descriptor_set_out") {
Index: protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc
===================================================================
RCS file: 
protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc     
17 May 2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc,v 1.1 
2017/05/17 20:23:45 sthen Exp $
-
-Index: src/google/protobuf/compiler/cpp/cpp_unittest.cc
---- src/google/protobuf/compiler/cpp/cpp_unittest.cc.orig
-+++ src/google/protobuf/compiler/cpp/cpp_unittest.cc
-@@ -493,6 +493,9 @@ TEST(GeneratedMessageTest, NonEmptyMergeFrom) {
-   TestUtil::ExpectAllFieldsSet(message1);
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
- #ifdef GTEST_HAS_DEATH_TEST
- 
- TEST(GeneratedMessageTest, MergeFromSelf) {
Index: protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc        
17 May 2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_extension_set_unittest_cc,v 1.1 2017/05/17 
20:23:45 sthen Exp $
-
-Index: src/google/protobuf/extension_set_unittest.cc
---- src/google/protobuf/extension_set_unittest.cc.orig
-+++ src/google/protobuf/extension_set_unittest.cc
-@@ -470,6 +470,10 @@ TEST(ExtensionSetTest, SpaceUsedExcludingSelf) {
-   }
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
-+
- #ifdef GTEST_HAS_DEATH_TEST
- 
- TEST(ExtensionSetTest, InvalidEnumDeath) {
Index: 
protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc
===================================================================
RCS file: 
protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc
diff -N 
protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc
--- 
protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc
 17 May 2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_generated_message_reflection_unittest_cc,v 
1.1 2017/05/17 20:23:45 sthen Exp $
-
-Index: src/google/protobuf/generated_message_reflection_unittest.cc
---- src/google/protobuf/generated_message_reflection_unittest.cc.orig
-+++ src/google/protobuf/generated_message_reflection_unittest.cc
-@@ -327,6 +327,9 @@ TEST(GeneratedMessageReflectionTest, FindKnownExtensio
-               FindKnownExtensionByName(extension1->full_name()) == NULL);
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
- #ifdef GTEST_HAS_DEATH_TEST
- 
- TEST(GeneratedMessageReflectionTest, UsageErrors) {
Index: protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc   17 May 
2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_io_printer_unittest_cc,v 1.1 2017/05/17 
20:23:45 sthen Exp $
-
-Index: src/google/protobuf/io/printer_unittest.cc
---- src/google/protobuf/io/printer_unittest.cc.orig
-+++ src/google/protobuf/io/printer_unittest.cc
-@@ -219,6 +219,9 @@ TEST(Printer, Indenting) {
-   }
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
- // Death tests do not work on Windows as of yet.
- #ifdef GTEST_HAS_DEATH_TEST
- TEST(Printer, Death) {
Index: protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc 17 May 
2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_io_tokenizer_unittest_cc,v 1.1 2017/05/17 
20:23:45 sthen Exp $
-
-Index: src/google/protobuf/io/tokenizer_unittest.cc
---- src/google/protobuf/io/tokenizer_unittest.cc.orig
-+++ src/google/protobuf/io/tokenizer_unittest.cc
-@@ -512,6 +512,10 @@ TEST_1D(TokenizerTest, ShCommentStyle, kBlockSizes) {
- 
- #endif
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
-+
- // -------------------------------------------------------------------
- 
- // Test parse helpers.  It's not really worth setting up a full data-driven
Index: protobuf/patches/patch-src_google_protobuf_message_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_message_cc
diff -N protobuf/patches/patch-src_google_protobuf_message_cc
--- protobuf/patches/patch-src_google_protobuf_message_cc       17 May 2017 
20:23:45 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_message_cc,v 1.2 2017/05/17 20:23:45 sthen 
Exp $
-
-Index: src/google/protobuf/message.cc
---- src/google/protobuf/message.cc.orig
-+++ src/google/protobuf/message.cc
-@@ -32,7 +32,9 @@
- //  Based on original Protocol Buffers design by
- //  Sanjay Ghemawat, Jeff Dean, and others.
- 
-+#include <istream>
- #include <stack>
-+
- #include <google/protobuf/stubs/hash.h>
- 
- #include <google/protobuf/message.h>
Index: protobuf/patches/patch-src_google_protobuf_message_unittest_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_message_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_message_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_message_unittest_cc      17 May 
2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_message_unittest_cc,v 1.1 2017/05/17 
20:23:45 sthen Exp $
-
-Index: src/google/protobuf/message_unittest.cc
---- src/google/protobuf/message_unittest.cc.orig
-+++ src/google/protobuf/message_unittest.cc
-@@ -205,6 +205,9 @@ TEST(MessageTest, InitializationErrorString) {
-   EXPECT_EQ("a, b, c", message.InitializationErrorString());
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
- #ifdef GTEST_HAS_DEATH_TEST  // death tests do not work on Windows yet.
- 
- TEST(MessageTest, SerializeFailsIfNotInitialized) {
Index: protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc       
17 May 2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_reflection_ops_unittest_cc,v 1.1 
2017/05/17 20:23:45 sthen Exp $
-
-Index: src/google/protobuf/reflection_ops_unittest.cc
---- src/google/protobuf/reflection_ops_unittest.cc.orig
-+++ src/google/protobuf/reflection_ops_unittest.cc
-@@ -152,6 +152,9 @@ TEST(ReflectionOpsTest, MergeUnknown) {
-   EXPECT_EQ(2, message1.unknown_fields().field(1).varint());
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
- #ifdef GTEST_HAS_DEATH_TEST
- 
- TEST(ReflectionOpsTest, MergeFromSelf) {
Index: protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc
===================================================================
RCS file: protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc
diff -N protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc
--- protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc       
17 May 2017 20:23:45 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-src_google_protobuf_repeated_field_unittest_cc,v 1.1 
2017/05/17 20:23:45 sthen Exp $
-
-Index: src/google/protobuf/repeated_field_unittest.cc
---- src/google/protobuf/repeated_field_unittest.cc.orig
-+++ src/google/protobuf/repeated_field_unittest.cc
-@@ -290,6 +290,10 @@ TEST(RepeatedField, MutableDataIsMutable) {
-   EXPECT_EQ(2, field.Get(0));
- }
- 
-+// Older version of protobuf incompatible with new version of gtest.
-+// https://groups.google.com/d/msg/protobuf/xgGBG-_WYy8/ruf1MKDr-sIJ
-+#undef GTEST_HAS_DEATH_TEST
-+
- TEST(RepeatedField, Truncate) {
-   RepeatedField<int> field;
- 
Index: protobuf/pkg/PLIST
===================================================================
RCS file: /var/cvs/ports/devel/protobuf/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- protobuf/pkg/PLIST  16 Mar 2015 18:07:44 -0000      1.2
+++ protobuf/pkg/PLIST  20 Jun 2018 13:52:18 -0000
@@ -2,49 +2,128 @@
 @bin bin/protoc
 include/google/
 include/google/protobuf/
+include/google/protobuf/any.h
+include/google/protobuf/any.pb.h
+include/google/protobuf/any.proto
+include/google/protobuf/api.pb.h
+include/google/protobuf/api.proto
+include/google/protobuf/arena.h
+include/google/protobuf/arena_impl.h
+include/google/protobuf/arenastring.h
 include/google/protobuf/compiler/
 include/google/protobuf/compiler/code_generator.h
 include/google/protobuf/compiler/command_line_interface.h
 include/google/protobuf/compiler/cpp/
 include/google/protobuf/compiler/cpp/cpp_generator.h
+include/google/protobuf/compiler/csharp/
+include/google/protobuf/compiler/csharp/csharp_generator.h
+include/google/protobuf/compiler/csharp/csharp_names.h
 include/google/protobuf/compiler/importer.h
 include/google/protobuf/compiler/java/
 include/google/protobuf/compiler/java/java_generator.h
+include/google/protobuf/compiler/java/java_names.h
+include/google/protobuf/compiler/js/
+include/google/protobuf/compiler/js/js_generator.h
+include/google/protobuf/compiler/js/well_known_types_embed.h
+include/google/protobuf/compiler/objectivec/
+include/google/protobuf/compiler/objectivec/objectivec_generator.h
+include/google/protobuf/compiler/objectivec/objectivec_helpers.h
 include/google/protobuf/compiler/parser.h
+include/google/protobuf/compiler/php/
+include/google/protobuf/compiler/php/php_generator.h
 include/google/protobuf/compiler/plugin.h
 include/google/protobuf/compiler/plugin.pb.h
 include/google/protobuf/compiler/plugin.proto
 include/google/protobuf/compiler/python/
 include/google/protobuf/compiler/python/python_generator.h
+include/google/protobuf/compiler/ruby/
+include/google/protobuf/compiler/ruby/ruby_generator.h
 include/google/protobuf/descriptor.h
 include/google/protobuf/descriptor.pb.h
 include/google/protobuf/descriptor.proto
 include/google/protobuf/descriptor_database.h
+include/google/protobuf/duration.pb.h
+include/google/protobuf/duration.proto
 include/google/protobuf/dynamic_message.h
+include/google/protobuf/empty.pb.h
+include/google/protobuf/empty.proto
 include/google/protobuf/extension_set.h
+include/google/protobuf/field_mask.pb.h
+include/google/protobuf/field_mask.proto
+include/google/protobuf/generated_enum_reflection.h
+include/google/protobuf/generated_enum_util.h
 include/google/protobuf/generated_message_reflection.h
+include/google/protobuf/generated_message_table_driven.h
 include/google/protobuf/generated_message_util.h
+include/google/protobuf/has_bits.h
+include/google/protobuf/implicit_weak_message.h
+include/google/protobuf/inlined_string_field.h
 include/google/protobuf/io/
 include/google/protobuf/io/coded_stream.h
 include/google/protobuf/io/gzip_stream.h
 include/google/protobuf/io/printer.h
+include/google/protobuf/io/strtod.h
 include/google/protobuf/io/tokenizer.h
 include/google/protobuf/io/zero_copy_stream.h
 include/google/protobuf/io/zero_copy_stream_impl.h
 include/google/protobuf/io/zero_copy_stream_impl_lite.h
+include/google/protobuf/map.h
+include/google/protobuf/map_entry.h
+include/google/protobuf/map_entry_lite.h
+include/google/protobuf/map_field.h
+include/google/protobuf/map_field_inl.h
+include/google/protobuf/map_field_lite.h
+include/google/protobuf/map_type_handler.h
 include/google/protobuf/message.h
 include/google/protobuf/message_lite.h
+include/google/protobuf/metadata.h
+include/google/protobuf/metadata_lite.h
+include/google/protobuf/reflection.h
 include/google/protobuf/reflection_ops.h
 include/google/protobuf/repeated_field.h
 include/google/protobuf/service.h
+include/google/protobuf/source_context.pb.h
+include/google/protobuf/source_context.proto
+include/google/protobuf/struct.pb.h
+include/google/protobuf/struct.proto
 include/google/protobuf/stubs/
+include/google/protobuf/stubs/bytestream.h
+include/google/protobuf/stubs/callback.h
+include/google/protobuf/stubs/casts.h
 include/google/protobuf/stubs/common.h
+include/google/protobuf/stubs/fastmem.h
+include/google/protobuf/stubs/hash.h
+include/google/protobuf/stubs/logging.h
+include/google/protobuf/stubs/macros.h
+include/google/protobuf/stubs/mutex.h
 include/google/protobuf/stubs/once.h
+include/google/protobuf/stubs/platform_macros.h
+include/google/protobuf/stubs/port.h
+include/google/protobuf/stubs/singleton.h
+include/google/protobuf/stubs/status.h
+include/google/protobuf/stubs/stl_util.h
+include/google/protobuf/stubs/stringpiece.h
+include/google/protobuf/stubs/template_util.h
 include/google/protobuf/text_format.h
+include/google/protobuf/timestamp.pb.h
+include/google/protobuf/timestamp.proto
+include/google/protobuf/type.pb.h
+include/google/protobuf/type.proto
 include/google/protobuf/unknown_field_set.h
+include/google/protobuf/util/
+include/google/protobuf/util/delimited_message_util.h
+include/google/protobuf/util/field_comparator.h
+include/google/protobuf/util/field_mask_util.h
+include/google/protobuf/util/json_util.h
+include/google/protobuf/util/message_differencer.h
+include/google/protobuf/util/time_util.h
+include/google/protobuf/util/type_resolver.h
+include/google/protobuf/util/type_resolver_util.h
 include/google/protobuf/wire_format.h
 include/google/protobuf/wire_format_lite.h
 include/google/protobuf/wire_format_lite_inl.h
+include/google/protobuf/wrappers.pb.h
+include/google/protobuf/wrappers.proto
 lib/libprotobuf-lite.a
 lib/libprotobuf-lite.la
 @lib lib/libprotobuf-lite.so.${LIBprotobuf-lite_VERSION}

Reply via email to