# -*- 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 PortSystem 1.0 PortGroup active_variants 1.1 PortGroup qt6_info 1.0 PortGroup compiler_blacklist_versions 1.0 name qt6 categories aqua platforms {macosx >= 20} ; # upon change, please update qt6 PG maintainers {mcalhoun @MarcusCalhoun-Lopez} \ {reneeotten @reneeotten} openmaintainer # for OpenSSLException, see source and header files in src/network/ssl of qtbase # see also https://doc.qt.io/qt-6.8/qtnetwork-index.html#licenses-and-attributions license {LGPL-3 GPL-3 OpenSSLException} homepage https://www.qt.io version 6.8.0 # get Qt's version numbers set branch [join [lrange [split ${version} .] 0 1] .] set qt_major [lindex [split ${version} .] 0] # see https://www.qt.io/blog/qt-6.8-released compiler.c_standard 2011 compiler.cxx_standard 2017 # qcompilerdetection.h emits: # error: "Unsupported Apple Clang version" # which also means Q_CC_CLANG will not be set. # That causes the check for __has_feature(cxx_unicode_literals) to be skipped, causing # error: "Qt6 requires Unicode string support in both the compiler and the standard library" # to be emitted, even when the unsupported Apple Clang version does support Unicode string literals. compiler.blacklist-append {clang < 1100} master_sites https://download.qt.io/official_releases/qt/${branch}/${version}/submodules # file sizes are significantly smaller using xz use_xz yes supported_archs arm64 x86_64 # conflict with all other versions of qt6 foreach {qt_base qt_info} ${qt6::available_versions} { if { ${qt_base} ne ${name} } { conflicts-append ${qt_base}-qtbase } } # qt6-qtbase is broken on macOS 15+, so fix needs to be done at the top level as all subports depends on it. # because of `error: 'CGDisplayCreateImageForRect' is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit instead.` # May be fixed upsteam eventually in https://bugreports.qt.io/browse/QTBUG-128900 platform darwin 24 { macosx_deployment_target 14.0 } # MacPorts LLVM/Clang version to use when required set llvm_version 18 # MacPorts Python branch & version to use when required set python_branch 3.12 set python_version [join [split ${python_branch} .] ""] ############################################################################### Modules Not Considered # # No qtactiveqt (Windows Only) # No qtwayland (Linux Only) # ############################################################################### ############################################################################### Qt Dependencies # # https://code.qt.io/cgit/qt/qt5.git/tree/.gitmodules?h=6.8.0 # ############################################################################### ############################################################################### Module Format # # "Qt Module Name" { # { # checksum, rmd160 # checksum, sha256 # checksum, size # } # 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 # revision number # license replacement # } # # module info found at https://doc.qt.io/qt-6.8/qtmodules.html # ############################################################################### array set modules { qtbase { { 714e04b8bc18fe8696257540181c13e914884c09 \ 1bad481710aa27f872de6c9f72651f89a6107f0077003d0ebfcc9fd15cba3c75 \ 49819628 } "" "port:brotli path:bin/dbus-daemon:dbus port:double-conversion port:freetype path:lib/pkgconfig/glib-2.0.pc:glib2 path:lib/pkgconfig/harfbuzz.pc:harfbuzz path:lib/pkgconfig/icu-uc.pc:icu path:include/turbojpeg.h:libjpeg-turbo port:libb2 port:libpng port:md4c path:lib/pkgconfig/libpcre2-posix.pc:pcre2 port:zlib path:lib/pkgconfig/libzstd.pc:zstd" "" {"Qt Core" "Qt GUI" "Qt Network" "Qt SQL" "Qt Test" "Qt Widgets" "Qt Concurrent" "Qt D-Bus" \ "Qt OpenGL" "Qt Platform Headers" "Qt Print Support" "Qt XML"} "" "variant overrides: " "revision 0" "License: " } qtsvg { { 716056ea1f18fc2506ce838f16906438c5eac7e5 \ cf7a593d5e520f8177240610d9e55d5b75b0887fe5f385554ff64377f1646199 \ 2004952 } "" "port:zlib" "qtbase" {"Qt SVG"} "" "variant overrides: " "revision 0" "License: " } qtdeclarative { { 368a610969ac21e23fdae86ecbaf2ad9bd1b6ac5 \ 3b41a36b42e919a3aa0da1f71107591504200f41707bee2ad8e8d4f99b5644c2 \ 37029068 } "" "" "qtbase qtimageformats qtshadertools qtsvg qtlanguageserver" {"Qt QML" "Qt Quick" "Qt Quick Layouts" "Qt Quick Widgets"} "" "variant overrides: " "revision 0" "License: " } qtmultimedia { { b2e0ffe396ee8e1e975fc99b877e1832c9226d34 \ 28766aa562fa7aa7dfa8420defd6ece90a891a0496b8d8a4c51958182d73cfcd \ 9591692 } "" "port:ffmpeg7 port:pulseaudio" "qtbase qtshadertools qtdeclarative qtquick3d" {"Qt Multimedia"} "" "variant overrides: " "revision 0" "License: " } qttools { { f2c4f3047f92e839853383ee38715febfd39519f \ 403115d8268503c6cc6e43310c8ae28eb9e605072a5d04e4a2de8b6af39981f7 \ 9059032 } "" "port:clang-${llvm_version}" "qtbase qtdeclarative" {"Qt Designer" "Qt Help" "Qt UI Tools"} "" "variant overrides: " "revision 0" "License: " } qttranslations { { 4d6478540ca6cc3529fe1fc84f2eeecc16e72d54 \ 84bf2b67c243cd0c50a08acd7bfa9df2b1965028511815c1b6b65a0687437cb6 \ 1550184 } "port:qt6-qttools" "" "" {"translation files"} "" "variant overrides: ~examples ~tests ~debug noarch ~docs" "revision 0" "License: " } qtdoc { { f217d4df5620c6ad70e321780553c72576b02ef8 \ 3dc83a74665453b24ea2ad466d83aab3c779a0b9a01cd8bb24a12e764e9c1257 \ 45988788 } "" "" "qtdeclarative qttools qtmultimedia" {"documentation and examples"} "" "variant overrides: " "revision 0" "License: " } qtlocation { { 7e3e7f7b5915b4fcf3fa1e4d96752fa25a2835f8 \ a0c487f4b36965ea921127033cc227acf1f292ba577081842c5b75d2ef9731a0 \ 3166076 } "" "" "qtbase qtpositioning qtdeclarative" {"Qt Location"} "status = preview" "variant overrides: " "revision 0" "License: " } qtpositioning { { 793127c33b0f94c72d5254aa6a5d825213ecb2e9 \ ec81463e2b01475911131b11c96d312ffd7aa90d4482bbd6a9965b189e7eeb39 \ 660512 } "" "port:gconf" "qtbase qtdeclarative qtserialport" {"Qt Positioning"} "" "variant overrides: ~examples ~tests" "revision 0" "License: " } qtsensors { { 7cf8ecfec6d7c0e0a007d306cfbb230521cd2c34 \ 723544c5fa05fab75d53d66186a7ce83fb2f6f9a770ce796306992e983dde679 \ 1497268 } "" "" "qtbase qtdeclarative" {"Qt Sensors"} "" "variant overrides: " "revision 0" "License: " } qtconnectivity { { b1c54c84dbe503fd6c63a9e62fac255343448fb6 \ bbbefb6cc07507fcc961362b3380553eba6400aa15480600126793ba3dc21788 \ 1066392 } "" "" "qtbase qtdeclarative" {"Qt Bluetooth" "Qt NFC"} "" "variant overrides: " "revision 0" "License: " } qt3d { { 5bac3bbf78096861757bd33bb6e5d4809861bccf \ 3a11919e15437c351b742dbf4e0115ce51aa969cba844dd6388aae14810c7b7d \ 141837252 } "" "port:assimp" "qtbase qtdeclarative qtshadertools" {"Qt 3D"} "status = deprecated" "variant overrides: " "revision 0" "License: " } qtimageformats { { 2a840a485beeaf5ab2f2d520c755846938bd9ca9 \ 595bf8557b91e1f8ebc726f1e09868a3c7e610ff5045068f2d4ea2428c49a5d4 \ 2024480 } "" "path:lib/pkgconfig/jasper.pc:jasper port:libmng port:tiff port:webp" "qtbase" {"Qt Image Formats"} "" "variant overrides: " "revision 0" "License: " } qtserialbus { { c5824f724c2431d9930fb60deecf6550b0a4c922 \ e69834904832c1970aefcc98c67f3b4033640129908118f368e536393bf0dafa \ 547876 } "" "" "qtbase qtserialport" {"Qt Serial Bus"} "" "variant overrides: " "revision 0" "License: " } qtserialport { { 1baa6dcbd726cddf0ab5d0742c5b2aca0f25223c \ 7767d72ecfadb1045c50d0b30b952327c242a6eb40a46780e8e01b75ad77e7c3 \ 271308 } "" "" "qtbase" {"Qt Serial Port"} "" "variant overrides: " "revision 0" "License: " } qtwebsockets { { 0595c953ac383fde2854d4e216b2734d050a3535 \ c14be05c46b71c2a89865987ffe0a8d40d8ecb01d48dcdca7fc02ba83a5eaf6f \ 459880 } "" "" "qtbase qtdeclarative" {"Qt WebSockets"} "" "variant overrides: " "revision 0" "License: " } qtwebchannel { { 2fbbaa34a615c9ef8e18eb102d3ed816f58f4e14 \ d6250d25bf8a8d2af608239d259ec72db6dc28f08aefc8895492ad09ebaf60c0 \ 207360 } "" "" "qtbase qtdeclarative qtwebsockets" {"Qt WebChannel"} "" "variant overrides: " "revision 0" "License: " } qtwebengine { { d91c3548fc1b28b6886a2a05fddc96eaee7904f9 \ 2484459248a8624c16b70780bef3fe4bc7f4eace2178f84233d4e711cb7f7452 \ 566569136 } "path:bin/node:nodejs20 port:python${python_version} port:py${python_version}-html5lib port:py${python_version}-ply" "port:re2 path:lib/pkgconfig/icu-uc.pc:icu port:webp \ port:libopus path:lib/libavcodec.dylib:ffmpeg path:lib/pkgconfig/vpx.pc:libvpx \ port:snappy path:lib/pkgconfig/glib-2.0.pc:glib2 port:zlib port:minizip port:libevent \ port:libxml2 port:libxslt port:lcms2 port:libpng path:include/turbojpeg.h:libjpeg-turbo \ path:lib/pkgconfig/harfbuzz.pc:harfbuzz port:freetype port:pciutils port:pulseaudio" "qtdeclarative qtwebchannel qttools qtpositioning" {"Qt WebEngine Qt" "Qt PDF"} "" "variant overrides: " "revision 0" "License: " } qtwebview { { f9ebb96ee347d0db63901623f457c460be4a3b3f \ 7cb89d41593876b176368b15c1cded3d5a3c4fdf7e0a10f0c61021e3e8c179f3 \ 138956 } "" "" "qtdeclarative qtwebengine" {"Qt WebView"} "" "variant overrides: " "revision 0" "License: " } qtcharts { { 5d6ee81daeac1155957ae20a02560f3f759fb3f8 \ 1923daac0d1a69b03a4cb119b147c2e3f5080f642af365098fd8771a465b132f \ 4662104 } "" "" "qtbase qtdeclarative qtmultimedia" {"Qt Charts"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtdatavis3d { { 505ac4cc2e6b736bdee262d7159a36348bf6fccf \ 35f2965d13b078d6ca42c76d70a491042f0b0b533b2ec4d12ecc35e282534cff \ 3952536 } "" "" "qtbase qtdeclarative qtmultimedia" {"Qt Data Visualization"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtvirtualkeyboard { { 91e42ff19486a6daac0a4b5946295cb7f6877009 \ 8f6502d7f40765fb4960b804927f9d86da39bdf42acc5021353c49527b6d0ce0 \ 3722484 } "" "port:hunspell" "qtbase qtdeclarative qtsvg qtmultimedia" {"Qt Virtual Keyboard"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtscxml { { a200937b5210b1307092e5aa6330e50f70d22ea0 \ bba9aa4ef441b01b2d391486ddccfb09efa378c8a24e6d13e983fc019837b43b \ 557512 } "" "" "qtbase qtdeclarative" {"Qt SCXML"} "" "variant overrides: " "revision 0" "License: " } qtspeech { { e4cb9381386eeec9b79a4dc52a2d5ac90315d040 \ 75230a12bc37b8535f3858c11247bf68a502e2559265243eb3b44fc917166565 \ 262308 } "" "port:flite" "qtbase qtdeclarative qtmultimedia" {"Qt TextToSpeech"} "" "variant overrides: " "revision 0" "License: " } qtnetworkauth { { 711bd5b60465979625fd4ba5b8cd8b815419e840 \ b95d566544c6b35d895be39473fef51985b04df2f16008de54660966ae80cc48 \ 253404 } "" "" "qtbase" {"Qt Network Authorization"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtremoteobjects { { ce8f6ef4f9fa1e93ad35787976f7e52e7a7c6c6b \ f1df570c6d9796e98374414f0f24f31bdd1e61f8063d6d9e2f407632559c7588 \ 537064 } "" "" "qtbase qtdeclarative" {"Qt Remote Objects"} "" "variant overrides: " "revision 0" "License: " } qtlottie { { 7bcce8b45d8b6daf701088c4ac84d69e4a0737ce \ cb69e6396a6b14b6fba3aa690040bbe45a7717551e0d046e841541dc1f137c96 \ 83688 } "" "" "qtbase qtdeclarative" {"Qt Lottie Animation"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtquicktimeline { { d75777067ceb1c2731175b8ddb6e50e4ef3fec69 \ 1106a41bd8081903058a47a2bca3a147d594d15cc21006aa45f38c6e1dd91f08 \ 110192 } "" "" "qtbase qtdeclarative" {"Qt Quick Timeline"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtquick3d { { ef8ed0492373dd368fb0d8c2fbe953497ffaeeaf \ 3e95044ee2da33db1a6fa3f834b09e71b2491c4899bac3a3bdf0c10b06f0223f \ 75282076 } "" "port:assimp" "qtbase qtdeclarative qtshadertools" {"Qt Quick 3D"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtshadertools { { 2d8c683183cc21b8cf11c3737cbc418fe998c9de \ 44692dc93482374bf3b39e96c881fa08275f0bf82958b68a7e3c796b76d4c4cb \ 1136332 } "" "" "qtbase" {"Qt Shader Tools"} "" "variant overrides: " "revision 0" "License: " } qt5compat { { f3eebb3762b7dcfbb00d7f1c307eac60df32f447 \ 3c9b05fdd70b6bd6ec152e6b43f2a5f4c7b31c9eb342d62fa8450d63f5835e30 \ 14632668 } "" "path:lib/pkgconfig/icu-uc.pc:icu port:libiconv" "qtbase qtdeclarative" {"Qt 5 Core Compatibility APIs"} "status = deprecated" "variant overrides: " "revision 0" "License: " } qtlanguageserver { { 36dd7ee332742ba489bdef0ddd6fd4912f74eeaf \ fbf7152c8ca4d1dbdd30205e64a830f378d7ac5ac0b5f02eecab9d7501065cef \ 146340 } "" "" "qtbase" {"Qt Language Server"} "status = preview" "variant overrides: ~docs" "revision 0" "License: " } qthttpserver { { 05cb06cc21e3b396b1668de4d74597ff8c124927 \ 81c308c8d23a5c9062330882008143cfeff88dc783e2d5c7bfaf22c81aae797f \ 177428 } "" "" "qtbase" {"Qt HTTP Server"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtquick3dphysics { { ba0ec83adb8e19a0e438791fba2541511ea8fa22 \ 13b35c229fe76201d0ae56b389a7c73a1df93098fe2233fc5d5b716848f1951f \ 4704280 } "" "" "qtbase qtdeclarative qtquick3d qtshadertools" {"Qt Quick 3D Physics"} "GPLv3 license only" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } qtquickeffectmaker { { dea6ab3760f6573abadb7779e8a7858b9c5e5354 \ 8aa1d7f3d0b27dd0845284e444dc4a5830a093648749ff3439fba2e6b48c74f4 \ 4348348 } "" "" "qtbase qtdeclarative qtquick3d qtshadertools" {"Qt Quick Effects"} "" "variant overrides: " "revision 0" "" } qtgraphs { { 10c079a1cf6e1fd9379f783e4234d10128472ef0 \ 4ba54a5a06593fe17fdc4eb5bed0caf6b5f9789a8d9835729e12b685960dcb42 \ 4815668 } "" "" "qtbase qtdeclarative qtquick3d" {"Qt Graphs"} "" "variant overrides: " "revision 0" "License: {GPL-3 OpenSSLException}" } } ############################################################################### SQL Plugin Format # # { # module name # { # SQL name # revision string # {list of feature names} # { # variant name # { # variant name # library dependencies # {list of CMake options to find library} # } # } # } # } # ############################################################################### array set sql_plugins { sqlite { SQLite "revision 0" {sql-sqlite system-sqlite} { sqlite3 { "port:sqlite3" { -DSQLite3_INCLUDE_DIR=${prefix}/include -DSQLite3_LIBRARY=${prefix}/lib/libsqlite3.dylib } } } } psql { PostgreSQL "revision 0" {sql-psql} { postgresql15 { "port:postgresql15" { -DPostgreSQL_INCLUDE_DIR=${prefix}/include/postgresql15 -DPostgreSQL_TYPE_INCLUDE_DIR=${prefix}/include/postgresql15 -DCMAKE_LIBRARY_PATH=${prefix}/lib/postgresql15 } } postgresql14 { "port:postgresql14" { -DPostgreSQL_INCLUDE_DIR=${prefix}/include/postgresql14 -DPostgreSQL_TYPE_INCLUDE_DIR=${prefix}/include/postgresql14 -DCMAKE_LIBRARY_PATH=${prefix}/lib/postgresql14 } } postgresql13 { "port:postgresql13" { -DPostgreSQL_INCLUDE_DIR=${prefix}/include/postgresql13 -DPostgreSQL_TYPE_INCLUDE_DIR=${prefix}/include/postgresql13 -DCMAKE_LIBRARY_PATH=${prefix}/lib/postgresql13 } } postgresql12 { "port:postgresql12" { -DPostgreSQL_INCLUDE_DIR=${prefix}/include/postgresql12 -DPostgreSQL_TYPE_INCLUDE_DIR=${prefix}/include/postgresql12 -DCMAKE_LIBRARY_PATH=${prefix}/lib/postgresql12 } } postgresql11 { "port:postgresql11" { -DPostgreSQL_INCLUDE_DIR=${prefix}/include/postgresql11 -DPostgreSQL_TYPE_INCLUDE_DIR=${prefix}/include/postgresql11 -DCMAKE_LIBRARY_PATH=${prefix}/lib/postgresql11 } } } } mysql { MySQL "revision 0" {sql-mysql} { mariadb10_11 { "port:mariadb-10.11" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.11/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.11/mysql/libmariadb.dylib } } mariadb10_10 { "port:mariadb-10.10" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.10/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.10/mysql/libmariadb.dylib } } mariadb10_9 { "port:mariadb-10.9" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.9/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.9/mysql/libmariadb.dylib } } mariadb10_8 { "port:mariadb-10.8" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.8/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.8/mysql/libmariadb.dylib } } mariadb10_7 { "port:mariadb-10.7" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.7/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.7/mysql/libmariadb.dylib } } mariadb10_6 { "port:mariadb-10.6" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.6/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.6/mysql/libmariadb.dylib } } mariadb10_5 { "port:mariadb-10.5" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.5/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.5/mysql/libmariadb.dylib } } mariadb10_4 { "port:mariadb-10.6" { -DMySQL_INCLUDE_DIR=${prefix}/include/mariadb-10.4/mysql -DMySQL_LIBRARY=${prefix}/lib/mariadb-10.4/mysql/libmariadb.dylib } } mysql8 { "port:mysql8" { -DMySQL_INCLUDE_DIR=${prefix}/include/mysql8/mysql -DMySQL_LIBRARY=${prefix}/lib/mysql8/mysql/libmysqlclient.dylib } } } } } foreach {module module_info} [array get modules] { subport ${name}-${module} { distname ${module}-everywhere-src-${version} revision [regexp -inline {[0-9]+} [lindex ${module_info} 7]] checksums rmd160 [lindex [lindex ${module_info} 0] 0] \ sha256 [lindex [lindex ${module_info} 0] 1] \ size [lindex [lindex ${module_info} 0] 2] set license_string [lindex ${module_info} 8] set license_string [string range ${license_string} 1+[string first ":" ${license_string}] end] set license_string [string trim ${license_string}] if { ${license_string} ne "" } { license {*}${license_string} } foreach deps [lindex ${module_info} 1] { depends_build-append [subst ${deps}] } foreach deps [lindex ${module_info} 2] { depends_lib-append [subst ${deps}] } foreach qtdeps [lindex ${module_info} 3] { depends_lib-append port:${name}-${qtdeps} } description Tools and Module(s) for Qt Tool Kit ${qt_major} set modules_provided_list [lindex ${module_info} 4] 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} if { [lsearch -exact [lindex ${module_info} 6] "~universal"] != -1 } { universal_variant no } if { [lsearch -exact [lindex ${module_info} 6] "noarch"] != -1 } { supported_archs noarch platforms any } if { [lsearch -exact [lindex ${module_info} 6] "~debug"] == -1 } { # debugging seems to be turned on if and only if it is turned on in the base # CMAKE_CONFIGURATION_TYPES is set with the FORCE option # see https://code.qt.io/cgit/qt/qtbase.git/tree/cmake/QtPostProcessHelpers.cmake variant debug description {Build both release and debug libraries} { require_active_variants qt6-qtbase debug "" } if {![variant_isset debug]} { require_active_variants qt6-qtbase "" debug } } if { [lsearch -exact [lindex ${module_info} 6] "~examples"] == -1 } { variant examples description {Build examples} {} } if { [lsearch -exact [lindex ${module_info} 6] "~tests"] == -1 } { variant tests description {Enable tests} {} } } } foreach {module module_info} [array get modules] { if { [lsearch -exact [lindex ${module_info} 6] "~docs"] != -1 } { continue } subport ${name}-${module}-docs { distname ${module}-everywhere-src-${version} revision [regexp -inline {[0-9]+} [lindex ${module_info} 7]] checksums rmd160 [lindex [lindex ${module_info} 0] 0] \ sha256 [lindex [lindex ${module_info} 0] 1] \ size [lindex [lindex ${module_info} 0] 2] set license_string [lindex ${module_info} 8] set license_string [string range ${license_string} 1+[string first ":" ${license_string}] end] set license_string [string trim ${license_string}] if { ${license_string} ne "" } { license {*}${license_string} } depends_build-append port:${name}-qttools \ port:${name}-sqlite-plugin # have the same build dependencies foreach deps [lindex ${module_info} 1] { depends_build-append [subst ${deps}] } depends_lib-append port:${name}-${module} description Documentation for Qt Tool Kit ${qt_major} set modules_provided_list [lindex ${module_info} 4] 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 Documentation for Qt Tool Kit ${qt_major}: ${modules_provided_join} supported_archs noarch platforms any } } # see https://doc.qt.io/qt-6/sql-driver.html for info on building SQL Database Drivers foreach {driver driver_info} [array get sql_plugins] { set dbms [lindex ${driver_info} 0] set revision_string [string trim [lindex ${driver_info} 1]] set revision_string [string range ${revision_string} 1+[string last " " ${revision_string}] end] set sql_variants [lindex ${driver_info} 3] subport ${name}-${driver}-plugin { distname qtbase-everywhere-src-${version} revision ${revision_string} checksums rmd160 [lindex [lindex $modules(qtbase) 0] 0] \ sha256 [lindex [lindex $modules(qtbase) 0] 1] \ size [lindex [lindex $modules(qtbase) 0] 2] depends_lib-append port:${name}-qtbase description ${dbms} Database Driver for Qt Tool Kit ${qt_major} long_description ${dbms} Database Driver for Qt Tool Kit ${qt_major} foreach feature {sql-db2 sql-ibase sql-mysql sql-oci sql-odbc sql-psql sql-sqlite system-sqlite} { if { ${feature} in [lindex ${driver_info} 2] } { configure.args-append -feature-${feature} } else { configure.args-append -no-feature-${feature} } } set worksrcpath ${worksrcpath}/src/plugins/sqldrivers set any_sql no foreach {variant_name variant_info} ${sql_variants} { set conflict_list "" foreach {variant_name_other variant_info_other} ${sql_variants} { if { ${variant_name_other} ne ${variant_name} } { lappend conflict_list ${variant_name_other} } } if { [llength ${conflict_list}] > 0 } { variant ${variant_name} conflicts {*}${conflict_list} description "use version [regexp -inline {[0-9].} ${variant_name}] of ${dbms}" {} } if { ([variant_exists ${variant_name}] && [variant_isset ${variant_name}]) || [llength ${conflict_list}]==0 } { set any_sql yes } } if { !${any_sql} } { default_variants-append +[lindex ${sql_variants} 0] if { ![variant_isset [lindex ${sql_variants} 0]] } { known_fail yes pre-extract { ui_error "At least one SQL variant must be selected." return -code error "No SQL variant selected." } } } foreach {variant_name variant_info} ${sql_variants} { if { ([variant_exists ${variant_name}] && [variant_isset ${variant_name}]) || [llength ${conflict_list}]==0 } { depends_lib-append {*}[lindex ${variant_info} 0] configure.post_args-append {*}[subst [lindex ${variant_info} 1]] } } } } ############################################################################### # Special Cases ############################################################################### subport ${name}-qttools { configure.env-append LLVM_INSTALL_DIR=${prefix}/libexec/llvm-${llvm_version} post-destroot { # avoid having to add `-Wl,-rpath ${prefix}/libexec/llvm-${llvm_version}/lib` or something like it foreach bin {lupdate qdoc} { foreach lib {libclang.dylib libclang-cpp.dylib libLLVM.dylib} { system "install_name_tool -change @rpath/${lib} ${prefix}/libexec/llvm-${llvm_version}/lib/${lib} ${destroot}${qt6.dir}/bin/${bin}" } } } } if { ${subport} in [list "${name}-qtwebengine" "${name}-qtwebengine-docs"] } { configure.env-append PYTHON3_PATH=${prefix}/Library/Frameworks/Python.framework/Versions/${python_branch}/bin # in ${worksrcpath}, `${qt6.dir}/bin/qt-configure-module . -help` and `${qt6.dir}/bin/qt-configure-module . -list-features` # it is not clear why, but icu and ffmpeg support must be added manually # native-spellchecker support is off by default # support for proprietary codecs could by added via `-webengine-proprietary-codecs` configure.args-append -webengine-icu \ -webengine-ffmpeg \ -webengine-native-spellchecker # avoid # xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer # directory '/Library/Developer/CommandLineTools' is a command line tools # instance use_xcode yes } subport ${name}-qtwebengine { # manually install icudtl.dat post-destroot { xinstall -m 0644 ${worksrcpath}/src/3rdparty/chromium/third_party/icu/common/icudtl.dat \ ${destroot}${qt6.dir}/lib/QtWebEngineCore.framework/Resources/ } } subport ${name}-qtmultimedia { # GStreamer will be found if gstreamer1 and gstreamer1-gst-plugins-base are installed # however, an error will ensue since the GStreamer support requires "Linux DMA buffer support" # see # https://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/plugins/multimedia/gstreamer/CMakeLists.txt # https://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/multimedia/configure.cmake configure.args-append -no-gstreamer configure.post_args-append -DFFMPEG_DIR=/opt/local/libexec/ffmpeg7 } subport ${name}-qt5compat { patchfiles-append patch-qt5compat-find_libs.diff } subport ${name}-qtspeech { # ALSA is Linux only (https://www.alsa-project.org/wiki/Main_Page) # Speech Dispatcher *might* be made to work on macOS (https://freebsoft.org/speechd) configure.args-append -no-flite-alsa \ -no-speechd } if { ${subport} eq "${name}-qtbase" || ${subport} eq "${name}-qtbase-docs" } { configure.pre_args-replace --prefix=${prefix} \ "-prefix ${qt6.dir}" # configure options: configure.args-append -opensource \ -confirm-license \ -shared \ -accessibility # SQL Options foreach driver {db2 ibase mysql oci odbc psql sqlite} { configure.args-append -no-sql-${driver} } # use -Oz instead of -O2 configure.args-append -optimize-size configure.args-append -pkg-config # Third Party Libraries: configure.args-append -system-zlib \ -no-mtdev \ -no-journald \ -no-syslog \ -system-libpng \ -system-libjpeg \ -system-freetype \ -system-harfbuzz \ -system-pcre \ -no-openssl \ -no-libproxy \ -glib \ -no-gtk # additional options: configure.args-append {-make tools} \ {-nomake examples} \ {-nomake tests} \ -gui \ -widgets \ -cups \ -no-evdev \ -no-tslib \ -icu \ -no-fontconfig \ -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-libinput \ -no-system-proxies \ -no-libudev \ -no-egl # macOS/iOS options: configure.args-append -framework \ -securetransport # do not opportunistically enable Vulkan support # (TODO: is Vulkan support desirable?) # see https://trac.macports.org/ticket/62104 configure.args-append -no-feature-vulkan # attempt to avoid @rpath configure.args-append -no-rpath \ -no-feature-relocatable } subport ${name}-qtbase { # this subport uses configure script PortGroup openssl 1.0 build.cmd ninja build.post_args-append -v destroot.target install 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 openssl description {Use OpenSSL instead of Secure Transport} { configure.args-delete -securetransport \ -no-openssl configure.args-append -openssl-linked # configure has issues locating openssl files configure.pre_args-append -DOPENSSL_ROOT_DIR=[openssl::install_area] \ -DOPENSSL_INCLUDE_DIR=[openssl::include_dir] \ -DOPENSSL_LIBRARIES=[openssl::install_area]/lib \ -DOPENSSL_LIBS='-L[openssl::install_area]/lib -lssl -lcrypto' } default_variants-append +openssl post-destroot { # do not record __qt_initial_c_compiler and __qt_initial_cxx_compiler reinplace "s|${configure.cc}|/usr/bin/clang|g" \ ${destroot}${qt6.dir}/lib/cmake/Qt6/qt.toolchain.cmake reinplace "s|${configure.cxx}|/usr/bin/clang++|g" \ ${destroot}${qt6.dir}/lib/cmake/Qt6/qt.toolchain.cmake # return to default value of CMAKE_OSX_DEPLOYMENT_TARGET #reinplace "s|CMAKE_OSX_DEPLOYMENT_TARGET \"${macosx_deployment_target}\"|CMAKE_OSX_DEPLOYMENT_TARGET \"10.14\"|g" \ # ${destroot}${qt6.dir}/lib/cmake/Qt6/qt.toolchain.cmake # do not record QT_SOURCE_TREE reinplace "s|${worksrcpath}|${qt6.dir}/src|g" \ ${destroot}${qt6.dir}/lib/cmake/Qt6BuildInternals/QtBuildInternalsExtra.cmake # do not record original_cmake_path reinplace "s|${prefix}/bin/cmake|/Applications/CMake.app/Contents/bin/cmake|g" \ ${destroot}${qt6.dir}/bin/qt-cmake reinplace "s|${prefix}/bin/cmake|/Applications/CMake.app/Contents/bin/cmake|g" \ ${destroot}${qt6.dir}/bin/qt-cmake-create if { "${qt6.dir}" ne "${prefix}" } { # Add dummy cmake find modules that forward to the real ones file mkdir "${destroot}${prefix}/lib/cmake/Qt6" foreach configfile [list "Qt6Config.cmake" "Qt6ConfigVersion.cmake"] { set fd [open "${destroot}${prefix}/lib/cmake/Qt6/${configfile}" "w"] puts $fd "set(_PREFIX_PATH_BAK \${CMAKE_PREFIX_PATH})" puts $fd "list(APPEND CMAKE_PREFIX_PATH \"${qt6.dir}\")" puts $fd "include(\"${qt6.dir}/lib/cmake/Qt6/${configfile}\")" puts $fd "set(CMAKE_PREFIX_PATH \${_PREFIX_PATH_BAK})" close $fd } } } # Qt builds part of the system using environment provided by MacPorts. # It builds the rest using its own internal environment. # For consistency, clear MacPorts environment. configure.cxx_stdlib proc portconfigure::should_add_stdlib {} { return false } 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 configure.march configure.mtune configure.universal_ldflags configure.universal_cflags configure.universal_cxxflags configure.universal_cppflags } subport ${name}-qtbase-docs { # see https://wiki.qt.io/Building_Qt_Documentation build.cmd cmake --build ${build.dir} destroot.target build.target --target docs destroot.cmd cmake --build ${build.dir} --target install_docs } ############################################################################### # Applies to allmost all modules ############################################################################### if { ${subport} ne "${name}" && ${subport} ne "${name}-qtbase" && ${subport} ne "${name}-qtbase-docs" } { # attempting to match module configure instructions from here: https://www.qt.io/blog/qt-6-build-system configure.cmd ${qt6.dir}/bin/qt-configure-module configure.dir ${workpath}/build configure.pre_args ${worksrcpath} configure.args-append -verbose build.dir ${workpath}/build build.cmd cmake --build ${build.dir} destroot.target if { [lindex [split ${subport} -] end] ne "docs" } { build.target destroot.cmd cmake --install ${build.dir} } else { build.target --target docs destroot.cmd cmake --build ${build.dir} --target install_docs } if { [variant_exists examples] } { configure.post_args-append -DQT_BUILD_EXAMPLES=[expr {[variant_isset examples] ? ON : OFF}] } if { [variant_exists tests] } { configure.post_args-append -DQT_BUILD_TESTS=[expr {[variant_isset tests] ? ON : OFF}] } } ############################################################################### # Applies to all subports except ${name} # this code may depend on the subport specific code (e.g., configure.cc) ############################################################################### depends_build-append path:bin/cmake:cmake \ port:ninja \ port:pkgconfig # because CPATH is set, pkgconfig does not include ${prefix}/lib and ${prefix}/include even when requested # this means that files in ${prefix}/lib and ${prefix}/include are the *last* to be found # this causes problems when there are files in ${worksrpath} that are unintentionally found instead configure.env-append PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 build.env-append PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 configure.universal_args test.cmd ctest test.args -V test.target # ninja needs the DESTDIR argument in the environment destroot.destdir destroot.env-append DESTDIR=${destroot} # set CMake variables (similar to what cmake PortGroup does) # to allow using ccache and controlling compiler selection configure.post_args-prepend -- configure.post_args-append -DCMAKE_C_COMPILER=[option configure.cc] \ -DCMAKE_CXX_COMPILER=[option configure.cxx] \ -DCMAKE_OBJC_COMPILER=[option configure.objc] \ -DCMAKE_OBJCXX_COMPILER=[option configure.objcxx] \ -DCMAKE_OSX_DEPLOYMENT_TARGET=${macosx_deployment_target} if { ${configure.ccache} } { if { ${subport} ne "${name}-qtbase" } { configure.post_args-append -DQT_USE_CCACHE=ON } else { # do not use `configure.args-append -ccache` # or `configure.post_args-append -DQT_USE_CCACHE=1` # since that affects installed files. configure.post_args-append -DCMAKE_C_COMPILER_LAUNCHER=${prefix}/bin/ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=${prefix}/bin/ccache \ -DCMAKE_OBJC_COMPILER_LAUNCHER=${prefix}/bin/ccache \ -DCMAKE_OBJCXX_COMPILER_LAUNCHER=${prefix}/bin/ccache } } test.run [expr {[variant_exists tests] && [variant_isset tests] ? yes : no}] if { ${universal_possible} && [variant_isset universal] } { configure.post_args-append -DCMAKE_OSX_ARCHITECTURES="[join ${configure.universal_archs} \;]" } elseif { ${configure.build_arch} ne "" } { configure.post_args-append -DCMAKE_OSX_ARCHITECTURES="${configure.build_arch}" } # attempt to avoid @rpath configure.post_args-append -DCMAKE_INSTALL_NAME_DIR=${qt6.dir}/lib post-destroot { fs-traverse f ${destroot} { if { [file isfile ${f}] && [file extension ${f}] eq ".prl" } { # do not record build directory reinplace -q "/^QMAKE_PRL_BUILD_DIR = /d" \ ${f} } } # .app and non-.app programs are both put in ${qt6.dir}/bin # put a link of any .app programs in the ${applications_dir}/Qt6 xinstall -d -m 0755 ${destroot}${applications_dir}/Qt6 foreach app [glob -nocomplain -tails -directory ${destroot}${qt6.dir}/bin *.app] { ln -s ${qt6.dir}/bin/${app} \ ${destroot}${applications_dir}/Qt6 } } livecheck.type none ############################################################################### # Special Case: must be near the end since it undoes other code ############################################################################### subport ${name} { # the main port is Meta-port to install various modules revision 0 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 use_configure no supported_archs noarch platforms any installs_libs no test.run no depends_extract depends_build depends_lib depends_test 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} 5] eq "" } { depends_run-append port:${name}-${module} } } depends_run-append port:${name}-sqlite-plugin livecheck.type regex livecheck.url https://download.qt.io/archive/qt/${branch}/ livecheck.regex (\\d+(\\.\\d+)+) }