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

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

qt4 and qt5 PortGroups: give location of lupdate program

File size: 8.5 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 lupdate command location
147global qt_lupdate_cmd
148set qt_lupdate_cmd     ${qt_dir}/bin/lupdate
149
150# standard PKGCONFIG path
151global qt_pkg_config_dir
152set qt_pkg_config_dir   ${qt_libs_dir}/pkgconfig
153
154# standard qmake spec
155# other platforms required
156#     see http://doc.qt.io/qt-5/supported-platforms.html
157#     and http://doc.qt.io/QtSupportedPlatforms/index.html
158global qt_qmake_spec
159global qt_qmake_spec_32
160global qt_qmake_spec_64
161compiler.whitelist clang
162
163set qt_qmake_spec_32 macx-clang-32
164set qt_qmake_spec_64 macx-clang
165
166if { ![option universal_variant] || ![variant_isset universal] } {
167    if { ${configure.build_arch} eq "i386" } {
168        set qt_qmake_spec ${qt_qmake_spec_32}
169    } else {
170        set qt_qmake_spec ${qt_qmake_spec_64}
171    }
172} else {
173    set qt_qmake_spec ""
174}
175
176# standard cmake info for Qt5
177#global qt_cmake_defines
178#set qt_cmake_defines    \
179#    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
180#     -DQT_QMAKESPEC=${qt_qmake_spec} \
181#     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
182#     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
183
184# Qt has what is calls reference configurations, which are said to be thoroughly tested
185# Qt also has configurations which are occasionally tested
186# see http://doc.qt.io/qt-5/supported-platforms.html#reference-configurations
187global qt5_min_tested_version
188global qt5_max_tested_version
189global qt5_min_reference_version
190global qt5_max_reference_version
191set qt5_min_tested_version     11
192set qt5_max_tested_version     14
193set qt5_min_reference_version  12
194set qt5_max_reference_version  14
195
196# do not try to install if qt5-qtbase dependency will fail to build
197# warn about non-reference configurations
198if { ${os.major} < ${qt5_min_tested_version} } {
199    pre-fetch {
200        ui_error "Qt dependency will not build on this platform"
201        return -code error "unsupported OS"
202    }
203}
204
205if {![info exists building_qt5]} {
206    depends_lib-append port:qt5-qtbase
207}
208
209# standard configure environment, when not building qt5
210
211if {![info exists building_qt5]} {
212#    configure.env-append \
213#        QTDIR=${qt_dir} \
214#        QMAKE=${qt_qmake_cmd} \
215#        MOC=${qt_moc_cmd}
216
217    # make sure the Qt binaries' directory is in the path, if it is
218    # not the current prefix
219
220#    if {${qt_dir} ne ${prefix}} {
221#        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
222#    }
223
224    # standard build environment, when not building qt5
225
226    #build.env-append \
227        #QTDIR=${qt_dir} \
228        #QMAKE=${qt_qmake_cmd} \
229        #MOC=${qt_moc_cmd}
230
231    #if { ![option universal_variant] || ![variant_isset universal] } {
232    #    build.env-append QMAKESPEC=${qt_qmake_spec}
233    #} else {
234    #    set merger_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
235    #    set merger_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
236    #}
237
238    # make sure the Qt binaries' directory is in the path, if it is
239    # not the current prefix
240
241    #if {${qt_dir} ne ${prefix}} {
242    #    build.env-append    PATH=${qt_bins_dir}:$env(PATH)
243    #}
244}
245
246# use PKGCONFIG for Qt discovery in configure scripts
247depends_build-append    port:pkgconfig
248
249# standard destroot environment
250if { ![option universal_variant] || ![variant_isset universal] } {
251    destroot.env-append \
252        INSTALL_ROOT=${destroot}
253} else {
254    foreach arch ${configure.universal_archs} {
255        lappend merger_destroot_env($arch) INSTALL_ROOT=${workpath}/destroot-${arch}
256    }
257}
258
259# standard destroot environment, when not building qt5
260
261#if {![info exists building_qt5]} {
262#    destroot.env-append \
263#        QTDIR=${qt_dir} \
264#        QMAKE=${qt_qmake_cmd} \
265#        MOC=${qt_moc_cmd}
266
267#    if { ![option universal_variant] || ![variant_isset universal] } {
268#        build.env-append QMAKESPEC=${qt_qmake_spec}
269#    } else {
270#        set destroot_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
271#        set destroot_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
272#    }
273
274    # make sure the Qt binaries' directory is in the path, if it is
275    # not the current prefix
276
277#    if {${qt_dir} ne ${prefix}} {
278#        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
279#    }
280#}
Note: See TracBrowser for help on using the repository browser.