Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 2014 19:23:12 +0100
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        Rusmir Dusko <nemysis@FreeBSD.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: [games/traingame] Build failures with FreeBSD 10
Message-ID:  <20140315192312.37b60fe2@kalimero.tijl.coosemans.org>
In-Reply-To: <20140313123143.475a63fc@nemysis3now>
References:  <20140313123143.475a63fc@nemysis3now>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/U7qLypClu2lTpGxMWbX4heW
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Thu, 13 Mar 2014 12:31:43 +0100 Rusmir Dusko wrote:
> Hello
> 
> Trainm Game not build more in FreeBSD 10.
> 
> With FreeBSD 9.1, 9.2 have all good worked.
> 
> 
> 10.0-RELEASE-p4 FreeBSD 10.0-RELEASE-p4 #0: Tue Jan 14 20:48:07 UTC 2014 amd64
> 
> This is first Cmake and then GCC Port.
> 
> Have too not worked in FreeBSD 10 with older boost 1.52.0.
> 
> With Clang not works at all.

Because the port depends on a C++ library like boost, it needs to be
build with the same C++ runtime library as boost.  On FreeBSD 10 that
is libc++.

I've attached a patch that makes the port build with clang/libc++ but
I haven't run-tested it.
--MP_/U7qLypClu2lTpGxMWbX4heW
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=traingame.patch

Index: games/traingame/Makefile
===================================================================
--- games/traingame/Makefile	(revision 348266)
+++ games/traingame/Makefile	(working copy)
@@ -22,10 +22,12 @@ LIB_DEPENDS=	libfreetype.so:${PORTSDIR}/
 
 WRKSRC=		${WRKDIR}/TrainGame-${PORTVERSION}
 
-USES=		cmake pkgconfig
+USES=		cmake compiler:c++11-lib pkgconfig
+USE_CXXSTD=	gnu++11
 USE_SDL=	sdl image
 USE_GL=		glew
-USE_GCC=	yes
+
+LDFLAGS+=	-L${LOCALBASE}/lib
 
 PORTDOCS=	model_notes.txt models.gnuplot
 
Index: games/traingame/files/patch-libc++
===================================================================
--- games/traingame/files/patch-libc++	(revision 0)
+++ games/traingame/files/patch-libc++	(working copy)
@@ -0,0 +1,27 @@
+--- src/CrossoverTrack.cpp.orig
++++ src/CrossoverTrack.cpp
+@@ -215,5 +215,5 @@
+ 
+ ITrackSegmentPtr make_crossover_track()
+ {
+-   return ITrackSegmentPtr(new CrossoverTrack);
++   return ITrackSegmentPtr(static_cast<ITrackSegment *>(new CrossoverTrack));
+ }
+--- src/SDLWindow.cpp.orig
++++ src/SDLWindow.cpp
+@@ -406,5 +406,5 @@
+ // Construct and initialise an OpenGL SDL window
+ IWindowPtr make_sdl_window()
+ {
+-   return shared_ptr<IWindow>(new SDLWindow);
++   return shared_ptr<IWindow>(static_cast<IWindow *>(new SDLWindow));
+ }
+--- src/StraightTrack.cpp.orig
++++ src/StraightTrack.cpp
+@@ -259,5 +259,5 @@
+       throw runtime_error("Illegal straight track direction: "
+          + lexical_cast<string>(a_direction));
+ 
+-   return ITrackSegmentPtr(new StraightTrack(real_dir));
++   return ITrackSegmentPtr(static_cast<ITrackSegment *>(new StraightTrack(real_dir)));
+ }

Property changes on: games/traingame/files/patch-libc++
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property

--MP_/U7qLypClu2lTpGxMWbX4heW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140315192312.37b60fe2>