Bug 199916 - games/wxlauncher: fails to build with WX3 on 8.4R and 9.3R
Summary: games/wxlauncher: fails to build with WX3 on 8.4R and 9.3R
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks: 199429
  Show dependency treegraph
 
Reported: 2015-05-04 08:52 UTC by Jan Beich
Modified: 2015-05-05 00:12 UTC (History)
2 users (show)

See Also:
lightside: maintainer-feedback+


Attachments
Force GCC to build in C++11 mode (495 bytes, patch)
2015-05-04 08:52 UTC, Jan Beich
jbeich: maintainer-approval? (lightside)
Details | Diff
unbreak -std=c++11 on FreeBSD 10+ (537 bytes, patch)
2015-05-04 10:23 UTC, Jan Beich
jbeich: maintainer-approval? (lightside)
Details | Diff
Proposed patch (since 385396 revision) (1.29 KB, patch)
2015-05-04 18:15 UTC, lightside
lightside: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2015-05-04 08:52:16 UTC
Created attachment 156323 [details]
Force GCC to build in C++11 mode

Since ports r383466 x11-toolkits/wxgtk30 have to build in C++11 mode. libstdc++ 4.2 in base (unlike libc++) lacks C++11 support.

In file included from /usr/local/include/wx-3.0/wx/string.h:46,
                 from /usr/local/include/wx-3.0/wx/memory.h:15,
                 from /usr/local/include/wx-3.0/wx/object.h:19,
                 from /usr/local/include/wx-3.0/wx/wx.h:15,
                 from /wrkdirs/usr/ports/games/wxlauncher/work/wxlauncher-release-0.
9.6/code/tabs/InstallPage.cpp:19:
/usr/local/include/wx-3.0/wx/strvararg.h:25:27: error: type_traits: No such file or directory
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-05-04 08:55:26 UTC
Oops, wrong component.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2015-05-04 10:23:29 UTC
Created attachment 156330 [details]
unbreak -std=c++11 on FreeBSD 10+

  // sys/_null.h on FreeBSD
  #if __cplusplus >= 201103L
  #define	NULL	nullptr

-std=c++11 with above NULL definition turns the following warning into an error:

  code/apis/ProfileManager.cpp:310:11: warning:
        comparison between NULL and non-pointer (NULL and 'int') [-Wnull-arithmetic]
                                  (NULL != lastDownloadNews.ParseFormat(
                                   ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

becomes

  code/apis/ProfileManager.cpp:310:11: error:
        use of overloaded operator '!=' is ambiguous (with operand types 'nullptr_t'
        and 'wxAnyStrPtr')
                                  (NULL != lastDownloadNews.ParseFormat(
                                   ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 3 lightside 2015-05-04 18:14:06 UTC
Hello, Jan Beich.

Thanks for the patches.

The patch in attachment 156330 [details] is clever, because there is a difference in wxDateTime::ParseFormat implementations for wxWidgets 2.8.12 (returns (const wxChar *)):
http://docs.wxwidgets.org/2.8.12/wx_wxdatetime.html#wxdatetimeparseformat
and wxWidgets 3.0.2 (returns bool):
http://docs.wxwidgets.org/3.0.2/classwx_date_time.html#a5d01d56c310d505a093f1a7f25086a1b
Otherwise it would be WX3 option dependent.
Comment 4 lightside 2015-05-04 18:15:02 UTC
Created attachment 156345 [details]
Proposed patch (since 385396 revision)

I attached my variant of the proposed patch, which contains your patches with some difference to attachment 156323 [details], where I placed WX3_CXXFLAGS and WX3_USES defines near WX3_DESC define (i.e. not functional change).
Comment 5 lightside 2015-05-04 18:28:30 UTC
Comment on attachment 156330 [details]
unbreak -std=c++11 on FreeBSD 10+

Trying to change maintainer-approval for attachment 156330 [details] with this comment.
Comment 6 lightside 2015-05-04 18:32:03 UTC
(In reply to comment #5)

No, the maintainer-approval didn't change. The bug 197656 didn't fix it, in my case.
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-05-05 00:10:46 UTC
A commit references this bug:

Author: jbeich
Date: Tue May  5 00:10:18 UTC 2015
New revision: 385434
URL: https://svnweb.freebsd.org/changeset/ports/385434

Log:
  games/wxlauncher: unbreak WX3 option on DragonFly and FreeBSD 8.x/9.x

  After r383466 building against wxgtk30 only worked with clang/libc++
  because libstdc++ 4.2 in base lacks C++11 support while newer libstdc++
  (from lang/gcc* or in base on DragonFly) requires explicit -std=c++11.

  Also, -std=c++11 on FreeBSD turns NULL into nullptr which sometimes
  breaks build.

  PR:		199916
  Approved by:	lightside <lightside@gmx.com> (maintainer)

Changes:
  head/games/wxlauncher/Makefile
  head/games/wxlauncher/files/patch-code_apis_ProfileManager.cpp
Comment 8 Jan Beich freebsd_committer freebsd_triage 2015-05-05 00:12:36 UTC
Thanks. Committed.