[MacPorts] #53778: Qt5/qt5-kde PortGroup

MacPorts noreply at macports.org
Sun Mar 12 18:27:03 UTC 2017


#53778: Qt5/qt5-kde PortGroup
-------------------------+----------------------
  Reporter:  RJVB        |      Owner:
      Type:  submission  |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:  haspatch
      Port:  qt5         |
-------------------------+----------------------

Comment (by RJVB):

 Here's the equivalent block from my own `qt5-kde-1.0.tcl` PG, transferring
 control to `qt5-1.0.tcl` in the opposite cases and when
 `just_want_qt5_version_info` is true.

 I've paid a bit less attention to comments and layout here.

 {{{
 if {[tbool just_want_qt5_version_info]} {
     PortGroup           qt5 1.0
     return
 }

 # Check what Qt5 installation flavour already exists, or if not if the
 port calling us
 # indicated a preference. If not, use the default/mainstream port:qt5 .
 # Also use qt5-kde if we're on 10.6 because qt5-kde provides a fallback to
 Qt 5.3.2 on that OS version

 # first, check if port:qt5-kde or a port:qt5-kde-devel is installed, or if
 we're on Mac OS X 10.6
 # NB: the qt5-kde-devel ports may never exist officially in MacPorts but
 is used locally by KF5 port maintainers!
 if {[file exists ${prefix}/include/qt5/QtCore/QtCore] || ${os.major} ==
 10} {
     # Qt5 has been installed through port:qt5-kde or port:qt5-kde-devel
     ui_debug "Qt5 is provided by port:qt5-kde"
     # we're in the right PortGroup, otherwise we'd need to
     # PortGroup           qt5-kde 1.0
     set qt5.using_kde   yes
 } elseif {[file exists ${prefix}/libexec/qt5/plugins]
         && [file type ${prefix}/libexec/qt5/plugins] eq "directory"} {
     # qt5-qtbase is installed: Qt5 has been installed through a standard
 port:qt5 port
     # (checking if "plugins" is a directory is probably redundant)
     ui_debug "Qt5 is provided by port:qt5"
     PortGroup           qt5 1.0
     if {[info exists qt5.prefer_kde] && [info exists building_qt5]} {
         # user tries to install say qt5-kde-qtwebkit against qt5-qtbase
 etc.
         ui_error "You cannot install a Qt5-KDE port with port:qt5 or one
 of its subports installed!"
         # print the error but only raise it when attempting to fetch or
 configure the port.
         pre-fetch {
             return -code error "Deactivate the conflicting port:qt5
 port(s) first!"
         }
         pre-configure {
             return -code error "Deactivate the conflicting port:qt5
 port(s) first!"
         }
     }
     # we're done
     return
 } elseif {[info exists qt5.prefer_kde]} {
     # The calling port has indicated a preference and no Qt5 port is
 installed already
     ui_debug "Qt5 will be provided by port:qt5-kde, by request"
     # we're in the right PortGroup, otherwise we'd need to
     # PortGroup           qt5-kde 1.0
     set qt5.using_kde   yes
 } else {
     # default fall-back to mainstream port:qt5
     ui_debug "Qt5 will be provided by port:qt5 (default)"
     PortGroup           qt5 1.0
     # we're done
     return
 }

 # # this shouldn't be necessary (and impossible if we return immediately
 after loading qt5-1.0.tcl):
 # if {![tbool qt5.using_kde]} {
 #     # we're back from `PortGroup qt5 1.0`, add some finishing touches
 and then return
 #     if {[info exists qt5.prefer_kde]} {
 #         # this is a port that prefers port:qt5-kde and thus expects most
 of Qt5 to be installed
 #         # through that single port rather than enumerate all components
 it depends on.
 #         depends_lib-append  port:qt5
 #     }
 #     if {![info exists qt_cmake_defines]} {
 #         # the Qt5 PortGroups used to define a variable that is no longer
 provided by qt5-mac-1.0.tcl;
 #         # set it to an empty value so that it can be referenced without
 side-effects.
 #         global qt_cmake_defines
 #         set qt_cmake_defines ""
 #     }
 #     # we're done now.
 #     return
 # }

 ######### checks that should never trigger (and raise errors) #########
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/53778#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list