From owner-svn-ports-head@freebsd.org Sat Aug 12 13:15:49 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33DA4DD5F6E; Sat, 12 Aug 2017 13:15:49 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E50B1EDF; Sat, 12 Aug 2017 13:15:48 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7CDFlFh084915; Sat, 12 Aug 2017 13:15:47 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7CDFlXX084911; Sat, 12 Aug 2017 13:15:47 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201708121315.v7CDFlXX084911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Sat, 12 Aug 2017 13:15:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r447827 - in head/games/openlierox: . files X-SVN-Group: ports-head X-SVN-Commit-Author: rakuco X-SVN-Commit-Paths: in head/games/openlierox: . files X-SVN-Commit-Revision: 447827 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Aug 2017 13:15:49 -0000 Author: rakuco Date: Sat Aug 12 13:15:47 2017 New Revision: 447827 URL: https://svnweb.freebsd.org/changeset/ports/447827 Log: Fix build errors with clang and GCC 6. Add a few patches to fix several different build errors that prevented the port from building with GCC 6 (which uses C++14 by default) as well as clang from base. PR: 219294 Approved by: maintainer timeout (amdmi3, 17 days) Added: head/games/openlierox/files/patch-include_GfxPrimitives.h (contents, props changed) head/games/openlierox/files/patch-include_StaticAssert.h (contents, props changed) head/games/openlierox/files/patch-libs_pstreams_pstream.h (contents, props changed) Modified: head/games/openlierox/Makefile Modified: head/games/openlierox/Makefile ============================================================================== --- head/games/openlierox/Makefile Sat Aug 12 13:09:34 2017 (r447826) +++ head/games/openlierox/Makefile Sat Aug 12 13:15:47 2017 (r447827) @@ -3,7 +3,7 @@ PORTNAME= openlierox DISTVERSION= 0.58_rc3 -PORTREVISION= 11 +PORTREVISION= 12 PORTEPOCH= 1 CATEGORIES= games MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/OpenLieroX%20${DISTVERSION:C/_/%20/} @@ -19,7 +19,6 @@ LIB_DEPENDS= libgd.so:graphics/gd \ USES= tar:bzip2 cmake openal:al,alut pkgconfig USE_SDL= sdl image USE_GNOME= libxml2 -USE_GCC= any # too many gcc'isms CFLAGS+= -I${LOCALBASE}/include CXXFLAGS+= -I${LOCALBASE}/include @@ -60,6 +59,9 @@ post-patch: s|/usr/local|${LOCALBASE}|' ${WRKSRC}/CMakeOlxCommon.cmake @${FIND} ${WRKSRC} \( -name "*.cpp" -o -name "*.h" -o -name "*.cc" \) -print0 | ${XARGS} -0 -n1 \ ${REINPLACE_CMD} -e '/include.*curl\/types.h/ d' +# Convert the static_assert calls to regular, C++ ones. + @${FIND} ${WRKSRC} \( -name "*.cpp" -o -name "*.h" -o -name "*.cc" \) -print0 | ${XARGS} -0 -n1 \ + ${REINPLACE_CMD} -E -e 's/static_assert\((.+), (.+)\)/static_assert\(\1, "\2"\)/g' do-install: ${INSTALL_PROGRAM} ${WRKSRC}/bin/openlierox ${STAGEDIR}${PREFIX}/bin/ Added: head/games/openlierox/files/patch-include_GfxPrimitives.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/openlierox/files/patch-include_GfxPrimitives.h Sat Aug 12 13:15:47 2017 (r447827) @@ -0,0 +1,32 @@ +Provide missing constructor. + +./include/CMap.h:423:18: error: no matching constructor for initialization of 'SDLRect' (aka 'OLXRect') + if(!r.clipWith(SDLRect(0, 0, Width, Height))) + ^ ~~~~~~~~~~~~~~~~~~~ +./include/GfxPrimitives.h:161:2: note: candidate constructor not viable: requires single argument 'r', but 4 arguments were provided + OLXRect(const _RectBasic & r): _RectBasic(r) {} + ^ +--- include/GfxPrimitives.h.orig 2017-07-26 12:33:41 UTC ++++ include/GfxPrimitives.h +@@ -106,6 +106,12 @@ class SDLRectBasic : public SDL_Rect { (public) + typedef Uint16 TypeS; + + SDLRectBasic() { this->SDL_Rect::x = this->SDL_Rect::y = this->SDL_Rect::w = this->SDL_Rect::h = 0; } ++ SDLRectBasic(Type x_, Type y_, TypeS w_, TypeS h_) { ++ this->SDL_Rect::x = x_; ++ this->SDL_Rect::y = y_; ++ this->SDL_Rect::w = w_; ++ this->SDL_Rect::h = h_; ++ } + SDLRectBasic(const SDL_Rect & r): SDL_Rect(r) {} + Type& x() { return this->SDL_Rect::x; } + Type& y() { return this->SDL_Rect::y; } +@@ -158,6 +164,8 @@ template + class OLXRect : public _RectBasic { + public: + ++ OLXRect(typename _RectBasic::Type x_, typename _RectBasic::Type y_, ++ typename _RectBasic::TypeS w_, typename _RectBasic::TypeS h_): _RectBasic(x_, y_, w_, h_) {} + OLXRect(const _RectBasic & r): _RectBasic(r) {} + + class GetX2 { Added: head/games/openlierox/files/patch-include_StaticAssert.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/openlierox/files/patch-include_StaticAssert.h Sat Aug 12 13:15:47 2017 (r447827) @@ -0,0 +1,16 @@ +Use static_assert provided by the compiler to avoid redefining it and breaking +headers which use the official version. +--- include/StaticAssert.h.orig 2009-10-11 20:53:01 UTC ++++ include/StaticAssert.h +@@ -10,11 +10,5 @@ + #ifndef __OLX__STATICASSERT_H__ + #define __OLX__STATICASSERT_H__ + +-template class static_assert_failure; +-template <> class static_assert_failure { char foo; }; +-template class static_assert_test{}; +- +-#define static_assert(X, desc) \ +- typedef static_assert_test< (int)sizeof(static_assert_failure< (bool)(X) >) > static_assert_typedef_##desc; + + #endif Added: head/games/openlierox/files/patch-libs_pstreams_pstream.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/openlierox/files/patch-libs_pstreams_pstream.h Sat Aug 12 13:15:47 2017 (r447827) @@ -0,0 +1,49 @@ +Use the type basic_pstreambuf::fd_type is a typedef of. + +./libs/pstreams/pstream.h:1742:28: error: return type of out-of-line definition of 'redi::basic_pstreambuf::wpipe' differs from that in the declaration + basic_pstreambuf::wpipe() + ^ +./libs/pstreams/pstream.h:221:7: note: previous declaration is here + wpipe(); + ^ +./libs/pstreams/pstream.h:1750:28: error: return type of out-of-line definition of 'redi::basic_pstreambuf::rpipe' differs from that in the declaration + basic_pstreambuf::rpipe() + ^ +./libs/pstreams/pstream.h:225:7: note: previous declaration is here + rpipe(); + ^ +./libs/pstreams/pstream.h:1758:28: error: return type of out-of-line definition of 'redi::basic_pstreambuf::rpipe' differs from that in the declaration + basic_pstreambuf::rpipe(buf_read_src which) + ^ +./libs/pstreams/pstream.h:229:7: note: previous declaration is here + rpipe(buf_read_src which); + ^ +--- libs/pstreams/pstream.h.orig 2017-07-26 12:51:55 UTC ++++ libs/pstreams/pstream.h +@@ -1738,7 +1738,7 @@ namespace redi + + /** @return a reference to the output file descriptor */ + template +- inline typename basic_pstreambuf::fd_type& ++ inline typename pstreams::fd_type& + basic_pstreambuf::wpipe() + { + return wpipe_; +@@ -1746,7 +1746,7 @@ namespace redi + + /** @return a reference to the active input file descriptor */ + template +- inline typename basic_pstreambuf::fd_type& ++ inline typename pstreams::fd_type& + basic_pstreambuf::rpipe() + { + return rpipe_[rsrc_]; +@@ -1754,7 +1754,7 @@ namespace redi + + /** @return a reference to the specified input file descriptor */ + template +- inline typename basic_pstreambuf::fd_type& ++ inline typename pstreams::fd_type& + basic_pstreambuf::rpipe(buf_read_src which) + { + return rpipe_[which];