misc/141410: [patch] games/vavoom - unbreak build (cmake problem?)

Barbara barbara.xxx1975 at libero.it
Sat Dec 12 21:40:03 UTC 2009

>Number:         141410
>Category:       misc
>Synopsis:       [patch] games/vavoom - unbreak build (cmake problem?)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 12 21:40:02 UTC 2009
>Originator:     Barbara
>Release:        RELENG_7
FreeBSD satanasso.local.net 7.2-STABLE FreeBSD 7.2-STABLE #0: Wed Dec  9 09:43:05 CET 2009     root at satanasso.local.net:/usr/obj/usr/src/sys/SATANASSO  i386
To solve the build failure for games/vavoom (http://lists.freebsd.org/pipermail/cvs-ports/2009-December/184634.html), I wrote the attached patch. This will detach the build of vlaunch and it should let the build complete successfully.
I preferred commenting some parts and giving a message while keeping the options, so they could be used again when the problem will be completely fixed.

Anyway, digging more deeply into the problem, I think that the problem is how cmake plays with wxgtk.
In fact, running wxgtk2u-2.8-config (unicode) to get the correct cxxflags, I get:
# /usr/local/bin/wxgtk2u-2.8-config --cxxflags
-I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -D_THREAD_SAFE

but after the failure, in work/vavoom-1.30/utils/vlaunch/CMakeFiles/vlaunch.dir/flags.make, I see
CXX_FLAGS = -O2 -pipe -march=athlon-mp -I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8   _FILE_OFFSET_BITS=64 _LARGE_FILES __WXGTK__ _THREAD_SAFE

which are clearly wrong.

The problem should be in /usr/local/share/cmake/Modules/FindwxWidgets.cmake
Patching it with the following, should fix also when building with WITH_LAUCHER
--- FindwxWidgets.cmake.orig	2009-12-09 23:46:45.000000000 +0100
+++ FindwxWidgets.cmake	2009-12-12 21:07:46.000000000 +0100
@@ -718,10 +718,10 @@
         # parse definitions from cxxflags; drop -D* from CXXFLAGS and the -D prefix
         STRING(REGEX MATCHALL "-D[^;]+"
           wxWidgets_DEFINITIONS  "${wxWidgets_CXX_FLAGS}")
-        STRING(REGEX REPLACE "-D[^;]+;" ""
-          wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-        STRING(REPLACE "-D" ""
-          wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
+        #STRING(REGEX REPLACE "-D[^;]+;" ""
+        #  wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
+        #STRING(REPLACE "-D" ""
+        #  wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
         # parse include dirs from cxxflags; drop -I prefix
         STRING(REGEX MATCHALL "-I[^;]+"

I think that this could break other ports depending on wxgtk and cmake (if any).
I don't know if it's worth patching cmake port as well. Anyway I'll try to report it to cmake authors.




Patch attached with submission follows:

--- Makefile.orig	2009-12-12 15:27:41.000000000 +0100
+++ Makefile	2009-12-12 22:29:33.000000000 +0100
@@ -21,7 +21,7 @@
 OPTIONS=	ALLEGRO "Use Allegro for hardware API" off \
 		FLAC "Enable FLAC support" off \
-		LAUNCHER "Build GUI launcher" on \
+		LAUNCHER "Build GUI launcher" off \
 		LIBMAD "Enable MP3 support" off \
 		MIKMOD "Enable MikMod support" off \
 		OPENAL "Enable OpenAL support" off \
@@ -29,12 +29,10 @@
 		OPTIMIZED_CFLAGS "Enable compilation optimizations" off \
 		VORBIS "Enable Ogg Vorbis support" off \
 		SDL "Use SDL for hardware API" on \
-		WXUNICODE "Enable Unicode support" on
+		WXUNICODE "Enable Unicode support" off
 SUB_FILES=	pkg-message
-BROKEN=		fails to build with new cmake.
 .include <bsd.port.pre.mk>
 # The `-fno-strict-aliasing' flag (default on FreeBSD 6.0+) produces
@@ -64,15 +62,15 @@
-.if defined(WITH_LAUNCHER)
-USE_WX=		2.4+
+#.if defined(WITH_LAUNCHER)
+#USE_WX=		2.4+
 PLIST_SUB+=	LAUNCHER="@comment "
 .if defined(WITH_LIBMAD)
 LIB_DEPENDS+=	mad.2:${PORTSDIR}/audio/libmad
@@ -128,6 +126,14 @@
+.if defined(WITH_LAUNCHER)
+	@${ECHO_MSG}    ""
+	@${ECHO_MSG}    "===> Even if WITH_LAUNCHER has been set, vlauch will not"
+	@${ECHO_MSG}    "===> be built because of a problem with cmake and wxgtk"
+	@${ECHO_MSG}    ""
 	@cd ${WRKSRC} && ${SH} fixunix.sh
 	@${REINPLACE_CMD} -e 's|$$\* ||; s|$${IWADDIR}|-iwaddir ${DMDIR} $$*|' \
--- files/pkg-message.in.orig	2008-04-24 18:41:23.000000000 +0200
+++ files/pkg-message.in	2009-12-12 22:26:59.000000000 +0100
@@ -12,6 +12,7 @@
 "games/vavoom-extras" port. Note that textures require OPENGL and soundtracks
 need VORBIS (build options).
-If you enabled LAUNCHER (build option), run "vlaunch" for a launcher GUI.
+Even if you enabled LAUNCHER (build option), the launcher GUI "vlaunch"
+has not been built because of a problem with cmake. It will be fixed ASAP.


More information about the freebsd-bugs mailing list