<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/471cae682d39d806fe1f270299c307ccb10dee98">https://github.com/macports/macports-ports/commit/471cae682d39d806fe1f270299c307ccb10dee98</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 471cae682d39d806fe1f270299c307ccb10dee98
</span>Author: John Hoyt <john.hoyt@gmail.com>
AuthorDate: Fri Nov 5 07:46:30 2021 -0400
<span style='display:block; white-space:pre;color:#404040;'> qt6: Move from cmake 1.1 portgroup based build to qt-configure-module based build to better align with Qt's build guide
</span><span style='display:block; white-space:pre;color:#404040;'> Additionally fix the cmake file patching mechanism to be recursive
</span>---
_resources/port1.0/group/qt6-1.0.tcl | 8 ++---
aqua/qt6/Portfile | 68 +++++++++++++++++++++++++-----------
2 files changed, 52 insertions(+), 24 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/qt6-1.0.tcl b/_resources/port1.0/group/qt6-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index d426e917856..04338924116 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/qt6-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/qt6-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -152,14 +152,14 @@ set qt_cmake_module_dir ${qt_libs_dir}/cmake
</span> global qt_cmake_cmd
set qt_cmake_cmd ${qt_dir}/bin/qt-cmake
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# standard qt-configure-module command location
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global qt_cmake_cmd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set qt_configure_module_cmd ${qt_dir}/bin/qt-configure-module
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # standard qmake command location
global qt_qmake_cmd
set qt_qmake_cmd ${qt_dir}/bin/qmake
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# standard qt-configure-module command location
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-global qt_configure_module_cmd
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-set qt_configure_module_cmd ${qt_dir}/bin/qt-configure-module
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # standard moc command location
global qt_moc_cmd
set qt_moc_cmd ${qt_dir}/moc
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/aqua/qt6/Portfile b/aqua/qt6/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 8aae6133601..865f27162d3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/aqua/qt6/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/aqua/qt6/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -28,6 +28,9 @@ set qt_major [lindex [split ${version} .] 0]
</span> # see https://www.qt.io/blog/qt-6.0-released
#compiler.cxx_standard 17
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Save off the actual macports prefix for use late
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set mp_prefix ${prefix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> master_sites https://download.qt.io/official_releases/qt/${branch}/${version}/submodules
# file sizes are significantly smaller using xz
if { ${subport} ne ${name} && ${subport} ne "${name}-docs" } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -864,19 +867,28 @@ foreach {module module_info} [array get modules] {
</span> default_variants-append +openssl
} else {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # these subports use qt-cmake
<span style='display:block; white-space:pre;background:#ffe0e0;'>- PortGroup cmake 1.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PortGroup qt6 1.0
</span> PortGroup active_variants 1.1
# We need to use qt-cmake to configure the build
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cmd ${qt_configure_module_cmd}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Attempting to match module configure instructions from here: https://www.qt.io/blog/qt-6-build-system
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # --prefix is not recognized.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.pre_args-delete --prefix=${prefix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.pre_args-append ${worksrcpath}
</span> configure.dir ${workpath}/build
<span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cmd ${qt_cmake_cmd}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- prefix ${qt_dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # QT suggests using Nina to build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build.cmd ninja
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build.dir ${workpath}/build
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # --prefix is not recognized by qt-configure-module
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # need to specify ninja for the build environment
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cmake.generator Ninja
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot.target install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # ninja needs the DESTDIR argument in the environment
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot.destdir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot.env-append DESTDIR=${destroot}
</span>
# detremine which variants are to be turned off
set request_examples true
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1063,9 +1075,6 @@ foreach {sql_names sql_info} [array get sql_plugins] {
</span> [subst -DCMAKE_LIBRARY_PATH=\"[lindex ${variant_info} 3]\"]
}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Need to update the prefix after the INCLUDE and LIB variables are set
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- prefix ${qt_dir}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Specify the actual location of the sqldrivers
cmake.source_dir ${cmake.source_dir}/src/plugins/sqldrivers/
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1164,29 +1173,37 @@ post-destroot {
</span> }
# put configuration files in places they will be found automatically
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if { ${qt_libs_dir} ne "${prefix}/lib" } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${qt_libs_dir} ne "${mp_prefix}/lib" } {
</span> # put link to pkgconfig files in place where pkgconfig will find it
# most Qt 6 pkgconfig files begin with Qt6, so link should not conflict with any other Qt installations
<span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 0755 ${destroot}${mp_prefix}/lib/pkgconfig
</span> foreach pcfile [glob -nocomplain -tails -directory ${destroot}${qt_libs_dir}/pkgconfig *.pc] {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -s ${qt_libs_dir}/pkgconfig/${pcfile} ${destroot}${prefix}/lib/pkgconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${qt_libs_dir}/pkgconfig/${pcfile} ${destroot}${mp_prefix}/lib/pkgconfig
</span> }
# put link to cmake files in place where cmake will find it
# most Qt 6 cmake directories begin with Qt6, so link should not conflict with any other Qt installations
<span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -d -m 0755 ${destroot}${prefix}/lib/cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 0755 ${destroot}${mp_prefix}/lib/cmake
</span> foreach cmakedir [glob -type d -nocomplain -tails -directory ${destroot}${qt_libs_dir}/cmake *] {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -d -m 0755 ${destroot}${prefix}/lib/cmake/${cmakedir}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach cmakefile [glob -tails -directory ${destroot}${qt_libs_dir}/cmake/${cmakedir} *.cmake] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -s ${qt_libs_dir}/cmake/${cmakedir}/${cmakefile} ${destroot}${prefix}/lib/cmake/${cmakedir}/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # only symlink the top folder, checking to see if the symlink already exists
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ![ file exists ${mp_prefix}/lib/cmake/${cmakedir} ] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${qt_libs_dir}/cmake/${cmakedir} ${destroot}${mp_prefix}/lib/cmake/${cmakedir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # grab the cmake files in qt_bins_dir too
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach cmakefile [glob -type f -nocomplain -tails -directory ${destroot}${qt_bins_dir}/ *.cmake] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ![ file exists ${mp_prefix}/lib/cmake/${cmakefile} ] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${qt_bins_dir}/${cmakefile} ${destroot}${mp_prefix}/lib/cmake/${cmakefile}
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # if cmake finds configuration files in ${prefix}/lib/cmake, CMAKE_CURRENT_LIST_DIR expands to ${prefix}/lib/cmake/xxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # if cmake finds configuration files in ${mp_prefix}/lib/cmake, CMAKE_CURRENT_LIST_DIR expands to ${mp_prefix}/lib/cmake/xxx
</span> # cmake configuration files actually installed in ${qt_cmake_module_dir}/xxx
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach cmakedir [glob -type d -nocomplain -tails -directory ${destroot}${qt_libs_dir}/cmake *] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach cmakefile [glob -nocomplain -directory ${destroot}${qt_libs_dir}/cmake/${cmakedir} *.cmake] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmakepath ${destroot}${qt_libs_dir}/cmake/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach cmakefile [ rglob ${cmakepath} *.cmake ] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ![file isdirectory ${cmakefile} ] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmakedir [file dirname ${cmakefile}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmakedir [string replace $cmakedir 0 [string length $cmakepath]-1]
</span> reinplace -q "s|\\\${CMAKE_CURRENT_LIST_DIR}|${qt_cmake_module_dir}/${cmakedir}|g" ${cmakefile}
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1216,3 +1233,14 @@ foreach {component component_info} [array get qt6pg::qt6_component_lib] {
</span> }
}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc rglob { dirpath patterns } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set rlist {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach fpath [glob -nocomplain -types f -directory ${dirpath} {*}${patterns}] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend rlist ${fpath}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach dir [glob -nocomplain -types d -directory ${dirpath} *] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend rlist {*}[rglob ${dir} ${patterns}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${rlist}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span></pre><pre style='margin:0'>
</pre>