| 316 | |
| 317 | pre-configure { |
| 318 | set qt_installed_name "" |
| 319 | |
| 320 | foreach qt_test_name ${available_qt_versions} { |
| 321 | |
| 322 | if { [string range ${qt_test_name} end-3 end] eq "-kde" } { |
| 323 | set qt_test_port_name ${qt_test_name} |
| 324 | } else { |
| 325 | set qt_test_port_name ${qt_test_name}-qtbase |
| 326 | } |
| 327 | |
| 328 | if {![catch {set installed [lindex [registry_active ${qt_test_port_name}] 0]}]} { |
| 329 | set qt_installed_name ${qt_test_name} |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | if { ${qt_installed_name} eq "" } { |
| 334 | ui_error "at least one Qt must be installed" |
| 335 | return -code error "insufficient dependencies" |
| 336 | } |
| 337 | |
| 338 | ui_debug "qt5 PortGroup: Qt is provided by ${qt_installed_name}" |
| 339 | |
| 340 | if { [variant_exists qt5kde] && [variant_isset qt5kde] } { |
| 341 | if { [string range ${qt_installed_name} end-3 end] ne "-kde" } { |
| 342 | ui_error "qt5 PortGroup: Qt is installed but not qt5-kde, as is required by this variant" |
| 343 | ui_error "qt5 PortGroup: please run `sudo port uninstall --follow-dependents ${qt_installed_name}-qtbase and try again" |
| 344 | } |
| 345 | } else { |
| 346 | if { ${qt_installed_name} ne [qt5.get_default_name] } { |
| 347 | # see https://wiki.qt.io/Qt-Version-Compatibility |
| 348 | ui_warn "qt5 PortGroup: default Qt for this platform is [qt5.get_default_name] but ${qt_installed_name} is installed" |
| 349 | } |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | if { [tbool qt5.kde_variant] } { |
| 354 | variant qt5kde description {use Qt patched for KDE compatibility} {} |
| 355 | } |
| 356 | |
| 357 | namespace eval Qt5PortGroup { |
| 358 | proc register_dependents {} { |
| 359 | global qt5_private_components |
| 360 | |
| 361 | if { ![exists qt5_private_components] || ${qt5_private_components} eq "" } { |
| 362 | # no Qt components have been requested |
| 363 | # qt5.depends_component has never been called |
| 364 | set qt5_private_components "" |
| 365 | } |
| 366 | |
| 367 | if { [variant_exists qt5kde] && [variant_isset qt5kde] } { |
| 368 | set qt_kde_name qt5-kde |
| 369 | |
| 370 | depends_lib-append port:${qt_kde_name} |
| 371 | |
| 372 | foreach comp ${qt5_private_components} { |
| 373 | switch -exact ${comp} { |
| 374 | qtwebkit - |
| 375 | qtwebengine - |
| 376 | qtwebview - |
| 377 | qtenginio { |
| 378 | # these components are subports |
| 379 | depends_lib-append port:${qt_kde_name}-${comp} |
| 380 | } |
| 381 | default { |
| 382 | # qt5-kde provides all components except those above |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | } else { |
| 387 | # ![variant_isset qt5kde] |
| 388 | foreach comp "qtbase ${qt5_private_components}" { |
| 389 | switch -exact ${comp} { |
| 390 | qtquickcontrols2 { |
| 391 | set path lib/pkgconfig/Qt5QuickControls2.pc |
| 392 | } |
| 393 | qtbase { |
| 394 | set path lib/pkgconfig/Qt5Core.pc |
| 395 | } |
| 396 | qtwebengine { |
| 397 | set path lib/pkgconfig/Qt5WebEngine.pc |
| 398 | } |
| 399 | qtdeclarative { |
| 400 | set path lib/pkgconfig/Qt5Qml.pc |
| 401 | } |
| 402 | qtserialport { |
| 403 | set path lib/pkgconfig/Qt5SerialPort.pc |
| 404 | } |
| 405 | qtsensors { |
| 406 | set path lib/pkgconfig/Qt5Sensors.pc |
| 407 | } |
| 408 | qtcharts { |
| 409 | set path lib/pkgconfig/Qt5Charts.pc |
| 410 | } |
| 411 | qtwebkit { |
| 412 | set path lib/pkgconfig/Qt5WebKit.pc |
| 413 | } |
| 414 | qtwebchannel { |
| 415 | set path lib/pkgconfig/Qt5WebChannel.pc |
| 416 | } |
| 417 | qtdeclarative-render2d { |
| 418 | set path lib/cmake/Qt5Quick/Qt5Quick_ContextPlugin.cmake |
| 419 | } |
| 420 | qtimageformats { |
| 421 | set path lib/cmake/Qt5Gui/Qt5Gui_QTiffPlugin.cmake |
| 422 | } |
| 423 | qtvirtualkeyboard { |
| 424 | set path lib/cmake/Qt5Gui/Qt5Gui_QVirtualKeyboardPlugin.cmake |
| 425 | } |
| 426 | qtsvg { |
| 427 | set path lib/pkgconfig/Qt5Svg.pc |
| 428 | } |
| 429 | qtmacextras { |
| 430 | set path lib/pkgconfig/Qt5MacExtras.pc |
| 431 | } |
| 432 | qtlocation { |
| 433 | set path lib/pkgconfig/Qt5Location.pc |
| 434 | } |
| 435 | qtxmlpatterns { |
| 436 | set path lib/pkgconfig/Qt5XmlPatterns.pc |
| 437 | } |
| 438 | qtserialbus { |
| 439 | set path lib/pkgconfig/Qt5SerialBus.pc |
| 440 | } |
| 441 | qtmultimedia { |
| 442 | set path lib/pkgconfig/Qt5Multimedia.pc |
| 443 | } |
| 444 | qtcanvas3d { |
| 445 | set path libexec/qt5/qml/QtCanvas3D/libqtcanvas3d.dylib |
| 446 | } |
| 447 | qtdatavis3d { |
| 448 | set path lib/pkgconfig/Qt5DataVisualization.pc |
| 449 | } |
| 450 | qtgraphicaleffects { |
| 451 | set path libexec/qt5/qml/QtGraphicalEffects/libqtgraphicaleffectsplugin.dylib |
| 452 | } |
| 453 | qtpurchasing { |
| 454 | set path lib/pkgconfig/Qt5Purchasing.pc |
| 455 | } |
| 456 | qtscript { |
| 457 | set path lib/pkgconfig/Qt5Script.pc |
| 458 | } |
| 459 | qtscxml { |
| 460 | set path lib/pkgconfig/Qt5Scxml.pc |
| 461 | } |
| 462 | qt3d { |
| 463 | set path lib/pkgconfig/Qt53DCore.pc |
| 464 | } |
| 465 | qtconnectivity { |
| 466 | set path lib/pkgconfig/Qt5Bluetooth.pc |
| 467 | } |
| 468 | qtgamepad { |
| 469 | set path lib/pkgconfig/Qt5Gamepad.pc |
| 470 | } |
| 471 | qtwebview { |
| 472 | set path lib/pkgconfig/Qt5WebView.pc |
| 473 | } |
| 474 | qttools { |
| 475 | set path lib/pkgconfig/Qt5Designer.pc |
| 476 | } |
| 477 | qtquickcontrols { |
| 478 | set path libexec/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.dylib |
| 479 | } |
| 480 | qtwebsockets { |
| 481 | set path lib/pkgconfig/Qt5WebSockets.pc |
| 482 | } |
| 483 | qttranslations { |
| 484 | set path libexec/qt5/translations/qt_ar.qm |
| 485 | } |
| 486 | mysql-plugin { |
| 487 | set path lib/cmake/Qt5Sql/Qt5Sql_QMYSQLDriverPlugin.cmake |
| 488 | } |
| 489 | psql-plugin { |
| 490 | set path lib/cmake/Qt5Sql/Qt5Sql_QPSQLDriverPlugin.cmake |
| 491 | } |
| 492 | sqlite-plugin { |
| 493 | set path lib/cmake/Qt5Sql/Qt5Sql_QSQLiteDriverPlugin.cmake |
| 494 | } |
| 495 | qtquick1 { |
| 496 | set path lib/pkgconfig/Qt5Declarative.pc |
| 497 | } |
| 498 | qtenginio { |
| 499 | set path lib/pkgconfig/Enginio.pc |
| 500 | } |
| 501 | default { |
| 502 | set path "" |
| 503 | return -code error "unknown component" |
| 504 | } |
| 505 | } |
| 506 | depends_lib-append path:${path}:[qt5.get_default_name]-${comp} |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | port::register_callback Qt5PortGroup::register_dependents |