# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 name qt5 # special case if { ${subport} eq "qt5-qtwebkit" } { version 5.5.1 revision 5 notes-append "Qt Webkit is no longer supported upstream. The port ${subport} will be removed if it becomes unfeasible to maintain." } elseif { ${subport} eq "qt5-qtquick1" } { version 5.5.1 revision 4 notes-append "Qt Declarative is no longer supported upstream. The port ${subport} will be removed if it becomes unfeasible to maintain." } elseif { ${subport} eq "qt5-qtwebkit-examples" } { version 5.5.1 revision 4 notes-append "Qt Webkit is no longer supported upstream. The port ${subport} will be removed if it becomes unfeasible to maintain." } else { version 5.6.1 } if { ${subport} eq "qt5-qtbase" } { revision 1 } if { ${subport} eq "qt5-mysql-plugin" } { revision 2 } if { ${subport} eq "qt5-psql-plugin" } { revision 1 } if { ${subport} eq "qt5-sqlite-plugin" } { revision 1 } # get Qt's version numbers set branch [join [lrange [split ${version} .] 0 1] .] set qt_major [lindex [split ${version} .] 0] categories aqua platforms macosx maintainers mcalhoun openmaintainer license {LGPL-2.1 LGPL-3 GPL-3} homepage http://qt.io # generate documentation from complete code base # generate modules from separate downloads if { ${subport} ne "${name}-docs" } { master_sites http://download.qt.io/official_releases/qt/${branch}/${version}/submodules } else { master_sites http://download.qt.io/official_releases/qt/${branch}/${version}/single/ } if { ${subport} ne ${name} } { # file sizes are significantly smaller using xz use_xz yes } ############################################################################### Modules Not Considered # # No qt5 (Doesn't Install Anything) # No qtactiveqt (Windows Only) # No qtandroidextras (Android Only) # No qtdoc (Doesn't Install Anything) # No qtwayland (Linux Only) # No qtx11extras (X11 Only) # No qtwinextras (Windows Only) # ############################################################################### ############################################################################### Finding Dependencies # # grep -r "%dependencies" * # find ./ -name sync.profile # # grep -r qtCompileTest * # # find ./ -name config.tests # # find ./ -name Find\*.cmake # ############################################################################### ############################################################################### Notes # # qtconnectivity checks for bluetooth libraries # bluez and bluez_le (Linux Only) # # qtconnectivity depends on # qtandroidextras (Android Only) # # qtserialport depends on # ntddmodm (Windows Only) # # qttools depends on # qtactiveqt (Windows Only) # # qtquick1 depends on # qtactiveqt (Windows Only) # # qtwebkit has tests for libraries in: # Tools/qmake/mkspecs/features/configure.prf # Tools/qmake/config.tests/ # ############################################################################### ############################################################################### TODO # # TODO: possible to trim dependencies of qtbase? # TODO: support older versions of OS X via different versions of Qt 5 # ############################################################################### ############################################################################### Module Format # # "Qt Module Name" { # checksum, rmd160 # checksum, sha256 # dependencies, build # dependencies, lib # dependencies, Qt module name # Qt components provided # included in "standard" installation of Qt (empty string is no, explanation string is yes) # variant overrides # } # # module info found at https://doc.qt.io/qt-5/qtmodules.html # ############################################################################### array set modules { qt3d { 03d9f6c85f2fedcb1480a6a23e0191c7e6e859fb ad93015165b1ab1a8b458e08503c8f4c8450c2b58024a3ac074281a1a90ea80d "" "port:assimp" "qtbase qtxmlpatterns qtdeclarative qtimageformats" {"Qt3D Core" "Qt3D Input" "Qt3D Logic" "Qt3D Renderer"} "technology preview modules" "variant overrides: " } qtbase { 3811f2b945e05870ede6ae4eed237e8ba65a4f05 d01cc1ee2be9ecdb169be3aea9dc9fc019c1c6d0bb87e0c88bb95b5b3dce7264 "" "port:zlib port:libpng port:jpeg port:fontconfig port:freetype path:bin/dbus-daemon:dbus path:lib/libssl.dylib:openssl port:tiff port:libmng path:lib/pkgconfig/glib-2.0.pc:glib2 port:icu port:pcre port:libiconv port:harfbuzz" "" {"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: " } qtcanvas3d { 139dcfd920ded3db43b2dd5cd1191b20171ebf2d 191e2cde0ac8b1ef6616263aac27f12f40335fed2bd60e29987724242b872760 "" "" "qtbase qtdeclarative" {"Qt Canvas 3D"} "" "variant overrides: " } qtconnectivity { 79b26da05686ec6cc57188e87383f9f97c309f10 5a35abf6b515091e4b181b78d0ed82249972bf93f227d52c70531417c448d919 "" "" "qtbase qtdeclarative qtxmlpatterns" {"Qt Bluetooth" "Qt NFC"} "" "variant overrides: " } qtdeclarative { 9a938dd7041a5b542db300491d839ea3bd20fafb 12fcfd4bc4bad469f07f8c5404d98646f88f61200b014d4fbcb3a0d9e70942b4 "port:python27" "" "qtbase qtxmlpatterns" {"Qt QML" "Qt Quick" "Qt Quick Widgets"} "" "variant overrides: " } qtenginio { c67e5bfafc774c19f62db8d1fd1be297de3776c5 627ddcfbbfc3ec1a83c9dbb5f24287b5cd6cb5d3b9d09af4d1c444c6ac147f0c "" "" "qtbase qtdeclarative qtxmlpatterns" {"Enginio"} "" "variant overrides: " } qtgraphicaleffects { 16dc294725e0b513ba4afd3e1e6308e85aee54b2 57e97155da33a8a4023d1b33bc6f7bdef68a64640d04f45ef3db9dec721311d8 "" "" "qtbase qtdeclarative qtxmlpatterns" {"Qt Graphical Effects"} "" "variant overrides: " } qtimageformats { d5b695518bd94df2bb3411b9c2466527014f186a 74f3bce4f9df0f1a94d41877a91405560ce79e4359fc831ee97f0c8248081b08 "" "port:jasper port:libmng port:tiff port:webp" "qtbase" {"Qt Image Formats"} "" "variant overrides: " } qtlocation { 932c886d3d900f5cc064cc79fd967c3e36ef8909 d3b5768cf68945cd00c9df32fb87ca3bf85f5364dc2e441780840e2bd4d15061 "" "" "qtbase qtxmlpatterns qtdeclarative qtquickcontrols qtserialport" {"Qt Location" "Qt Positioning"} "" "variant overrides: " } qtmacextras { 91727829f4f415907cb4e9e4f4cdb2b3889f56ca e3b0567be15965244dbe7677abf1610d338f7e373c62e7f254ca83e5ce86fe90 "" "" "qtbase" {"Qt Mac Extras"} "" "variant overrides: " } qtmultimedia { c80dde261404b0d7797f633e0357d34677b1466f d24b5b5fc9f296cc8446c27f1306a47ce5699b65cf1b821d6a43652cd8100515 "" "" "qtbase qtxmlpatterns qtdeclarative" {"Qt Multimedia" "Qt Multimedia Widgets"} "" "variant overrides: " } qtquick1 { dd1c71468426a5b9fe4f5297a6f2b04c9caddc78 c812a7e59a8b9f0a87693181059933e15fef04bc875b6486cd653be1b9b51f2c "" "" "qtbase qtscript qtxmlpatterns qtdeclarative qttools qtwebkit" {"Qt Declarative"} "unsupported" "variant overrides: " } qtquickcontrols { 04fe72a97db226ee179cbfaee93e6e8f52ea69a8 012aa6c4a697f352a9dc1373d8c1f37e33a6d956b6d14be7d1f9e4637d46a691 "" "" "qtbase qtdeclarative qtxmlpatterns qtgraphicaleffects" {"Qt Quick Controls" "Qt Quick Dialogs" "Qt Quick Layouts" "Qt Quick Extras"} "" "variant overrides: " } qtquickcontrols2 { 4bc99827e8d249f8ffb57f3cd05ef0cb651fa175 bba0ddcf1a66c8dec3faeb9c84119992bb1ead09a674aae475d19c35cc8eeb8f "" "" "qtbase qtxmlpatterns qtdeclarative qtquickcontrols qtgraphicaleffects" {"Qt Labs Controls"} "technology preview module" "variant overrides: " } qtscript { 0a00616ff731512e8960f792c206598590768f11 1cb2ef87aeff3d8d05685279b521c332b752e4559f8e2138fd36d3eb682bf79f "" "" "qtbase" {"Qt Script" "Qt Script Tools"} "deprecated in favor QJS* in Qt QML" "variant overrides: " } qtsensors { b0fff836c9e4ad90829f79a3a6edd34e4904d382 c724cd14efc62d935ca822147bf9771e735995032c7b3b13e2e8156d283d942e "" "" "qtbase qtxmlpatterns qtdeclarative" {"Qt Sensors"} "" "variant overrides: " } qtserialbus { 5edc4ad2daf573d4cbdc87b04165557989291e59 bf453fd114131ff64b7ff9a412ef13f6e158d1b5cbebf8fa6b5938bb671bc8c0 "" "" "qtbase qtserialport" {"Qt Serial Bus"} "technology preview module" "variant overrides: " } qtserialport { ea20c30f1dbb1357d8b30eb6303eb9e5ff5dbc47 0b74a2e85e34163c92b076a9af2bbb2c832516839f060266f0465f881f1be6c2 "" "" "qtbase" {"Qt Serial Port"} "" "variant overrides: " } qtsvg { 9b001db2902268f74cab86136054e1fb4bfcb800 f12e4fd4f169123f7648e45c593b2c5a4556a9b2db3a798467aa9c67c82b8a21 "" "" "qtbase" {"Qt SVG"} "" "variant overrides: " } qttools { 209d58f39a1818a320e45efffb6201d11dff4c4b 77a38895ee2d3fe2d0df4a5e1bbef4d3f8870fe20cd3b2cea27bd2d380c17f71 "" "" "qtbase qtxmlpatterns qtdeclarative" {"Qt Help" "Qt UI Tools" "Qt Designer" } "" "variant overrides: " } qttranslations { 1fecf04943e743091cb0dc4350e93f91751b015b 69d52da2691e4c2be7bd5d5a39bdd948bc9dd1c118d417af09e1e30ac0f41c01 "" "" "qtbase qttools" {"translation files"} "" "variant overrides: ~examples ~tests ~debug noarch" } qtwebchannel { 0d27b8c82727fd1c2fb7948545f355723729c551 f82cb5d1bc7af79453da8327464d800469dc40d92446051b4404047542020807 "" "" "qtbase qtwebsockets qtdeclarative" {"Qt WebChannel"} "" "variant overrides: " } qtwebengine { 8038846361b3ec4a3374fd0f6981f135e5d0f9c4 bdf0ac04b5162502b1c43d0763233c12d5cb73625bec4d90755e73ffa863607b "port:python27 port:py27-ply" "" "qtbase qtdeclarative qtxmlpatterns qtquickcontrols qtwebchannel" {"Qt WebEngine" "Qt WebEngine Widgets"} "very large and relatively new; requires newer version of OS X" "variant overrides: ~universal" } qtwebsockets { 24aabb801f6f651ec3e5df115779639728082d9b 551e3a6b8d945a3b1d707755c3d4d5fd6a86808ced492709aecf444fa228723a "" "" "qtbase qtdeclarative" {"Qt WebSockets"} "" "variant overrides: " } qtwebview { eddc015d18b61e091e43366efe1affc3365b8b12 aa5dfef803ed30d5ff017fbd68acc71da1ae7d227ff0508a6e2dee60284f0661 "" "" "qtbase qtdeclarative qtwebengine" {"Qt WebView"} "new in 5.6.0; requires qtwebengine" "variant overrides: ~universal" } qtwebkit { 0594ec1150f7899d72f57d8ff2f108f3f75faaf9 77583f9dbd3e6ad874386df71b165dc3ce88efdabbc6e5d97a959ee2187d6d69 "port:python27" "port:fontconfig port:icu port:leveldb port:webp port:libxml2 port:libxslt port:zlib port:sqlite3" "qtbase qtxmlpatterns qtdeclarative qtlocation qtmultimedia qtsensors qtwebchannel" {"Qt WebKit" "Qt WebKit Widgets"} "unsupported (use Qt WebEngine)" "variant overrides: " } qtwebkit-examples { 6d2a3aee163e419fbc6ec56a941c4354e8e93b7d 098935b42d6d249027d1a635e4e70edc3d2969dd860f825b36aec06fc72e46c6 "" "" "qtbase qtwebkit qtscript qtsvg qtxmlpatterns qtdeclarative qttools" {"examples for Qt WebKit"} "unsupported (use Qt WebEngine); doen't provide functionality" "variant overrides: ++examples" } qtxmlpatterns { fe41b133743a852c75f001d4b9e08f4bdfed0d4f 64f46e22aa17f26fe0542069932efdef84ce5d846a5db40ad8e7ad3eb6148160 "" "" "qtbase" {"Qt XML Patterns"} "" "variant overrides: " } } ############################################################################### SQL Plugin Format # # { # variant name # dependency, library # include path # link requirement # obsolete? (empty string is no) # } # ############################################################################### array set sql_plugins { {sqlite SQLite} { { "sqlite3" "port:sqlite3" "${prefix}/include" "-L${prefix}/lib -lsqlite3" "" } } {psql PostgreSQL} { { "postgresql95" "port:postgresql95" "${prefix}/include/postgresql95" "-L${prefix}/lib/postgresql95 -lpq" "" } { "postgresql94" "port:postgresql94" "${prefix}/include/postgresql94" "-L${prefix}/lib/postgresql94 -lpq" "" } { "postgresql84" "port:postgresql84" "${prefix}/include/postgresql84" "-L${prefix}/lib/postgresql84 -lpq" "" } } {mysql MySQL} { { "mariadb55" "port:mariadb" "${prefix}/include/mariadb/mysql" "-L${prefix}/lib/mariadb/mysql -lmysqlclient_r" "" } { "mysql56" "port:mysql56" "${prefix}/include/mysql56/mysql" "-L${prefix}/lib/mysql56/mysql -lmysqlclient_r" "" } } } foreach {module module_info} [array get modules] { subport ${name}-${module} { # sepcial case if { ${module} eq "qtenginio" } { distname ${module}-opensource-src-1.6.0 } else { distname ${module}-opensource-src-${version} } # see https://bugreports.qt.io/browse/QTBUG-35514 build.target checksums \ rmd160 [lindex ${module_info} 0] \ sha256 [lindex ${module_info} 1] foreach deps [lindex ${module_info} 2] { depends_build-append [subst ${deps}] } foreach deps [lindex ${module_info} 3] { depends_lib-append [subst ${deps}] } foreach qtdeps [lindex ${module_info} 4] { depends_lib-append port:${name}-${qtdeps} } description Tools and Module(s) for Qt Tool Kit ${qt_major} set modules_provided_list [lindex ${module_info} 5] if { [llength ${modules_provided_list}] == 1 } { set modules_provided_join [lindex ${modules_provided_list} 0] } elseif { [llength ${modules_provided_list}] == 2 } { set modules_provided_join [join ${modules_provided_list} " and "] } else { set modules_provided_join [join [list [join [lrange ${modules_provided_list} 0 end-1] ", "] [lindex ${modules_provided_list} end]] ", and "] } long_description "Tools and Module(s) for Qt Tool Kit ${qt_major}: ${modules_provided_join}" } } subport ${name}-docs { distname qt-everywhere-opensource-src-${version} checksums \ rmd160 ee7a838aba61a34e7aa5fdce608d8e1809cf0a21 \ sha256 0d3cc75d2368ad988c9ec6bcbed6362dbaa8e03fdfd04e679284f4b9af91e565 description Documentation for Qt Tool Kit ${qt_major} long_description Documentation for Qt Tool Kit ${qt_major} supported_archs noarch universal_variant no build.target docs destroot.target install_docs # if part of qtwebengine gets built, at least build correctly # UsingTheRightCompiler (https://trac.macports.org/wiki/UsingTheRightCompiler) build.env-append CXX=${configure.cxx} build.env-append CC=${configure.cc} } # see http://doc.qt.io/qt-5/sql-driver.html for info on building SQL Database Drivers foreach {sql_names sql_info} [array get sql_plugins] { set driver [lindex ${sql_names} 0] set dbms [lindex ${sql_names} 1] subport ${name}-${driver}-plugin { distname qtbase-opensource-src-${version} checksums \ rmd160 [lindex $modules(qtbase) 0] \ sha256 [lindex $modules(qtbase) 1] description ${dbms} Database Driver for Qt Tool Kit ${qt_major} long_description ${dbms} Database Driver for Qt Tool Kit ${qt_major} # if there is more than one version of the database system, create variants for each version if { [llength ${sql_info}] > 1 } { set any_variant_set false foreach variant_info ${sql_info} { set varName [lindex ${variant_info} 0] # find every other variant so it can be marked as conflicting set conflicts_list "" foreach variant_info2 ${sql_info} { set varName2 [lindex ${variant_info2} 0] if { ${varName} ne ${varName2} } { lappend conflicts_list ${varName2} } } # get only the numbers from the name regexp {[0-9].} ${varName} varVer variant ${varName} conflicts ${conflicts_list} description "use version ${varVer} of ${dbms}" {} # check if any variant has been set if { [variant_isset ${varName}] } { set any_variant_set true } } # ensure at least one variant is set if { !${any_variant_set} } { default_variants-append +[lindex [lindex ${sql_info} 0] 0] } } foreach variant_info ${sql_info} { set varName [lindex ${variant_info} 0] if { ( [variant_exists ${varName}] && [variant_isset ${varName}] ) || [llength ${sql_info}]==1 } { depends_lib-append [lindex ${variant_info} 1] configure.args-append \ [subst INCLUDEPATH+=\"[lindex ${variant_info} 2]\"] \ [subst LIBS+=\"[lindex ${variant_info} 3]\"] } } # for single architecture, easier to use # worksrcdir ${worksrcdir}/qtbase/src/plugins/sqldrivers/${driver}, # but doesn't work for universal build configure.dir ${worksrcpath}/src/plugins/sqldrivers/${driver} build.dir ${configure.dir} destroot.dir ${configure.dir} # see #52200 # see https://codereview.qt-project.org/#/c/164673/ patchfiles-append patch-xcrun.diff } } if { ${subport} eq ${name} } { # the main port is Meta-port to install various modules description Qt Tool Kit ${qt_major} long_description Qt Tool Kit: A cross-platform framework \ (headers, data, and libraries) for writing \ cross-platform GUI-based applications. master_sites distfiles installs_libs no use_configure no build {} # create a dummy file so the port can be successfully activated destroot { xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${subport} set docfile [open ${destroot}${prefix}/share/doc/${subport}/README.txt "w"] puts ${docfile} "Meta-port for ${name}" puts ${docfile} "${long_description}" close ${docfile} } foreach {module module_info} [array get modules] { if { [lindex ${module_info} 6] eq "" } { depends_lib-append port:${name}-${module} } } depends_lib-append port:${name}-sqlite-plugin supported_archs noarch universal_variant no } elseif { ${subport} ne "${name}-qtbase" && ${subport} ne "${name}-docs" } { # these subports use qmake # detremint which variants are to be turned off set request_examples true set request_tests true set def_var "" set current_module [string range ${subport} [string length "${name}-"] end] # is subport a module or an SQL plugin? if { [info exists modules(${current_module})] } { # subport is a module set module_info $modules(${current_module}) if { [lsearch -exact [lindex ${module_info} 7] "~universal"] != -1 } { universal_variant no } if { [lsearch -exact [lindex ${module_info} 7] "noarch"] != -1 } { supported_archs noarch universal_variant no } if { [lsearch -exact [lindex ${module_info} 7] "~debug"] != -1 } { set qt5_qmake_request_no_debug true } if { [lsearch -exact [lindex ${module_info} 7] "~examples"] != -1 } { set request_examples false } if { [lsearch -exact [lindex ${module_info} 7] "~tests"] != -1 } { set request_tests false } if { [lsearch -exact [lindex ${module_info} 7] "++examples"] != -1 } { set request_examples true lappend def_var "+examples" } } else { # subport is an SQL plugin } if { ${request_examples} } { variant examples description {Build examples} {} } if { ${request_tests} } { variant tests description {Enable tests} {} } if { ${def_var} ne "" } { default_variants-append ${def_var} } PortGroup qmake5 1.0 # special case if { ${subport} eq "${name}-qtlocation" } { # qtlocation uses # Gypsy (https://gypsy.freedesktop.org/wiki/) # if they can be found # Ensure that test fails even if software is installed post-patch { foreach test { gypsy } { reinplace "s|return 0;|return 0;\\\n#error turn off test|g" ${worksrcpath}/config.tests/${test}/main.cpp } } } # special case if { ${subport} eq "${name}-qtwebkit" } { # use MacPorts icu # # qmake uses pkgconfig to look for icu # this feature does not work without "CONFIG += link_pkgconfig" patchfiles-append patch-icu.diff #https://codereview.qt-project.org/#/c/139967/ #https://codereview.qt-project.org/#/c/139968/ #https://codereview.qt-project.org/#/c/139970/ patchfiles-append patch-ssl.diff # Prevent: # In file included from llint/LLIntOffsetsExtractor.cpp:26: # In file included from ./config.h:30: # In file included from ../WTF/wtf/Platform.h:1087: # /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qglobal.h:54:10: fatal error: 'QtCore/qconfig.h' file not found # #include # ^ # 1 error generated. configure.args-append QMAKE_CXXFLAGS+=-F${qt_libs_dir} # Prevent conflicting definitions of Objective-C classes in C++ code # from ${qt_libs_dir}/QtCore.framework/Headers/qglobal.h patchfiles-append patch-objc.diff # qtwebkit uses # glx # libXcomposite # libXrender # if they can be found # Ensure that test fails even if software is installed post-patch { foreach test { glx libXcomposite libXrender } { reinplace "s|return 0;|return 0;\\\n#error turn off test|g" ${worksrcpath}/Tools/qmake/config.tests/${test}/${test}.cpp } } } # special case if { ${subport} eq "${name}-qttools" } { # prevent qttools from opportunistically using qtwebkit if it can be found patchfiles-append patch-no_qtwebkit.diff variant qtwebkit description {build with QtWebkit support} { patchfiles-delete patch-no_qtwebkit.diff depends_lib-append port:${name}-qtwebkit } } # special case if { ${subport} eq "${name}-qtwebengine" } { # see https://wiki.qt.io/QtWebEngine PortGroup xcodeversion 1.0 minimum_xcodeversions {13 5.1} # see http://lists.qt-project.org/pipermail/interest/2016-February/thread.html#20946 # see http://googleappsupdates.blogspot.co.uk/2014/09/google-chrome-64-bit-for-mac-and-windows.html supported_archs x86_64 # UsingTheRightCompiler (https://trac.macports.org/wiki/UsingTheRightCompiler) build.env-append CXX=${configure.cxx} build.env-append CC=${configure.cc} configure.args-append QMAKE_LINK=${configure.cxx} } # special case if { ${subport} eq "${name}-qtwebengine" || ${subport} eq "${name}-qtdeclarative" || ${subport} eq "${name}-qtwebkit" } { # version 5.5.1 (at least) of qtwebengine must find a python version in the interval [2.7, 3) # (see tools/qmake/mkspecs/features/functions.prf) # # a better solution would be to force qtwebengine to use a specific python program # how to accomplish such a thing is not entirely clear # # see #49838 # # versions 5.5.1 of qtdeclarative and qtwebkit also use python with no way of specifying which one # set python_framework ${frameworks_dir}/Python.framework/Versions/2.7 configure.env-append PATH=${python_framework}/bin:$env(PATH) build.env-append PATH=${python_framework}/bin:$env(PATH) } # special case if { ${subport} eq "${name}-qtwebkit-examples" } { # as of 5.6.1, avoid "... is lacking an install target" # see https://codereview.qt-project.org/#/c/156610/1 patchfiles-append patch-qtwebkit_examples.diff if { ![variant_isset examples] } { # create a dummy file so the port can be successfully activated post-destroot { xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${subport} set docfile [open ${destroot}${prefix}/share/doc/${subport}/README.txt "w"] puts ${docfile} "Without the examples variant, no examples are installed" puts ${docfile} "${long_description}" close ${docfile} } } } # special case if { ${subport} eq "${name}-qtsensors" && [variant_isset examples] } { if { [variant_isset debug] } { set debug "_debug" } else { set debug "" } # fix library path names or MacPorts will try to reinstall post-destroot { foreach dylib "grue/Grue/libdeclarative_grue${debug}.dylib grue/libgruesensor.1.dylib grue/sensors/libqtsensors_grue${debug}.dylib sensor_explorer/Explorer/libdeclarative_explorer${debug}.dylib" { system "/usr/bin/install_name_tool -id ${qt_examples_dir}/sensors/${dylib} ${destroot}${qt_examples_dir}/sensors/${dylib}" } foreach dylib "grue/Grue/libdeclarative_grue${debug}.dylib grue/sensors/libqtsensors_grue${debug}.dylib" { system "/usr/bin/install_name_tool -change libgruesensor.1.dylib ${qt_examples_dir}/sensors/grue/libgruesensor.1.dylib ${destroot}${qt_examples_dir}/sensors/${dylib}" } } } # special case if { ${subport} eq "${name}-qtwebkit" } { PortGroup cxx11 1.0 # in ${worksrcdir}/Source/JavaScriptCore/API/JSBase.h, JSC_OBJC_API_ENABLED is set to FALSE for __MAC_OS_X_VERSION_MIN_REQUIRED < 1090 # the default for Qt is to set -mmacosx-version-min=10.7, so JSC_OBJC_API_ENABLED is expected to be FALSE # if QMAKE_MACOSX_DEPLOYMENT_TARGET is changed, then JSC_OBJC_API_ENABLED is TRUE and # ${worksrcdir}/Source/JavaScriptCore/API/ObjCCallbackFunction.h attempts to find JavaScriptCore/JSCallbackFunction.h, which it can not configure.args-delete QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target} # -mmacosx-version-min=10.7 sets the stdlib to libstdc++ unless -stdlib=libc++ is set # QMAKE_CXXFLAGS+=-stdlib=${configure.cxx_stdlib} is insufficient since order of switches matters configure.args-delete \ QMAKE_CXXFLAGS_CXX11-=-stdlib=libc++ \ QMAKE_LFLAGS_CXX11-=-stdlib=libc++ } # special case if { ${subport} eq "${name}-qtenginio" } { # as of 5.6.1, avoid "... is lacking an install target" # see https://codereview.qt-project.org/#/c/156610/1 patchfiles-append patch-qtenginio_examples.diff } # special case if { ${subport} eq "${name}-qtquick1" } { # as of 5.6.1, avoid "... installs target to unexpected location" # as of 5.6.1, avoid "... is lacking an install target" # see https://codereview.qt-project.org/#/c/156610/1 patchfiles-append patch-qtquick1_examples.diff } # special case if { ${subport} eq "${name}-qtserialbus" } { PortGroup cxx11 1.0 } # special case if { ${subport} eq "${name}-qtconnectivity" } { # https://codereview.qt-project.org/#/c/172619/ patchfiles-append patch-qtconn-for-10.12.diff } # accommodating variant request varies depending on how qtbase was built pre-configure { # determine if qmake builds examples by default (set via variants) if {[active_variants ${name}-qtbase examples ""]} { set base_examples true } else { set base_examples false } # determine if qmake runs tests by default (set via varians) if {[active_variants ${name}-qtbase tests ""]} { set base_tests true } else { set base_tests false } # determine if the user wants to build examples if { [variant_exists examples] && [variant_isset examples] } { set this_examples true } else { set this_examples false } # determine if the user wants to run tests if { [variant_exists tests] && [variant_isset tests] } { set this_tests true } else { set this_tests false } # determine of qmake's default and user requests are compatible; override qmake if necessary if { ${this_examples} && !${base_examples} } { configure.args-append "QT_BUILD_PARTS+=\"examples\"" } if { !${this_examples} && ${base_examples} } { configure.args-append "QT_BUILD_PARTS-=\"examples\"" } if { ${this_tests} && !${base_tests} } { configure.args-append "QT_BUILD_PARTS+=\"tests\"" } if { !${this_tests} && ${base_tests} } { configure.args-append "QT_BUILD_PARTS-=\"tests\"" } } } else { # these subports do NOT use qmake (they use configure script) # use the qt5 group; set 'building_qt5' so that the portgroup # does not include certain parts set building_qt5 1 PortGroup qt5 1.0 # In Qt 4.7, c++-11 support will be required #PortGroup cxx11 1.0 if { ${os.platform} ne "darwin" } { pre-fetch { ui_warn "${subport} is untested on \"${os.platform}\"." } } elseif { ${os.major} < ${qt5_min_tested_version} } { pre-fetch { ui_error "OS X prior to 10.8 (Mountain Lion) is not a Reference Configuration for Qt." ui_error "OS X prior to 10.8 (Mountain Lion) is not even tested." ui_error "See http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations" return -code error "unsupported OS" } } elseif { ${os.major} > ${qt5_max_reference_version} } { pre-fetch { ui_warn "OS X subsequent to 10.10 (Yosemite) is not a Reference Configuration for Qt." ui_warn "See http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations" } } else { # ${qt5_min_tested_version} <= ${os.major} <= ${qt5_max_reference_version} } if { [variant_isset universal] } { pre-fetch { ui_warn "Multiple architectures is not a Reference Configuration for Qt." ui_warn "See http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations" } } else { if { ${configure.build_arch} eq "i386" } { pre-fetch { ui_warn "32-bit mode is not a Reference Configuration for Qt." ui_warn "See http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations" } } } conflicts qt3 qt3-mac # special case if { ${subport} eq "${name}-qtbase" } { # https://codereview.qt-project.org/#/c/141654/ patchfiles-append patch-add_sdk.diff # see http://lists.qt-project.org/pipermail/interest/2015-January/thread.html#14954 # see http://comments.gmane.org/gmane.comp.lib.qt.user/21422 patchfiles-append patch-fontconfig.diff # the build system automatically uses OpenGL frameworks (-framework OpenGL -framework AGL) # the build system also uses pkgconfig to look for an OpenGL installation (gl.pc) # if mesa is installed, the build system will try to use both OpenGL systems # later, this will cause problems # Undefined symbols: "_CGLGetCurrentContext" patchfiles-append patch-configure.diff # undo part of https://codereview.qt-project.org/#/c/140954/ # .pc files still needed by some port # see https://github.com/Homebrew/homebrew-core/blob/master/Formula/qt5.rb patchfiles-append patch-pc_files.diff # as of 5.6.1, avoid "... is lacking an install target" # see https://codereview.qt-project.org/#/c/156610/1 patchfiles-append patch-install_examples.diff # see #52200 # see https://codereview.qt-project.org/#/c/164673/ patchfiles-append patch-xcrun.diff #----------------------------------------------------------------------------- # qtbase is used for: # 1) building qtbase # 2) building MacPorts projects via qmake # 3) building end-user projects # # 1 & 2 require consistency with the MacPorts environment # 3 requires consistency with the default Qt installation # # 2 can be achieved via environment variables # (e.g. QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}) # # the only way 3 can be achieved is if no changes are made to the build system # # the following is an attempt to achieve 1 without destroying 3 #----------------------------------------------------------------------------- # save default spec files post-extract { copy ${worksrcpath}/mkspecs ${worksrcpath}/mkspecs-save } # change default compiler flags for the purpose of building qtbase patchfiles-append patch-mkspecs.diff post-patch { global qt_save_cxx_stdlib reinplace \ "s|__MACPORTS__CXX_STDLIB__|${qt_save_cxx_stdlib}|g" \ ${worksrcpath}/mkspecs/common/clang-mac.conf foreach spec {macx-clang macx-clang-32} { reinplace \ "s|__MACPORTS_DEPLOYMENT_TARGET__|${macosx_deployment_target}|g" \ ${worksrcpath}/mkspecs/${spec}/qmake.conf } } # return modified spec files to the default values post-build { if { [variant_exists universal] && [variant_isset universal] } { foreach arch ${universal_archs_to_use} { move -force ${worksrcpath}-${arch}/mkspecs-save/common/clang-mac.conf ${worksrcpath}-${arch}/mkspecs/common/clang-mac.conf foreach spec {macx-clang macx-clang-32} { move -force ${worksrcpath}-${arch}/mkspecs-save/${spec}/qmake.conf ${worksrcpath}-${arch}/mkspecs/${spec}/qmake.conf } } } else { move -force ${worksrcpath}/mkspecs-save/common/clang-mac.conf ${worksrcpath}/mkspecs/common/clang-mac.conf foreach spec {macx-clang macx-clang-32} { move -force ${worksrcpath}/mkspecs-save/${spec}/qmake.conf ${worksrcpath}/mkspecs/${spec}/qmake.conf } } } #----------------------------------------------------------------------------- } if { [variant_isset tests] } { if { ${configure.build_arch} eq "i386" || [variant_isset universal] } { # see http://stackoverflow.com/questions/14506151/invalid-symbol-redefinition-in-inline-asm-on-llvm # only runs test code on 32-bit systems patchfiles-append patch-tst_benchlibcallgrind.diff # this test might still cause problems, but with 5.4.2->5.5.0, it is no longer run # tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro: # -macx-*: SUBDIRS += machtest # +macx-*: contains(QT_CONFIG, private_tests): SUBDIRS += machtest # # When testing, ensure that a universal object file is not inadvertently created. patchfiles-append patch-machtest.diff } } # --prefix is not recognized. configure.pre_args-delete --prefix=${prefix} # --disable-dependency-tracking is not recognized. configure.universal_args-delete --disable-dependency-tracking # Installation options: #-extprefix SYSROOT/PREFIX #-hostprefix EXTPREFIX #-libexecdir ARCHDATADIR/libexec #-hostbindir HOSTPREFIX/bin #-hostlibdir HOSTPREFIX/lib configure.args-append \ -prefix ${qt_dir} \ -bindir ${qt_bins_dir} \ -headerdir ${qt_includes_dir} \ -libdir ${qt_libs_dir} \ -archdatadir ${qt_archdata_dir} \ -plugindir ${qt_plugins_dir} \ -importdir ${qt_imports_dir} \ -qmldir ${qt_qml_dir} \ -datadir ${qt_data_dir} \ -docdir ${qt_docs_dir} \ -translationdir ${qt_translations_dir} \ -sysconfdir ${qt_sysconf_dir} \ -examplesdir ${qt_examples_dir} \ -testsdir ${qt_tests_dir} \ -hostdatadir ${qt_host_data_dir} # Configure options: configure.args-append \ -release \ -opensource \ -confirm-license \ -shared \ -largefile \ -accessibility foreach driver { db2 ibase mysql oci odbc psql sqlite sqlite2 tds } { configure.args-append -no-sql-${driver} } if { ![variant_isset universal] } { configure.args-append "-platform ${qt_qmake_spec}" } else { set merger_configure_args(i386) "-platform ${qt_qmake_spec_32}" set merger_configure_args(x86_64) "-platform ${qt_qmake_spec_64}" } configure.args-append \ -no-testcocoon \ -no-gcov \ -force-pkg-config # turn off CFG_CLOEXEC if gnulib is installed # Third Party Libraries: configure.args-append \ -system-zlib \ -no-mtdev \ -no-journald \ -no-syslog \ -system-libpng \ -system-libjpeg \ -system-freetype \ -system-harfbuzz \ -openssl-linked \ -no-libproxy \ -system-pcre \ --disable-xcb \ -no-xkbcommon-x11 \ -no-xkbcommon-evdev \ -no-xinput2 \ -no-xcb-xlib \ -glib \ -no-pulseaudio \ -no-alsa \ -no-gtkstyle # from the configure script: # NOTE: -optimized-tools is not useful in -release mode. # Additional options: configure.args-append \ {-make libs} \ {-make tools} \ {-nomake examples} \ {-nomake tests} \ -gui \ -widgets \ -no-rpath \ -verbose \ -nis \ -cups \ -iconv \ -no-evdev \ -no-tslib \ -icu \ -fontconfig \ -strip \ -no-pch \ -no-ltcg \ -dbus-linked \ -no-use-gold-linker \ -no-separate-debug-info \ -no-xcb \ -no-eglfs \ -no-gbm \ -no-directfb \ -no-linuxfb \ -no-kms \ -no-mirclient \ -no-libinput \ -no-gstreamer \ -no-system-proxies # MacOS/iOS options: configure.args-append \ -framework if {${configure.sdkroot} ne ""} { configure.args-append \ -sdk [string tolower [join [lrange [split [lindex [split ${configure.sdkroot} "/"] end] "."] 0 end-1] "."]] } # configure options that don't show up in configure --help configure.args-append \ -no-libudev \ -no-egl \ -no-openvg # Qt builds part of the system using environment provided my MacPorts. # It builds the rest using its own internal environment. # For consistency, clear MacPorts environment. # configure.cxx_stdlib value is needed later in a post-patch set qt_save_cxx_stdlib ${configure.cxx_stdlib} configure.cxx_stdlib configure.sdkroot configure.cc_archflags configure.cxx_archflags configure.objc_archflags configure.objcxx_archflags configure.ld_archflags configure.cppflags configure.cflags configure.cxxflags configure.objcflags configure.objcxxflags configure.ldflags configure.pipe no if { [variant_isset universal] } { set merger_arch_flag no } configure.march configure.mtune configure.universal_ldflags configure.universal_cflags configure.universal_cxxflags configure.universal_cppflags # cofigure script looks for perl but doesn't seem to use it for our configuration # configure script uses gawk if it can find it, # so require it for consistency depends_build-append port:gawk # unless overridden, configure script uses gmake if it can find it configure.env-append MAKE=${build.cmd} } # special case if { ${subport} eq "${name}-qtbase" } { if { [variant_isset universal] } { post-destroot { # delete preprocessor comments surrounding QT_CPU_FEATURES.i386 and QT_CPU_FEATURES.x86_64 reinplace "/^#ifndef.*$/d" ${destroot}${qt_mkspecs_dir}/qmodule.pri reinplace "/^#else.*$/d" ${destroot}${qt_mkspecs_dir}/qmodule.pri reinplace "/^#endif.*$/d" ${destroot}${qt_mkspecs_dir}/qmodule.pri } # The file ${qt_mkspecs_dir}/qconfig.pri is still not properly merged # A workaround is to set QT_ARCH and QT_TARGET_ARCH manually (see e.g. the qmake5 PortGroup) } variant tests description {Enable tests} { configure.args-replace {-nomake tests} {-make tests} } variant examples description {Build examples} { configure.args-replace {-nomake examples} {-make examples} } variant debug description {Build both release and debug libraries} { configure.args-replace -release -debug-and-release } variant pulseaudio description {Compile PulseAudio support} { depends_lib-append port:pulseaudio configure.args-replace -no-pulseaudio -pulseaudio } variant gstreamer description {Compile GStreamer support} { depends_lib-append port:gstreamer1 port:gstreamer1-gst-plugins-base configure.args-replace -no-gstreamer {-gstreamer 1.0} } } # special case if { ${subport} eq "${name}-docs" } { depends_build-append \ port:python27 set python_framework ${frameworks_dir}/Python.framework/Versions/2.7 configure.env-append PATH=${python_framework}/bin:$env(PATH) build.env-append PATH=${python_framework}/bin:$env(PATH) depends_lib-append \ path:${qt_bins_dir}/qdoc:${name}-qtbase \ path:${qt_plugins_dir}/sqldrivers/libqsqlite.dylib:${name}-sqlite-plugin \ path:${qt_bins_dir}/qhelpgenerator:${name}-qttools post-extract { # generated makefiles assume full Qt was built locally xinstall -d -m 0755 ${worksrcpath}/qttools/bin/ ln -s ${qt_bins_dir}/qdoc ${worksrcpath}/qttools/bin/ ln -s ${qt_bins_dir}/qhelpgenerator ${worksrcpath}/qttools/bin/ ln -s ${qt_bins_dir}/rcc ${worksrcpath}/qtbase/bin/ } } if { [variant_exists universal] && [variant_isset universal] } { merger-post-destroot { foreach arch ${universal_archs_to_use} { set dir ${destroot}-${arch} foreach prlfl [glob -nocomplain ${dir}${qt_libs_dir}/*.framework/*.prl] { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${prlfl} } foreach prlfl [glob -nocomplain ${dir}${qt_libs_dir}/*.prl] { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${prlfl} } foreach prlfl [glob -nocomplain ${dir}${qt_examples_dir}/widgets/tools/plugandpaint/plugins/*.prl] { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${prlfl} } if { [file exists ${dir}${qt_libs_dir}/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake] } { reinplace "s|macx-clang-32|macx-clang|g" ${dir}${qt_libs_dir}/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake } # Libs.private contains the value of ${worksrcpath}-${arch}, which prevents merging if { [file exists ${dir}${qt_libs_dir}/pkgconfig/Qt5WebKit.pc] } { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_libs_dir}/pkgconfig/Qt5WebKit.pc } if { [file exists ${dir}${qt_libs_dir}/pkgconfig/Qt5WebEngineCore.pc] } { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_libs_dir}/pkgconfig/Qt5WebEngineCore.pc } if { [file exists ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile] } { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile reinplace -E "/\\w*-arch \\\\/d" ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile reinplace -E "/\\w*${arch} \\\\/d" ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile reinplace -E {s:-arch +[^ ]+::g} ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile reinplace "s|macx-clang-32|macx-clang|g" ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile } if { [file exists ${dir}${qt_examples_dir}/multimedia/spectrum/fftreal.framework/fftreal.prl] } { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_examples_dir}/multimedia/spectrum/fftreal.framework/fftreal.prl } if { [file exists ${dir}${qt_examples_dir}/multimedia/spectrum/spectrum.app/Contents/Frameworks/fftreal.framework/fftreal.prl] } { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_examples_dir}/multimedia/spectrum/spectrum.app/Contents/Frameworks/fftreal.framework/fftreal.prl } if { [file exists ${dir}${qt_examples_dir}/sensors/grue/libgruesensor.prl ] } { reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_examples_dir}/sensors/grue/libgruesensor.prl } } } } # see #44934 (and #35067 for the qt4-mac version) if { ${subport} eq "${name}-qttools" } { set framework_list [split ${qt_frameworks_dir} '/'] set qt_list [split ${qt_dir} '/'] while {[llength ${qt_list}] && [llength ${framework_list}]} { set var_qt [lindex $qt_list 0] set var_framework [lindex $framework_list 0] if { ${var_qt} ne ${var_framework} } { break } # remove first element from list set qt_list [lreplace ${qt_list} 0 0] set framework_list [lreplace ${framework_list} 0 0] } set libreplace [string repeat ../ [llength ${qt_list}]][join ${framework_list} /] if { ${libreplace} ne "lib" } { patchfiles-append patch-shared.diff post-patch { reinplace "s|__MACPORTS_FRAMWORK_DIR__|${libreplace}|g" ${worksrcpath}/src/macdeployqt/shared/shared.cpp } } } if { ${subport} ne ${name} } { post-destroot { # see #44204 foreach f [glob -nocomplain -tails -directory ${destroot}${qt_libs_dir} *.framework] { set framework [file rootname ${f}] set include_list [split ${qt_includes_dir} '/'] set framework_list [split ${qt_libs_dir} '/'] while {[llength ${include_list}] && [llength ${framework_list}]} { set var_include [lindex $include_list 0] set var_framework [lindex $framework_list 0] if { ${var_include} ne ${var_framework} } { break } # remove first element from list set include_list [lreplace ${include_list} 0 0] set framework_list [lreplace ${framework_list} 0 0] } xinstall -d -m 0755 ${destroot}${qt_includes_dir} ln -s [string repeat ../ [llength ${include_list}]][join ${framework_list} /]/${f}/Headers ${destroot}${qt_includes_dir}/${framework} } # .app and non-.app programs are both put in qt_bins_dir # put a link of any .app programs in the ${qt_apps_dir} if { ${qt_bins_dir} ne ${qt_apps_dir} } { xinstall -d -m 0755 ${destroot}${qt_apps_dir} foreach app [glob -nocomplain -tails -directory ${destroot}${qt_bins_dir} *.app] { ln -s ${qt_bins_dir}/${app} ${destroot}${qt_apps_dir} } } # put configuration files in places they will be found automatically if { ${qt_libs_dir} ne "${prefix}/lib" } { # put link to pkgconfig files in place where pkgconfig will find it # most Qt 5 pkgconfig files begin with Qt5, so link should not conflict with any other Qt installations # exceptions: Enginio (new in Qt 5.3) xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig foreach pcfile [glob -nocomplain -tails -directory ${destroot}${qt_libs_dir}/pkgconfig *.pc] { ln -s ${qt_libs_dir}/pkgconfig/${pcfile} ${destroot}${prefix}/lib/pkgconfig } # put link to cmake files in place where cmake will find it # most Qt 5 cmake directories begin with Qt5, so link should not conflict with any other Qt installations # exceptions: Enginio (new in Qt 5.3) xinstall -d -m 0755 ${destroot}${prefix}/lib/cmake foreach cmakedir [glob -type d -nocomplain -tails -directory ${destroot}${qt_libs_dir}/cmake *] { xinstall -d -m 0755 ${destroot}${prefix}/lib/cmake/${cmakedir} foreach cmakefile [glob -tails -directory ${destroot}${qt_libs_dir}/cmake/${cmakedir} *.cmake] { ln -s ${qt_libs_dir}/cmake/${cmakedir}/${cmakefile} ${destroot}${prefix}/lib/cmake/${cmakedir}/ } } # if cmake finds configuration files in ${prefix}/lib/cmake, CMAKE_CURRENT_LIST_DIR expands to ${prefix}/lib/cmake/xxx # cmake configuration files actually installed in ${qt_cmake_module_dir}/xxx foreach cmakedir [glob -type d -nocomplain -tails -directory ${destroot}${qt_libs_dir}/cmake *] { foreach cmakefile [glob -nocomplain -directory ${destroot}${qt_libs_dir}/cmake/${cmakedir} *.cmake] { reinplace "s|\\\${CMAKE_CURRENT_LIST_DIR}|${qt_cmake_module_dir}/${cmakedir}|g" ${cmakefile} } } } } } livecheck.type regex livecheck.url http://download.qt.io/archive/qt/${branch}/ livecheck.regex (\\d+(\\.\\d+)+)