Skip to content

Commit

Permalink
wx-3.0 ports: set appropriate c++ standards
Browse files Browse the repository at this point in the history
the non-cxx11 ports are set to c++03
the cxx11 ports are set to c++11

fixes build with compilers that default to a too-new
standard, such as clang-16
  • Loading branch information
kencu committed Jan 9, 2025
1 parent 52b930d commit 5afd513
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions graphics/wxWidgets-3.0/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PortGroup wxWidgets 1.0

github.setup wxWidgets wxWidgets 3.0.5.1 v
github.tarball_from releases
revision 4
revision 5

# macOS 15 Requirement: CGDisplayCreateImage fails as it's been removed
platform darwin 24 {
Expand Down Expand Up @@ -40,7 +40,7 @@ if {${subport} eq ${name}} {
} elseif {${subport} eq "wxPython-3.0"} {
wxWidgets.use wxPython-3.0
version 3.0.2
revision 8
revision 9
} elseif {${subport} eq "wxgtk-3.0"} {
# wxgtk-3.0 is need to support older systems where wxWidgets-3.0
# do not work correctly (they do build, but are unusable).
Expand Down Expand Up @@ -145,7 +145,11 @@ platform darwin powerpc {
}


if {${subport} eq "wxPython-3.0"} {
if {${subport} eq ${name}} {
configure.cxxflags-append -std=c++03

} elseif {${subport} eq "wxPython-3.0"} {

master_sites sourceforge:project/wxwindows/${version} \
http://biolpc22.york.ac.uk/pub/${version}/ \
http://trac.macports.org/raw-attachment/ticket/19190/:trac
Expand Down Expand Up @@ -179,6 +183,8 @@ if {${subport} eq "wxPython-3.0"} {
patch-upstream-strvararg.diff \
patch-upstream-webkit-proper-types.diff

configure.cxxflags-append -std=c++03

# https://trac.macports.org/ticket/52069
if {${os.platform} eq "darwin" && ${os.major} >= 16} {
# The patch probably works on all OS X versions,
Expand Down Expand Up @@ -215,6 +221,8 @@ if {${subport} eq "wxPython-3.0"} {
--without-sdl
configure.args-append --with-sdl

configure.cxxflags-append -std=c++03

#variant gtk2 conflicts gtk3 description {} {
# depends_lib-append path:lib/pkgconfig/gtk+-2.0.pc:gtk2
# configure.args-append --with-gtk=2
Expand Down Expand Up @@ -272,11 +280,18 @@ if {${subport} eq "wxPython-3.0"} {

configure.args-replace --with-cocoa --with-gtk=3 \
--without-sdl --with-sdl
}

if {${subport} eq "wxgtk-3.0" || ${subport} eq "wxgtk-3.0-cxx11"} {
configure.cxxflags-append -std=c++11

} elseif {${subport} eq "wxgtk-3.0"} {
# Address this bug: https://trac.macports.org/ticket/70124
patchfiles-append patch-no-osx-evtloopsrc.h.diff
configure.cxxflags-append -std=c++03

} elseif {${subport} eq "wxgtk-3.0-cxx11"} {
# Address this bug: https://trac.macports.org/ticket/70124
patchfiles-append patch-no-osx-evtloopsrc.h.diff
configure.cxxflags-append -std=c++11
}

post-destroot {
Expand Down

0 comments on commit 5afd513

Please sign in to comment.