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

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

qt5 PortGroup: just allow port to see if Qt5 builds on particular OS version
so it may, e.g., use Qt4 instead

File size: 8.6 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# Qt has what is calls reference configurations, which are said to be thoroughly tested
39# Qt also has configurations which are occasionally tested
40# see http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations
41global qt5_min_tested_version
42global qt5_max_tested_version
43global qt5_min_reference_version
44global qt5_max_reference_version
45set qt5_min_tested_version     11
46set qt5_max_tested_version     14
47set qt5_min_reference_version  12
48set qt5_max_reference_version  14
49
50if {[tbool just_want_qt5_version_info]} {
51    return
52}
53
54# no universal binary support in Qt 5
55#     see http://lists.qt-project.org/pipermail/interest/2012-December/005038.html
56#     and https://bugreports.qt.io/browse/QTBUG-24952
57supported_archs i386 x86_64
58if { ![exists universal_variant] || [option universal_variant] } {
59    PortGroup muniversal 1.0
60    universal_archs_supported i386 x86_64
61}
62
63# standard Qt5 name
64global qt_name
65set qt_name             qt5
66
67# standard install directory
68global qt_dir
69set qt_dir               ${prefix}/libexec/qt5
70
71# standard Qt non-.app executables directory
72global qt_bins_dir
73set qt_bins_dir         ${qt_dir}/bin
74
75# standard Qt includes directory
76global qt_includes_dir
77set qt_includes_dir     ${qt_dir}/include
78
79# standard Qt libraries directory
80global qt_libs_dir
81set qt_libs_dir         ${qt_dir}/lib
82
83# standard Qt libraries directory
84global qt_frameworks_dir
85set qt_frameworks_dir   ${qt_libs_dir}
86
87global qt_archdata_dir
88set qt_archdata_dir  ${qt_dir}
89
90# standard Qt plugins directory
91global qt_plugins_dir
92set qt_plugins_dir      ${qt_archdata_dir}/plugins
93
94# standard Qt imports directory
95global qt_imports_dir
96set qt_imports_dir      ${qt_archdata_dir}/imports
97
98# standard Qt qml directory
99global qt_qml_dir
100set qt_qml_dir          ${qt_archdata_dir}/qml
101
102# standard Qt data directory
103global qt_data_dir
104set qt_data_dir         ${qt_dir}
105
106# standard Qt documents directory
107global qt_docs_dir
108set qt_docs_dir         ${qt_data_dir}/doc
109
110# standard Qt translations directory
111global qt_translations_dir
112set qt_translations_dir ${qt_data_dir}/translations
113
114# standard Qt sysconf directory
115global qt_sysconf_dir
116set qt_sysconf_dir      ${qt_dir}/etc/xdg
117
118# standard Qt examples directory
119global qt_examples_dir
120set qt_examples_dir     ${qt_dir}/examples
121
122# standard Qt tests directory
123global qt_tests_dir
124set qt_tests_dir        ${qt_dir}/tests
125
126# data used by qmake
127global qt_host_data_dir
128set qt_host_data_dir    ${qt_dir}
129
130# standard Qt demos directory
131#global qt_demos_dir
132#set qt_demos_dir        ${qt_dir}/share/${qt_name}/demos
133
134# standard Qt mkspecs directory
135global qt_mkspecs_dir
136set qt_mkspecs_dir      ${qt_dir}/mkspecs
137
138# standard Qt .app executables directory, if created
139global qt_apps_dir
140set qt_apps_dir         ${applications_dir}/Qt5
141
142# standard CMake module directory for Qt-related files
143#global qt_cmake_module_dir
144set qt_cmake_module_dir ${qt_libs_dir}/cmake
145
146# standard qmake command location
147global qt_qmake_cmd
148set qt_qmake_cmd        ${qt_dir}/bin/qmake
149
150# standard moc command location
151global qt_moc_cmd
152set qt_moc_cmd          ${qt_dir}/bin/moc
153
154# standard uic command location
155global qt_uic_cmd
156set qt_uic_cmd          ${qt_dir}/bin/uic
157
158# standard lrelease command location
159global qt_lrelease_cmd
160set qt_lrelease_cmd     ${qt_dir}/bin/lrelease
161
162# standard lupdate command location
163global qt_lupdate_cmd
164set qt_lupdate_cmd     ${qt_dir}/bin/lupdate
165
166# standard PKGCONFIG path
167global qt_pkg_config_dir
168set qt_pkg_config_dir   ${qt_libs_dir}/pkgconfig
169
170# standard qmake spec
171# other platforms required
172#     see http://doc.qt.io/qt-5/supported-platforms.html
173#     and http://doc.qt.io/QtSupportedPlatforms/index.html
174global qt_qmake_spec
175global qt_qmake_spec_32
176global qt_qmake_spec_64
177compiler.whitelist clang
178
179set qt_qmake_spec_32 macx-clang-32
180set qt_qmake_spec_64 macx-clang
181
182if { ![option universal_variant] || ![variant_isset universal] } {
183    if { ${configure.build_arch} eq "i386" } {
184        set qt_qmake_spec ${qt_qmake_spec_32}
185    } else {
186        set qt_qmake_spec ${qt_qmake_spec_64}
187    }
188} else {
189    set qt_qmake_spec ""
190}
191
192# standard cmake info for Qt5
193#global qt_cmake_defines
194#set qt_cmake_defines    \
195#    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
196#     -DQT_QMAKESPEC=${qt_qmake_spec} \
197#     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
198#     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
199
200# do not try to install if qt5-qtbase dependency will fail to build
201# warn about non-reference configurations
202if { ${os.major} < ${qt5_min_tested_version} } {
203    pre-fetch {
204        ui_error "Qt dependency will not build on this platform"
205        return -code error "unsupported OS"
206    }
207}
208
209if {![info exists building_qt5]} {
210    depends_lib-append port:qt5-qtbase
211}
212
213# standard configure environment, when not building qt5
214
215if {![info exists building_qt5]} {
216#    configure.env-append \
217#        QTDIR=${qt_dir} \
218#        QMAKE=${qt_qmake_cmd} \
219#        MOC=${qt_moc_cmd}
220
221    # make sure the Qt binaries' directory is in the path, if it is
222    # not the current prefix
223
224#    if {${qt_dir} ne ${prefix}} {
225#        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
226#    }
227
228    # standard build environment, when not building qt5
229
230    #build.env-append \
231        #QTDIR=${qt_dir} \
232        #QMAKE=${qt_qmake_cmd} \
233        #MOC=${qt_moc_cmd}
234
235    #if { ![option universal_variant] || ![variant_isset universal] } {
236    #    build.env-append QMAKESPEC=${qt_qmake_spec}
237    #} else {
238    #    set merger_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
239    #    set merger_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
240    #}
241
242    # make sure the Qt binaries' directory is in the path, if it is
243    # not the current prefix
244
245    #if {${qt_dir} ne ${prefix}} {
246    #    build.env-append    PATH=${qt_bins_dir}:$env(PATH)
247    #}
248}
249
250# use PKGCONFIG for Qt discovery in configure scripts
251depends_build-append    port:pkgconfig
252
253# standard destroot environment
254if { ![option universal_variant] || ![variant_isset universal] } {
255    destroot.env-append \
256        INSTALL_ROOT=${destroot}
257} else {
258    foreach arch ${configure.universal_archs} {
259        lappend merger_destroot_env($arch) INSTALL_ROOT=${workpath}/destroot-${arch}
260    }
261}
262
263# standard destroot environment, when not building qt5
264
265#if {![info exists building_qt5]} {
266#    destroot.env-append \
267#        QTDIR=${qt_dir} \
268#        QMAKE=${qt_qmake_cmd} \
269#        MOC=${qt_moc_cmd}
270
271#    if { ![option universal_variant] || ![variant_isset universal] } {
272#        build.env-append QMAKESPEC=${qt_qmake_spec}
273#    } else {
274#        set destroot_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
275#        set destroot_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
276#    }
277
278    # make sure the Qt binaries' directory is in the path, if it is
279    # not the current prefix
280
281#    if {${qt_dir} ne ${prefix}} {
282#        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
283#    }
284#}
Note: See TracBrowser for help on using the repository browser.