Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
qt5*: ensure C++-11 support for all supported OSs
  • Loading branch information
MarcusCalhoun-Lopez committed Feb 17, 2017
1 parent 72f9ad9 commit fd4e329
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 70 deletions.
83 changes: 45 additions & 38 deletions aqua/qt5/Portfile
Expand Up @@ -25,6 +25,9 @@ unset just_want_qt5_variables
set branch [join [lrange [split ${version} .] 0 1] .]
set qt_major [lindex [split ${version} .] 0]

# Qt builds differently when it detects C++-11
PortGroup cxx11 1.1

master_sites \
http://download.qt.io/official_releases/qt/${branch}/${version}/submodules \
http://download.qt.io/community_releases/${branch}/${version}
Expand Down Expand Up @@ -123,7 +126,7 @@ array set modules {
{"Qt3D Core" "Qt3D Input" "Qt3D Logic" "Qt3D Renderer"}
"technology preview modules"
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtbase {
Expand All @@ -135,7 +138,7 @@ array set modules {
{"Qt Gui" "Qt Widgets" "Qt Print Support" "Qt OpenGL" "Qt Core" "Qt XML" "Qt SQL" "Qt Network" "Qt Test" "Qt D-Bus" "Qt Concurrent" "Qt Platform Headers"}
""
"variant overrides: ~docs"
"revision 2"
"revision 3"
"License: "
}
qtcanvas3d {
Expand All @@ -147,7 +150,7 @@ array set modules {
{"Qt Canvas 3D"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtconnectivity {
Expand All @@ -159,7 +162,7 @@ array set modules {
{"Qt Bluetooth" "Qt NFC"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtenginio {
Expand All @@ -171,7 +174,7 @@ array set modules {
{"Enginio"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtdeclarative {
Expand All @@ -183,7 +186,7 @@ array set modules {
{"Qt QML" "Qt Quick" "Qt Quick Widgets"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtdoc {
Expand All @@ -195,7 +198,7 @@ array set modules {
{"Qt Reference Documentation"}
"requires all documentation"
"variant overrides: ~examples ~tests ~debug noarch ~docs"
"revision 0"
"revision 1"
"License: "
}
qtgraphicaleffects {
Expand All @@ -207,7 +210,7 @@ array set modules {
{"Qt Graphical Effects"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtimageformats {
Expand All @@ -219,7 +222,7 @@ array set modules {
{"Qt Image Formats"}
""
"variant overrides: "
"revision 2"
"revision 3"
"License: "
}
qtlocation {
Expand All @@ -231,7 +234,7 @@ array set modules {
{"Qt Location" "Qt Positioning"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtmacextras {
Expand All @@ -243,7 +246,7 @@ array set modules {
{"Qt Mac Extras"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtmultimedia {
Expand All @@ -255,7 +258,7 @@ array set modules {
{"Qt Multimedia" "Qt Multimedia Widgets"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtquickcontrols {
Expand All @@ -267,7 +270,7 @@ array set modules {
{"Qt Quick Controls" "Qt Quick Dialogs" "Qt Quick Layouts" "Qt Quick Extras"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtquickcontrols2 {
Expand All @@ -279,7 +282,7 @@ array set modules {
{"Qt Labs Controls"}
"technology preview module"
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtscript {
Expand All @@ -291,7 +294,7 @@ array set modules {
{"Qt Script" "Qt Script Tools"}
"deprecated in favor QJS* in Qt QML"
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtsensors {
Expand All @@ -303,7 +306,7 @@ array set modules {
{"Qt Sensors"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtserialbus {
Expand All @@ -315,7 +318,7 @@ array set modules {
{"Qt Serial Bus"}
"technology preview module"
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtserialport {
Expand All @@ -327,7 +330,7 @@ array set modules {
{"Qt Serial Port"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtsvg {
Expand All @@ -339,7 +342,7 @@ array set modules {
{"Qt SVG"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qttools {
Expand All @@ -351,7 +354,7 @@ array set modules {
{"Qt Help" "Qt UI Tools" "Qt Designer"}
""
"variant overrides: "
"revision 1"
"revision 2"
"License: "
}
qttranslations {
Expand All @@ -363,7 +366,7 @@ array set modules {
{"translation files"}
""
"variant overrides: ~examples ~tests ~debug noarch ~docs"
"revision 0"
"revision 1"
"License: "
}
qtwebchannel {
Expand All @@ -375,7 +378,7 @@ array set modules {
{"Qt WebChannel"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtwebengine {
Expand All @@ -387,7 +390,7 @@ array set modules {
{"Qt WebEngine" "Qt WebEngine Widgets"}
"very large and relatively new; requires newer version of OS X"
"variant overrides: ~universal"
"revision 0"
"revision 1"
"License: "
}
qtwebkit {
Expand All @@ -399,7 +402,7 @@ array set modules {
{"Qt WebKit" "Qt WebKit Widgets"}
"community support only (use Qt WebEngine)"
"variant overrides: "
"revision 1"
"revision 2"
"License: "
}
qtwebsockets {
Expand All @@ -411,7 +414,7 @@ array set modules {
{"Qt WebSockets"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
qtwebview {
Expand All @@ -423,7 +426,7 @@ array set modules {
{"Qt WebView"}
"new in 5.6.0; requires qtwebengine"
"variant overrides: ~universal"
"revision 0"
"revision 1"
"License: "
}
qtxmlpatterns {
Expand All @@ -435,7 +438,7 @@ array set modules {
{"Qt XML Patterns"}
""
"variant overrides: "
"revision 0"
"revision 1"
"License: "
}
}
Expand All @@ -452,7 +455,7 @@ array set modules {
#
###############################################################################
array set sql_plugins {
{sqlite SQLite "revision 0"} {
{sqlite SQLite "revision 1"} {
{
"sqlite3"
"port:sqlite3"
Expand All @@ -461,7 +464,7 @@ array set sql_plugins {
""
}
}
{psql PostgreSQL "revision 0"} {
{psql PostgreSQL "revision 1"} {
{
"postgresql95"
"port:postgresql95"
Expand All @@ -484,7 +487,7 @@ array set sql_plugins {
""
}
}
{mysql MySQL "revision 0"} {
{mysql MySQL "revision 1"} {
{
"mariadb55"
"port:mariadb"
Expand Down Expand Up @@ -709,8 +712,19 @@ foreach {module module_info} [array get modules] {
patchfiles-append patch-mkspecs.diff
post-patch {

if {${cxx_stdlib} eq "libc++"} {
set replace_cxx_stdlib ${cxx_stdlib}
} else {
# see cxx11 PortGroup
if {${os.major} < 13} {
set replace_cxx_stdlib "macports-libstdc++ -D_GLIBCXX_USE_CXX11_ABI=0"
} else {
set replace_cxx_stdlib "macports-libstdc++"
}
}

reinplace \
"s|__MACPORTS__CXX_STDLIB__|${cxx_stdlib}|g" \
"s|__MACPORTS__CXX_STDLIB__|${replace_cxx_stdlib}|g" \
${worksrcpath}/mkspecs/common/clang-mac.conf

foreach spec {macx-clang macx-clang-32 macx-g++ macx-g++-32 macx-g++40 macx-g++42 macx-icc macx-llvm} {
Expand Down Expand Up @@ -1089,8 +1103,6 @@ foreach {module module_info} [array get modules] {
# special case
if { ${module} eq "qtwebkit" } {

PortGroup cxx11 1.0

# use MacPorts icu
#
# qmake uses pkgconfig to look for icu
Expand Down Expand Up @@ -1195,11 +1207,6 @@ foreach {module module_info} [array get modules] {
}
}

# special case
if { ${module} eq "qtserialbus" } {
PortGroup cxx11 1.0
}

# special case
if { ${module} eq "qtconnectivity" } {
# https://codereview.qt-project.org/#/c/172619/
Expand Down

0 comments on commit fd4e329

Please sign in to comment.