| 145 | ########################################################################################### |
| 146 | # Check what Qt5 port and PortGroup we should be using, based on indicated port preference, |
| 147 | # what is already installed and OS version. |
| 148 | # Given that ports exist for multiple Qt5 versions it is easier to distinguish port:qt5 and |
| 149 | # port:qt5-kde from differences in install layout than from active installed portnames. |
| 150 | |
| 151 | # first, check if port:qt5-kde or a port:qt5-kde-devel is installed, or if we're on Mac OS X 10.6 |
| 152 | # NB: the qt5-kde-devel ports may never exist officially in MacPorts but is used locally by KF5 port maintainers! |
| 153 | if {[file exists ${prefix}/include/qt5/QtCore/QtCore] || ${os.major} == 10} { |
| 154 | # Qt5 has been installed through port:qt5-kde or port:qt5-kde-devel or we're on 10.6 |
| 155 | # transfer control to qt5-kde-1.0.tcl |
| 156 | ui_debug "Qt5 is provided by port:qt5-kde" |
| 157 | PortGroup qt5-kde 1.0 |
| 158 | return |
| 159 | } elseif {[file exists ${prefix}/libexec/qt5/plugins] |
| 160 | && [file type ${prefix}/libexec/qt5/plugins] eq "directory"} { |
| 161 | # qt5-qtbase is installed: Qt5 has been installed through a standard port:qt5 port |
| 162 | # (checking if "plugins" is a directory is probably redundant) |
| 163 | # We're already in the correct PortGroup |
| 164 | if {[info exists qt5.prefer_kde] && [info exists building_qt5]} { |
| 165 | # user tries to install say qt5-kde-qtwebkit against qt5-qtbase etc. |
| 166 | ui_error "You cannot install a Qt5-KDE port with port:qt5 or one of its subports installed!" |
| 167 | # print the error but only raise it when attempting to fetch or configure the port. |
| 168 | pre-fetch { |
| 169 | return -code error "Deactivate the conflicting port:qt5 port(s) first!" |
| 170 | } |
| 171 | pre-configure { |
| 172 | return -code error "Deactivate the conflicting port:qt5 port(s) first!" |
| 173 | } |
| 174 | } |
| 175 | } elseif {[info exists qt5.prefer_kde]} { |
| 176 | # The calling port has indicated a preference and no Qt5 port is installed already |
| 177 | # transfer control to qt5-kde-1.0.tcl |
| 178 | ui_debug "Qt5 will be provided by port:qt5-kde, by request" |
| 179 | PortGroup qt5-kde 1.0 |
| 180 | return |
| 181 | } else { |
| 182 | # default situation: we're already in the correct PortGroup |
| 183 | } |
| 184 | |
| 185 | if {[info exists qt5.prefer_kde]} { |
| 186 | # this is a port that prefers port:qt5-kde and thus expects most of Qt5 to be installed |
| 187 | # through that single port rather than enumerate all components it depends on. |
| 188 | depends_lib-append port:qt5 |
| 189 | # the port may also use a variable that is still provided by qt5-kde-1.0.tcl; |
| 190 | # set it to an empty value so that it can be referenced without side-effects. |
| 191 | global qt_cmake_defines |
| 192 | set qt_cmake_defines "" |
| 193 | } |
| 194 | ########################################################################################### |
| 195 | |
| 196 | options qt5.using_kde |
| 197 | default qt5.using_kde no |
| 198 | |