Hello,

I've spent some time trying to get this upgrade into shape on
6.1-amd64 but the tests prove resistant to my efforts. The patch is
attached.

The first error I fixed was due to the one-definition-rule violation
where devel/gtest port is being compiled with a command line define
which is not preserved for the ports relying on it. Then ThreadLocal
class in gtest library and its usages in protobuf are very different
and things end quickly and painfully. I'm not entirely certain about
the mechanism which should be used to communicate this configuration
between gtest port and its users and so I did the simple thing (which
creates maintenance burden) and added the offending define to
protobuf/Makefile (-DGTEST_HAS_PTHREAD=1).

Currently I got the tests to the point that they all run to completion
and report "PASSED" and then they crash inside global destructors with
double-free errors. E.g.
% make test
...
% grep free /usr/ports/pobj/protobuf-3.3.1/build-amd64/src/test-suite.log
protobuf-test(25155) in free(): chunk is already free 0x172f7cd4b4a0
protobuf-lazy-descriptor-test(99524) in free(): chunk is already free
0x13b596055880
protobuf-lite-test(73463) in free(): chunk is already free 0x747d1bab6c0
protobuf-lite-arena-test(13268) in free(): chunk is already free 0x75c604b03c0

I spent a bit of time in gdb trying to figure out what's going wrong
and it's something that protobuf build system is doing to gtest port.
I can entirely gut src/google/protobuf/lite_arena_unittest.cc by
commenting out its tests and still get a binary which complains about
free(). The same gutted file works when complied manually with
% /usr/local/bin/eg++ --std=c++11  -D_POSIX_C_SOURCE=200809L
-DGTEST_HAS_PTHREAD=1 -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1
-I/usr/ports/pobj/protobuf-3.3.1/build-amd64/src/
-I/usr/ports/pobj/protobuf-3.3.1/protobuf-3.3.1/src
-I/usr/local/include -L/usr/local/lib -lgtest -lgtest_main -o /tmp/x
/usr/ports/pobj/protobuf-3.3.1/protobuf-3.3.1/src/google/protobuf/lite_arena_unittest.cc
% /tmp/x
Running main() from gtest_main.cc
[==========] Running 0 tests from 0 test cases.
[==========] 0 tests from 0 test cases ran. (0 ms total)
[  PASSED  ] 0 tests.
%

Compare with port building the test:
% make test
...
c++ -std=c++11 -DHAVE_CONFIG_H -I.
-I/usr/ports/pobj/protobuf-3.3.1/protobuf-3.3.1/src -I..
-I/usr/local/include -D_POSIX_C_SOURCE=200809L -DGTEST_HAS_PTHREAD=1
-pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -g -MT
google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o -MD -MP
-MF google/protobuf/.deps/protobuf_lite_arena_test-lite_arena_unittest.Tpo
-c -o google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o
`test -f 'google/protobuf/lite_arena_unittest.cc' || echo
'/usr/ports/pobj/protobuf-3.3.1/protobuf-3.3.1/src/'`google/protobuf/lite_arena_unittest.cc
mv -f google/protobuf/.deps/protobuf_lite_arena_test-lite_arena_unittest.Tpo
google/protobuf/.deps/protobuf_lite_arena_test-lite_arena_unittest.Po
/usr/bin/libtool  --tag=CXX   --mode=link c++ -std=c++11 -pthread
-DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -g -pthread  -o
protobuf-lite-arena-test
google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o
google/protobuf/protobuf_lite_arena_test-arena_test_util.o
google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o
google/protobuf/protobuf_lite_arena_test-test_util_lite.o
google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_no_arena_lite.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o
-lpthread libprotobuf-lite.la -L/usr/local/lib -lgtest -lgmock
-lgmock_main -lz
libtool: link: c++ -o .libs/protobuf-lite-arena-test -pthread
-std=c++11 -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -g
google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o
google/protobuf/protobuf_lite_arena_test-arena_test_util.o
google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o
google/protobuf/protobuf_lite_arena_test-test_util_lite.o
google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_no_arena_lite.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o
google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o
-L.libs -lpthread -lprotobuf-lite -lz -lgtest -lestdc++ -lm -lgmock
-lgmock_main -Wl,-rpath-link,/usr/local/lib

% LD_LIBRARY_PATH=/usr/ports/pobj/protobuf-3.3.1/build-amd64/src/.libs
 /usr/ports/pobj/protobuf-3.3.1/build-amd64/src/.libs/protobuf-lite-arena-test
<buf-3.3.1/build-amd64/src/.libs/protobuf-lite-arena-test
Running main() from gmock_main.cc
[==========] Running 0 tests from 0 test cases.
[==========] 0 tests from 0 test cases ran. (0 ms total)
[  PASSED  ] 0 tests.
protobuf-lite-arena-test(94757) in free(): chunk is already free 0x556b6d62620
[1]    94757 abort (core dumped)
LD_LIBRARY_PATH=/usr/ports/pobj/protobuf-3.3.1/build-amd64/src/.libs
%
diff --git devel/protobuf/Makefile devel/protobuf/Makefile
index c54cb4c0a76..d9d32ade13a 100644
--- devel/protobuf/Makefile
+++ devel/protobuf/Makefile
@@ -2,13 +2,14 @@
 
 COMMENT =		c++ protocol buffers
 
-V =			2.4.1
-DISTNAME =		protobuf-$V
-REVISION =		5
+V=		3.3.1
+GH_ACCOUNT=	google
+GH_PROJECT=	protobuf
+GH_TAGNAME=	v$V
 
-SHARED_LIBS +=		protobuf	1.0   # 7.0
-SHARED_LIBS +=		protoc		1.0   # 7.0
-SHARED_LIBS +=		protobuf-lite	1.0   # 7.0
+SHARED_LIBS +=		protobuf	2.0   # 7.0
+SHARED_LIBS +=		protoc		2.0   # 7.0
+SHARED_LIBS +=		protobuf-lite	2.0   # 7.0
 
 CATEGORIES =		devel
 
@@ -19,13 +20,28 @@ PERMIT_PACKAGE_CDROM =	Yes
 
 WANTLIB +=	c m pthread ${LIBCXX} z
 
-MASTER_SITES =		https://github.com/google/protobuf/releases/download/v$V/
-
 TEST_DEPENDS =	devel/gtest
 
 SEPARATE_BUILD =	Yes
 USE_GMAKE =		Yes
+
 CONFIGURE_STYLE =	gnu
-CONFIGURE_ARGS +=	--with-zlib 
+CONFIGURE_ARGS +=	--with-zlib
+CONFIGURE_ENV =		CPPFLAGS="-D_POSIX_C_SOURCE=200809L -DGTEST_HAS_PTHREAD=1" CXXFLAGS=-g
+
+AUTOCONF_VERSION=	2.69
+AUTOMAKE_VERSION=	1.15
+BUILD_DEPENDS +=	${MODGNU_AUTOCONF_DEPENDS} \
+			${MODGNU_AUTOMAKE_DEPENDS} \
+			devel/libtool
+pre-configure:
+	cd ${WRKSRC} && \
+		libtoolize && \
+		env AUTOMAKE_VERSION=${AUTOMAKE_VERSION} AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+		autoreconf -fi -Wall,no-obsolete
+
+MODULES =		gcc4
+MODGCC4_ARCHS =		*
+MODGCC4_LANGS =		c++
 
 .include <bsd.port.mk>
diff --git devel/protobuf/distinfo devel/protobuf/distinfo
index e7b1df868db..c3f40ea3900 100644
--- devel/protobuf/distinfo
+++ devel/protobuf/distinfo
@@ -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-3.3.1.tar.gz) = MPI6Rcb0UVWYcCptGcQpW6ksSmNdetjTMaTbn8z/OS0=
+SIZE (protobuf-3.3.1.tar.gz) = 4336955
diff --git devel/protobuf/patches/patch-Makefile_am devel/protobuf/patches/patch-Makefile_am
new file mode 100644
index 00000000000..b47f4a5cd0e
--- /dev/null
+++ devel/protobuf/patches/patch-Makefile_am
@@ -0,0 +1,31 @@
+$OpenBSD$
+--- Makefile.am.orig	Sat Apr 22 21:26:57 2017
++++ Makefile.am	Sat Apr 22 21:28:06 2017
+@@ -11,16 +11,6 @@ SUBDIRS = . src
+ # Always include gmock in distributions.
+ DIST_SUBDIRS = $(subdirs) src conformance benchmarks
+ 
+-# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
+-# because then "make check" would also build and run all of gmock'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 gmock since we don't want to overwrite
+-# the installed version of gmock if there is one.
+-check-local:
+-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
+-	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+-	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+-
+ # We would like to clean gmock 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 gmock because it's listed among the
+@@ -28,10 +18,6 @@ check-local:
+ # cd to the directory again and "make clean" it will fail.  So, check that the
+ # Makefile exists before recursing.
+ clean-local:
+-	@if test -e gmock/Makefile; then \
+-	  echo "Making clean in gmock"; \
+-	  cd gmock && $(MAKE) $(AM_MAKEFLAGS) clean; \
+-	fi; \
+ 	if test -e conformance/Makefile; then \
+ 	  echo "Making clean in conformance"; \
+ 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
diff --git devel/protobuf/patches/patch-Makefile_in devel/protobuf/patches/patch-Makefile_in
deleted file mode 100644
index 81cc8107fc4..00000000000
--- devel/protobuf/patches/patch-Makefile_in
+++ /dev/null
@@ -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:
diff --git devel/protobuf/patches/patch-configure devel/protobuf/patches/patch-configure
deleted file mode 100644
index 95de9a8d826..00000000000
--- devel/protobuf/patches/patch-configure
+++ /dev/null
@@ -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"
diff --git devel/protobuf/patches/patch-configure_ac devel/protobuf/patches/patch-configure_ac
new file mode 100644
index 00000000000..1e500ecca1e
--- /dev/null
+++ devel/protobuf/patches/patch-configure_ac
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- configure.ac.orig
++++ configure.ac
+@@ -200,11 +200,6 @@ AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CO
+ 
+ AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
+ 
+-# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
+-#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
+-#   too.
+-export CFLAGS
+-export CXXFLAGS
+ AC_CONFIG_SUBDIRS([gmock])
+ 
+ AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
diff --git devel/protobuf/patches/patch-src_Makefile_am devel/protobuf/patches/patch-src_Makefile_am
new file mode 100644
index 00000000000..3a4272d249a
--- /dev/null
+++ devel/protobuf/patches/patch-src_Makefile_am
@@ -0,0 +1,84 @@
+$OpenBSD$
+Index: src/Makefile.am
+--- src/Makefile.am.orig
++++ src/Makefile.am
+@@ -749,11 +749,9 @@ check_PROGRAMS = protoc protobuf-test protobuf-lazy-de
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+                  no-warning-test $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                      ../gmock/gtest/lib/libgtest.la              \
+-                      ../gmock/lib/libgmock.la                    \
+-                      ../gmock/lib/libgmock_main.la
+-protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
+-                         -I$(srcdir)/../gmock/include
++                      -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
++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).
+ # See configure.ac for more info.
+@@ -838,11 +836,8 @@ 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 \
+                       libprotoc.la                                   \
+-                      ../gmock/gtest/lib/libgtest.la                 \
+-                      ../gmock/lib/libgmock.la                       \
+-                      ../gmock/lib/libgmock_main.la
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
+-                                         -I$(srcdir)/../gmock/gtest/include \
++                      -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
++protobuf_lazy_descriptor_test_CPPFLAGS = -I${LOCALBASE}/include \
+                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
+ protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lazy_descriptor_test_SOURCES =                        \
+@@ -863,11 +858,8 @@ 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 \
+-                           ../gmock/gtest/lib/libgtest.la      \
+-                           ../gmock/lib/libgmock.la            \
+-                           ../gmock/lib/libgmock_main.la
+-protobuf_lite_test_CPPFLAGS= -I$(srcdir)/../gmock/include \
+-                             -I$(srcdir)/../gmock/gtest/include
++			   -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
++protobuf_lite_test_CPPFLAGS= -I${LOCALBASE}/include
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES =                                           \
+   google/protobuf/lite_unittest.cc                                     \
+@@ -878,11 +870,8 @@ 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 \
+-                      ../gmock/gtest/lib/libgtest.la                 \
+-                      ../gmock/lib/libgmock.la                       \
+-                      ../gmock/lib/libgmock_main.la
+-protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
+-                                    -I$(srcdir)/../gmock/gtest/include
++                      -L${LOCALBASE}/lib -lgtest -lgmock -lgmock_main
++protobuf_lite_arena_test_CPPFLAGS = -I${LOCALBASE}/include
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES =       \
+   google/protobuf/lite_arena_unittest.cc \
+@@ -891,8 +880,8 @@ nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lit
+ 
+ # Test plugin binary.
+ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                    ../gmock/gtest/lib/libgtest.la
+-test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
++                      -L${LOCALBASE}/lib -lgtest
++test_plugin_CPPFLAGS = -I${LOCALBASE}/include
+ test_plugin_SOURCES =                                          \
+   google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \
+@@ -921,9 +910,8 @@ no_warning_test.cc:
+ 	echo "TEST(NoWarningTest, Empty) {}" >> no_warning_test.cc
+ 
+ no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la      \
+-                        ../gmock/gtest/lib/libgtest.la      \
+-                        ../gmock/gtest/lib/libgtest_main.la
+-no_warning_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
++                        -L${LOCALBASE}/lib -lgtest -lgtest_main
++no_warning_test_CPPFLAGS =  -I${LOCALBASE}/include
+ no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
+                            -Wall -Werror
+ nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)
diff --git devel/protobuf/patches/patch-src_Makefile_in devel/protobuf/patches/patch-src_Makefile_in
deleted file mode 100644
index 417670b5794..00000000000
--- devel/protobuf/patches/patch-src_Makefile_in
+++ /dev/null
@@ -1,78 +0,0 @@
-$OpenBSD: patch-src_Makefile_in,v 1.3 2017/05/17 20:23:45 sthen Exp $
-
-Index: src/Makefile.in
---- src/Makefile.in.orig
-+++ src/Makefile.in
-@@ -156,8 +156,8 @@ 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 \
- 	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
- 	$(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) \
-@@ -224,8 +224,8 @@ nodist_protobuf_test_OBJECTS = $(am__objects_8)
- 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
-+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)
- 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
-+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
- 
- 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
- 
--protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include         \
--                         -I$(top_builddir)/gtest/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)
- 
- # 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  \
-                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
- 
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
-@@ -764,10 +761,9 @@ nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outp
- 
- # 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
- 
- test_plugin_SOURCES = \
-   google/protobuf/compiler/mock_code_generator.cc              \
diff --git devel/protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc
deleted file mode 100644
index ca2f9d3efb3..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_compiler_cpp_cpp_unittest_cc
+++ /dev/null
@@ -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) {
diff --git devel/protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc
deleted file mode 100644
index 6490d8e4dfd..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_extension_set_unittest_cc
+++ /dev/null
@@ -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) {
diff --git devel/protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc
deleted file mode 100644
index f213029f094..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_generated_message_reflection_unittest_cc
+++ /dev/null
@@ -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) {
diff --git devel/protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc
deleted file mode 100644
index b095ecde8c0..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_io_printer_unittest_cc
+++ /dev/null
@@ -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) {
diff --git devel/protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc
deleted file mode 100644
index 7e4158f2ef5..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_io_tokenizer_unittest_cc
+++ /dev/null
@@ -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
diff --git devel/protobuf/patches/patch-src_google_protobuf_message_cc devel/protobuf/patches/patch-src_google_protobuf_message_cc
deleted file mode 100644
index 1a1a7c63de0..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_message_cc
+++ /dev/null
@@ -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>
diff --git devel/protobuf/patches/patch-src_google_protobuf_message_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_message_unittest_cc
deleted file mode 100644
index 9c132452caf..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_message_unittest_cc
+++ /dev/null
@@ -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) {
diff --git devel/protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc
deleted file mode 100644
index c9a270913a4..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_reflection_ops_unittest_cc
+++ /dev/null
@@ -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) {
diff --git devel/protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc devel/protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc
deleted file mode 100644
index 9a355764a67..00000000000
--- devel/protobuf/patches/patch-src_google_protobuf_repeated_field_unittest_cc
+++ /dev/null
@@ -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;
- 

Reply via email to