Ticket #48967: qt5-1.0.tcl

File qt5-1.0.tcl, 3.8 KB (added by RJVB (René Bertin), 8 years ago)

the Qt5 "header" PortGroup

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4;
3# $Id: qt5-1.0.tcl 113952 2015-06-11 16:30:53Z gmail.com:rjvbertin $
4# $Id: qt5-1.0.tcl 113952 2013-11-26 18:01:53Z michaelld@macports.org $
5
6# Copyright (c) 2014 The MacPorts Project
7# All rights reserved.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions are
11# met:
12#
13# 1. Redistributions of source code must retain the above copyright
14#    notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16#    notice, this list of conditions and the following disclaimer in the
17#    documentation and/or other materials provided with the distribution.
18# 3. Neither the name of Apple Computer, Inc. nor the names of its
19#    contributors may be used to endorse or promote products derived from
20#    this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33#
34#
35# This portgroup defines standard settings when using Qt5.
36#
37# Usage:
38# PortGroup     qt5 1.0
39#
40# or
41#
42# set qt5.prefer_kde    1
43# PortGroup             qt5 1.0
44
45# Check what Qt5 installation flavour already exists, or if not if the port calling us
46# indicated a preference. If not, use the default/mainstream port:qt5-mac .
47if {[file exists ${prefix}/include/qt5/QtCore/QtCore] && ![info exists qt5.prefer_default]} {
48    # Qt5 has been installed through port:qt5-kde and is not the be reinstalled the other way
49    ui_debug "Qt5 is provided by port:qt5-kde"
50    PortGroup   qt5-kde 1.0
51    set qt5.using_kde   yes
52} elseif {![info exists qt5.prefer_kde]} {
53    if {[file type ${prefix}/libexec/qt5/plugins] eq "directory"} {
54        # Qt5 has been installed through port:qt5 and is not the be reinstalled the other way
55        ui_debug "Qt5 is provided by port:qt5"
56        PortGroup   qt5-mac 1.0
57        set qt5.using_kde   no
58    } elseif {[file exists ${prefix}/libexec/qt5-mac/include/QtCore/QtCore]} {
59        # Qt5 has been installed through port:qt5-mac and is not the be reinstalled the other way
60        ui_debug "Qt5 is provided by port:qt5-mac"
61        PortGroup   qt5-mac 1.0
62        set qt5.using_kde   no
63    }
64} elseif {[info exists qt5.prefer_kde]} {
65    # The calling port has indicated a preference for port:qt5-kde and
66    # Qt5 has hopefully not been installed through the outdated, exclusive port:qt5-mac (5.3.2)
67    ui_debug "Qt5 will be provided by port:qt5-kde, by request"
68    PortGroup   qt5-kde 1.0
69    set qt5.using_kde   yes
70} else {
71    # default fall-back to mainstream port:qt5
72    ui_debug "Qt5 will be provided by port:qt5 (default)"
73    PortGroup   qt5-mac 1.0
74    set qt5.using_kde   no
75}
76
77proc qt_branch {} {
78    global version
79    return [join [lrange [split ${version} .] 0 1] .]
80}