source: trunk/dports/_resources/port1.0/group/qt5-1.0.tcl @ 144784

Last change on this file since 144784 was 144784, checked in by mcalhoun@…, 3 years ago

qt5 PortGroup: stop install process early if Qt dependency is unsupported on particular OS version (see #50331)

File size: 8.4 KB
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# $Id: qt5-1.0.tcl 113952 2013-11-26 18:01:53Z michaelld@macports.org $
3
4# Copyright (c) 2014 The MacPorts Project
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are
9# met:
10#
11# 1. Redistributions of source code must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16# 3. Neither the name of Apple Computer, Inc. nor the names of its
17#    contributors may be used to endorse or promote products derived from
18#    this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31#
32#
33# This portgroup defines standard settings when using Qt5.
34#
35# Usage:
36# PortGroup     qt5 1.0
37
38# no universal binary support in Qt 5
39#     see http://lists.qt-project.org/pipermail/interest/2012-December/005038.html
40#     and https://bugreports.qt.io/browse/QTBUG-24952
41supported_archs i386 x86_64
42if { ![exists universal_variant] || [option universal_variant] } {
43    PortGroup muniversal 1.0
44    universal_archs_supported i386 x86_64
45}
46
47# standard Qt5 name
48global qt_name
49set qt_name             qt5
50
51# standard install directory
52global qt_dir
53set qt_dir               ${prefix}/libexec/qt5
54
55# standard Qt non-.app executables directory
56global qt_bins_dir
57set qt_bins_dir         ${qt_dir}/bin
58
59# standard Qt includes directory
60global qt_includes_dir
61set qt_includes_dir     ${qt_dir}/include
62
63# standard Qt libraries directory
64global qt_libs_dir
65set qt_libs_dir         ${qt_dir}/lib
66
67# standard Qt libraries directory
68global qt_frameworks_dir
69set qt_frameworks_dir   ${qt_libs_dir}
70
71global qt_archdata_dir
72set qt_archdata_dir  ${qt_dir}
73
74# standard Qt plugins directory
75global qt_plugins_dir
76set qt_plugins_dir      ${qt_archdata_dir}/plugins
77
78# standard Qt imports directory
79global qt_imports_dir
80set qt_imports_dir      ${qt_archdata_dir}/imports
81
82# standard Qt qml directory
83global qt_qml_dir
84set qt_qml_dir          ${qt_archdata_dir}/qml
85
86# standard Qt data directory
87global qt_data_dir
88set qt_data_dir         ${qt_dir}
89
90# standard Qt documents directory
91global qt_docs_dir
92set qt_docs_dir         ${qt_data_dir}/doc
93
94# standard Qt translations directory
95global qt_translations_dir
96set qt_translations_dir ${qt_data_dir}/translations
97
98# standard Qt sysconf directory
99global qt_sysconf_dir
100set qt_sysconf_dir      ${qt_dir}/etc/xdg
101
102# standard Qt examples directory
103global qt_examples_dir
104set qt_examples_dir     ${qt_dir}/examples
105
106# standard Qt tests directory
107global qt_tests_dir
108set qt_tests_dir        ${qt_dir}/tests
109
110# data used by qmake
111global qt_host_data_dir
112set qt_host_data_dir    ${qt_dir}
113
114# standard Qt demos directory
115#global qt_demos_dir
116#set qt_demos_dir        ${qt_dir}/share/${qt_name}/demos
117
118# standard Qt mkspecs directory
119global qt_mkspecs_dir
120set qt_mkspecs_dir      ${qt_dir}/mkspecs
121
122# standard Qt .app executables directory, if created
123global qt_apps_dir
124set qt_apps_dir         ${applications_dir}/Qt5
125
126# standard CMake module directory for Qt-related files
127#global qt_cmake_module_dir
128set qt_cmake_module_dir ${qt_libs_dir}/cmake
129
130# standard qmake command location
131global qt_qmake_cmd
132set qt_qmake_cmd        ${qt_dir}/bin/qmake
133
134# standard moc command location
135global qt_moc_cmd
136set qt_moc_cmd          ${qt_dir}/bin/moc
137
138# standard uic command location
139global qt_uic_cmd
140set qt_uic_cmd          ${qt_dir}/bin/uic
141
142# standard lrelease command location
143global qt_lrelease_cmd
144set qt_lrelease_cmd     ${qt_dir}/bin/lrelease
145
146# standard PKGCONFIG path
147global qt_pkg_config_dir
148set qt_pkg_config_dir   ${qt_libs_dir}/pkgconfig
149
150# standard qmake spec
151# other platforms required
152#     see http://doc.qt.io/qt-5/supported-platforms.html
153#     and http://doc.qt.io/QtSupportedPlatforms/index.html
154global qt_qmake_spec
155global qt_qmake_spec_32
156global qt_qmake_spec_64
157compiler.whitelist clang
158
159set qt_qmake_spec_32 macx-clang-32
160set qt_qmake_spec_64 macx-clang
161
162if { ![option universal_variant] || ![variant_isset universal] } {
163    if { ${configure.build_arch} eq "i386" } {
164        set qt_qmake_spec ${qt_qmake_spec_32}
165    } else {
166        set qt_qmake_spec ${qt_qmake_spec_64}
167    }
168} else {
169    set qt_qmake_spec ""
170}
171
172# standard cmake info for Qt5
173#global qt_cmake_defines
174#set qt_cmake_defines    \
175#    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
176#     -DQT_QMAKESPEC=${qt_qmake_spec} \
177#     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
178#     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
179
180# Qt has what is calls reference configurations, which are said to be thoroughly tested
181# Qt also has configurations which are occasionally tested
182# see http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations
183global qt5_min_tested_version
184global qt5_max_tested_version
185global qt5_min_reference_version
186global qt5_max_reference_version
187set qt5_min_tested_version     11
188set qt5_max_tested_version     14
189set qt5_min_reference_version  12
190set qt5_max_reference_version  14
191
192# do not try to install if qt5-qtbase dependency will fail to build
193# warn about non-reference configurations
194if { ${os.major} < ${qt5_min_tested_version} } {
195    pre-fetch {
196        ui_error "Qt dependency will not build on this platform"
197        return -code error "unsupported OS"
198    }
199}
200
201if {![info exists building_qt5]} {
202    depends_lib-append port:qt5-qtbase
203}
204
205# standard configure environment, when not building qt5
206
207if {![info exists building_qt5]} {
208#    configure.env-append \
209#        QTDIR=${qt_dir} \
210#        QMAKE=${qt_qmake_cmd} \
211#        MOC=${qt_moc_cmd}
212
213    # make sure the Qt binaries' directory is in the path, if it is
214    # not the current prefix
215
216#    if {${qt_dir} ne ${prefix}} {
217#        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
218#    }
219
220    # standard build environment, when not building qt5
221
222    #build.env-append \
223        #QTDIR=${qt_dir} \
224        #QMAKE=${qt_qmake_cmd} \
225        #MOC=${qt_moc_cmd}
226
227    #if { ![option universal_variant] || ![variant_isset universal] } {
228    #    build.env-append QMAKESPEC=${qt_qmake_spec}
229    #} else {
230    #    set merger_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
231    #    set merger_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
232    #}
233
234    # make sure the Qt binaries' directory is in the path, if it is
235    # not the current prefix
236
237    #if {${qt_dir} ne ${prefix}} {
238    #    build.env-append    PATH=${qt_bins_dir}:$env(PATH)
239    #}
240}
241
242# use PKGCONFIG for Qt discovery in configure scripts
243depends_build-append    port:pkgconfig
244
245# standard destroot environment
246if { ![option universal_variant] || ![variant_isset universal] } {
247    destroot.env-append \
248        INSTALL_ROOT=${destroot}
249} else {
250    foreach arch ${configure.universal_archs} {
251        lappend merger_destroot_env($arch) INSTALL_ROOT=${workpath}/destroot-${arch}
252    }
253}
254
255# standard destroot environment, when not building qt5
256
257#if {![info exists building_qt5]} {
258#    destroot.env-append \
259#        QTDIR=${qt_dir} \
260#        QMAKE=${qt_qmake_cmd} \
261#        MOC=${qt_moc_cmd}
262
263#    if { ![option universal_variant] || ![variant_isset universal] } {
264#        build.env-append QMAKESPEC=${qt_qmake_spec}
265#    } else {
266#        set destroot_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
267#        set destroot_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
268#    }
269
270    # make sure the Qt binaries' directory is in the path, if it is
271    # not the current prefix
272
273#    if {${qt_dir} ne ${prefix}} {
274#        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
275#    }
276#}
Note: See TracBrowser for help on using the repository browser.