Ticket #53778: qt5-1.0-for-kde.diff

File qt5-1.0-for-kde.diff, 3.6 KB (added by RJVB (René Bertin), 8 years ago)

patch for qt5-1.0.tcl

  • _resources/port1.0/group/qt5-1.0.tcl

    diff --git a/_resources/port1.0/group/qt5-1.0.tcl b/_resources/port1.0/group/qt5-1.0.tcl
    index 9169bab..feaf547 100644
    a b  
    3434# Usage:
    3535# PortGroup     qt5 1.0
    3636
    37 options qt5.using_kde qt5.base_version
     37options qt5.base_version
    3838
    3939global available_qt_versions
    4040set available_qt_versions {
    proc qt5.get_default_name {} { 
    127127global qt_name
    128128
    129129if { [info exists qt_name] } {
    130     default qt5.using_kde no
    131130    default qt5.base_version ${qt_name}
    132131} else {
    133132    set qt_name [qt5.get_default_name]
    134     default qt5.using_kde no
    135133    default qt5.base_version {[qt5.get_default_name]}
    136134}
    137135
    if {[tbool just_want_qt5_version_info]} { 
    144142    return
    145143}
    146144
     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!
     153if {[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
     185if {[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
     196options qt5.using_kde
     197default qt5.using_kde no
     198
    147199# standard install directory
    148200global qt_dir
    149201set qt_dir               ${prefix}/libexec/qt5