On Thu, Jun 21 2018, Theo Buehler <[email protected]> wrote:
> 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:

All consumers build-tested on sparc64 (except for x11/kde4/marble).
The updated diff below is needed, mostly because the protobuf headers
now require C++11 support.  The diff includes a slightly tweaked version
of your pokerth and mumble diffs.

As far as I'm concerned this is ready to go in, ok jca@


Index: net/mosh/Makefile
===================================================================
RCS file: /cvs/ports/net/mosh/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- net/mosh/Makefile   26 Jul 2017 22:45:28 -0000      1.15
+++ net/mosh/Makefile   10 Jul 2018 09:40:22 -0000
@@ -3,7 +3,7 @@
 COMMENT =              mobile shell
 
 DISTNAME =             mosh-1.3.2
-REVISION =             0
+REVISION =             1
 
 CATEGORIES =           net
 
@@ -19,6 +19,10 @@ WANTLIB +=           c crypto m ncursesw protobuf
 WANTLIB +=             z
 
 MASTER_SITES =         ${HOMEPAGE}
+
+# C++11 needed by protobuf
+COMPILER =             base-clang ports-gcc
+CXXFLAGS +=            -std=gnu++11
 
 LIB_DEPENDS =          devel/protobuf
 
Index: games/pokerth/Makefile
===================================================================
RCS file: /cvs/ports/games/pokerth/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- games/pokerth/Makefile      27 Jun 2018 21:03:49 -0000      1.40
+++ games/pokerth/Makefile      10 Jul 2018 09:14:50 -0000
@@ -5,7 +5,7 @@ COMMENT=        texas hold'em poker game with o
 BROKEN-hppa =  needs atomic ops
 
 DISTNAME =     pokerth-1.1.2
-REVISION =     0
+REVISION =     1
 
 CATEGORIES=    games x11
 
@@ -25,6 +25,7 @@ MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:
 
 # C++11
 COMPILER =     base-clang ports-gcc ports-clang
+CXXFLAGS +=    -std=gnu++11
 
 MODULES=       devel/qmake \
                x11/qt4
Index: games/pokerth/patches/patch-chatcleaner_proto
===================================================================
RCS file: games/pokerth/patches/patch-chatcleaner_proto
diff -N games/pokerth/patches/patch-chatcleaner_proto
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ games/pokerth/patches/patch-chatcleaner_proto       10 Jul 2018 08:57:27 
-0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+https://github.com/albmed/pokerth/commit/8e5b09ac62a66ed560ea9869caf3351959e399ce
 
+
+Index: chatcleaner.proto
+--- chatcleaner.proto.orig
++++ chatcleaner.proto
+@@ -29,6 +29,8 @@
+  * as that of the covered work.                                              *
+  
*****************************************************************************/
+ 
++syntax = "proto2";
++
+ option java_package = "de.chatcleaner.protocol";
+ option java_outer_classname = "ProtoBuf";
+ option optimize_for = LITE_RUNTIME;
Index: games/pokerth/patches/patch-pokerth_proto
===================================================================
RCS file: games/pokerth/patches/patch-pokerth_proto
diff -N games/pokerth/patches/patch-pokerth_proto
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ games/pokerth/patches/patch-pokerth_proto   10 Jul 2018 08:57:27 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+https://github.com/albmed/pokerth/commit/8e5b09ac62a66ed560ea9869caf3351959e399ce
+
+Index: pokerth.proto
+--- pokerth.proto.orig
++++ pokerth.proto
+@@ -29,6 +29,8 @@
+  * as that of the covered work.                                              *
+  
*****************************************************************************/
+ 
++syntax = "proto2";
++
+ option java_package = "de.pokerth.protocol";
+ option java_outer_classname = "ProtoBuf";
+ option optimize_for = LITE_RUNTIME;
+@@ -701,7 +703,7 @@ message ReportGameAckMessage {
+ 
+ message ErrorMessage {
+       enum ErrorReason {
+-              reserved = 0;
++              custReserved = 0;
+               initVersionNotSupported = 1;
+               initServerFull = 2;
+               initAuthFailure = 3;
Index: games/pokerth/patches/patch-src_gui_qt_gametable_gametableimpl_cpp
===================================================================
RCS file: games/pokerth/patches/patch-src_gui_qt_gametable_gametableimpl_cpp
diff -N games/pokerth/patches/patch-src_gui_qt_gametable_gametableimpl_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ games/pokerth/patches/patch-src_gui_qt_gametable_gametableimpl_cpp  10 Jul 
2018 08:57:27 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+https://github.com/albmed/pokerth/commit/8e5b09ac62a66ed560ea9869caf3351959e399ce
+
+Index: src/gui/qt/gametable/gametableimpl.cpp
+--- src/gui/qt/gametable/gametableimpl.cpp.orig
++++ src/gui/qt/gametable/gametableimpl.cpp
+@@ -3859,7 +3859,7 @@ void gameTableImpl::triggerVoteOnKick(int id)
+       int playerCount = static_cast<int>(seatList->size());
+       if (id < playerCount) {
+               PlayerListIterator pos = seatList->begin();
+-              advance(pos, id);
++              std::advance(pos, id);
+               
myStartWindow->getSession()->startVoteKickPlayer((*pos)->getMyUniqueID());
+       }
+ }
Index: games/pokerth/patches/patch-src_net_common_netpacket_cpp
===================================================================
RCS file: games/pokerth/patches/patch-src_net_common_netpacket_cpp
diff -N games/pokerth/patches/patch-src_net_common_netpacket_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ games/pokerth/patches/patch-src_net_common_netpacket_cpp    10 Jul 2018 
08:57:27 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+https://github.com/albmed/pokerth/commit/8e5b09ac62a66ed560ea9869caf3351959e399ce
+
+Index: src/net/common/netpacket.cpp
+--- src/net/common/netpacket.cpp.orig
++++ src/net/common/netpacket.cpp
+@@ -249,7 +249,7 @@ NetPacket::GameErrorToNetError(int gameErrorReason)
+               retVal = ErrorMessage::sessionTimeout;
+               break;
+       default :
+-              retVal = ErrorMessage::reserved;
++              retVal = ErrorMessage::custReserved;
+               break;
+       }
+       return retVal;
Index: audio/clementine/Makefile
===================================================================
RCS file: /cvs/ports/audio/clementine/Makefile,v
retrieving revision 1.33
diff -u -p -r1.33 Makefile
--- audio/clementine/Makefile   29 Jun 2018 22:16:08 -0000      1.33
+++ audio/clementine/Makefile   10 Jul 2018 09:36:12 -0000
@@ -5,7 +5,7 @@ COMMENT =       Qt4-based featureful music pla
 V =            1.2.3
 DISTNAME =     clementine-${V}
 CATEGORIES =   audio x11
-REVISION =     12
+REVISION =     13
 
 HOMEPAGE =     http://clementine-player.org/
 
@@ -32,6 +32,7 @@ WANTLIB += plist
 
 MODULES =              devel/cmake x11/qt4
 COMPILER =             base-clang ports-gcc
+CXXFLAGS +=            -std=c++11
 
 BUILD_DEPENDS =                devel/boost \
                        devel/cmake>=2.8.10.2p3 \
Index: audio/clementine/patches/patch-ext_clementine-tagreader_CMakeLists_txt
===================================================================
RCS file: audio/clementine/patches/patch-ext_clementine-tagreader_CMakeLists_txt
diff -N audio/clementine/patches/patch-ext_clementine-tagreader_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ audio/clementine/patches/patch-ext_clementine-tagreader_CMakeLists_txt      
9 Jul 2018 16:30:38 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Respect CXXFLAGS
+
+Index: ext/clementine-tagreader/CMakeLists.txt
+--- ext/clementine-tagreader/CMakeLists.txt.orig
++++ ext/clementine-tagreader/CMakeLists.txt
+@@ -7,7 +7,7 @@ include_directories(${CMAKE_BINARY_DIR}/ext/libclement
+ include_directories(${CMAKE_SOURCE_DIR}/src)
+ include_directories(${CMAKE_BINARY_DIR}/src)
+ 
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x -U__STRICT_ANSI__")
++set(CMAKE_CXX_FLAGS "--std=c++0x -U__STRICT_ANSI__ ${CMAKE_CXX_FLAGS}")
+ 
+ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
+ 
Index: audio/clementine/patches/patch-ext_libclementine-common_CMakeLists_txt
===================================================================
RCS file: 
/cvs/ports/audio/clementine/patches/patch-ext_libclementine-common_CMakeLists_txt,v
retrieving revision 1.4
diff -u -p -r1.4 patch-ext_libclementine-common_CMakeLists_txt
--- audio/clementine/patches/patch-ext_libclementine-common_CMakeLists_txt      
12 Dec 2013 11:13:39 -0000      1.4
+++ audio/clementine/patches/patch-ext_libclementine-common_CMakeLists_txt      
9 Jul 2018 16:31:16 -0000
@@ -1,6 +1,20 @@
 $OpenBSD: patch-ext_libclementine-common_CMakeLists_txt,v 1.4 2013/12/12 
11:13:39 zhuk Exp $
---- ext/libclementine-common/CMakeLists.txt.orig       Sun Oct 20 05:37:02 2013
-+++ ext/libclementine-common/CMakeLists.txt    Sun Oct 20 05:38:11 2013
+
+1. Respect CXXFLAGS
+2. Switch Clementine to FindBacktrace.cmake
+
+Index: ext/libclementine-common/CMakeLists.txt
+--- ext/libclementine-common/CMakeLists.txt.orig
++++ ext/libclementine-common/CMakeLists.txt
+@@ -3,7 +3,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ include_directories(${CMAKE_SOURCE_DIR}/src)
+ 
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
++set(CMAKE_CXX_FLAGS "--std=c++0x ${CMAKE_CXX_FLAGS}")
+ 
+ set(SOURCES
+   core/closure.cpp
 @@ -33,3 +33,11 @@ target_link_libraries(libclementine-common
    ${TAGLIB_LIBRARIES}
    ${CMAKE_THREAD_LIBS_INIT}
Index: audio/clementine/patches/patch-src_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/audio/clementine/patches/patch-src_CMakeLists_txt,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_CMakeLists_txt
--- audio/clementine/patches/patch-src_CMakeLists_txt   1 Oct 2014 20:52:48 
-0000       1.3
+++ audio/clementine/patches/patch-src_CMakeLists_txt   9 Jul 2018 16:31:39 
-0000
@@ -1,13 +1,15 @@
 $OpenBSD: patch-src_CMakeLists_txt,v 1.3 2014/10/01 20:52:48 dcoppa Exp $
 1. -Wno-unused-private-field -Wno-unknown-warning-option dont exist on gcc 4.8
-2. FIX BUG 4401: No namespaces for DBus interfaces, from upstream.
---- src/CMakeLists.txt.orig    Wed Apr 23 12:16:44 2014
-+++ src/CMakeLists.txt Wed Oct  1 16:35:16 2014
+2. Respect CXXFLAGS
+3. FIX BUG 4401: No namespaces for DBus interfaces, from upstream.
+Index: src/CMakeLists.txt
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
 @@ -1,6 +1,6 @@
  
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wall 
-Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-local-typedefs 
-Wno-unused-private-field -Wno-unknown-warning-option --std=c++0x 
-U__STRICT_ANSI__")
-+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wall 
-Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-local-typedefs 
--std=c++0x -U__STRICT_ANSI__")
++set(CMAKE_CXX_FLAGS "-Woverloaded-virtual -Wall -Wno-sign-compare 
-Wno-deprecated-declarations -Wno-unused-local-typedefs --std=c++0x 
-U__STRICT_ANSI__ ${CMAKE_CXX_FLAGS}")
  
  option(BUILD_WERROR "Build with -Werror" ON)
  
Index: audio/clementine/patches/patch-tests_CMakeLists_txt
===================================================================
RCS file: audio/clementine/patches/patch-tests_CMakeLists_txt
diff -N audio/clementine/patches/patch-tests_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ audio/clementine/patches/patch-tests_CMakeLists_txt 9 Jul 2018 16:31:46 
-0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Respect CXXFLAGS
+
+Index: tests/CMakeLists.txt
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ 
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fpermissive 
-Wno-c++11-narrowing -U__STRICT_ANSI__")
++set(CMAKE_CXX_FLAGS "-std=c++0x -fpermissive -Wno-c++11-narrowing 
-U__STRICT_ANSI__ ${CMAKE_CXX_FLAGS}")
+ 
+ if(USE_SYSTEM_GMOCK)
+   include_directories(${GMOCK_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS})
Index: audio/mumble/Makefile
===================================================================
RCS file: /cvs/ports/audio/mumble/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- audio/mumble/Makefile       29 Jun 2018 22:16:09 -0000      1.31
+++ audio/mumble/Makefile       9 Jul 2018 16:43:20 -0000
@@ -5,7 +5,7 @@ COMMENT =               low-latency voice chat client
 GH_ACCOUNT =           mumble-voip
 GH_PROJECT =           mumble
 GH_TAGNAME =           1.2.19
-REVISION =             2
+REVISION =             3
 
 CATEGORIES =           audio
 
@@ -20,6 +20,8 @@ WANTLIB +=            lib/qt4/QtNetwork lib/qt4/Qt
 WANTLIB +=             lib/qt4/QtXml m opus portaudio protobuf
 WANTLIB +=             pthread sndfile speex speexdsp ssl ${COMPILER_LIBCXX}
 
+COMPILER =             base-clang ports-gcc
+
 MODULES =              devel/qmake x11/qt4
 SEPARATE_BUILD =       No
 
@@ -37,8 +39,10 @@ RUN_DEPENDS =                audio/celt07 \
                        devel/desktop-file-utils \
                        x11/gtk+3,-guic
 
+# CONFIG+=c++11 because of protobuf
 MODQMAKE_ARGS =                MUMBLE_PREFIX=${PREFIX} \
                        QMAKE_LRELEASE=${MODQT_LRELEASE} \
+                       CONFIG+=c++11 \
                        CONFIG+=no-11x \
                        CONFIG+=no-alsa \
                        CONFIG+=no-bonjour \

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to