Ticket #48967: qt5-mac-1.0.tcl

File qt5-mac-1.0.tcl, 7.7 KB (added by RJVB (René Bertin), 9 years ago)

the current "mainstream"/"official" Qt5 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# $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_spe
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
180if {![info exists building_qt5]} {
181    depends_lib-append port:qt5-qtbase
182}
183
184# standard configure environment, when not building qt5
185
186if {![info exists building_qt5]} {
187#    configure.env-append \
188#        QTDIR=${qt_dir} \
189#        QMAKE=${qt_qmake_cmd} \
190#        MOC=${qt_moc_cmd}
191
192    # make sure the Qt binaries' directory is in the path, if it is
193    # not the current prefix
194
195#    if {${qt_dir} ne ${prefix}} {
196#        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
197#    }
198
199    # standard build environment, when not building qt5
200
201    #build.env-append \
202        #QTDIR=${qt_dir} \
203        #QMAKE=${qt_qmake_cmd} \
204        #MOC=${qt_moc_cmd}
205
206    #if { ![option universal_variant] || ![variant_isset universal] } {
207    #    build.env-append QMAKESPEC=${qt_qmake_spec}
208    #} else {
209    #    set merger_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
210    #    set merger_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
211    #}
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    #    build.env-append    PATH=${qt_bins_dir}:$env(PATH)
218    #}
219}
220
221# use PKGCONFIG for Qt discovery in configure scripts
222depends_build-append    port:pkgconfig
223
224# standard destroot environment
225if { ![option universal_variant] || ![variant_isset universal] } {
226    destroot.env-append \
227        INSTALL_ROOT=${destroot}
228} else {
229    foreach arch ${configure.universal_archs} {
230        lappend merger_destroot_env($arch) INSTALL_ROOT=${workpath}/destroot-${arch}
231    }
232}
233
234# standard destroot environment, when not building qt5
235
236#if {![info exists building_qt5]} {
237#    destroot.env-append \
238#        QTDIR=${qt_dir} \
239#        QMAKE=${qt_qmake_cmd} \
240#        MOC=${qt_moc_cmd}
241
242#    if { ![option universal_variant] || ![variant_isset universal] } {
243#        build.env-append QMAKESPEC=${qt_qmake_spec}
244#    } else {
245#        set destroot_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
246#        set destroot_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
247#    }
248
249    # make sure the Qt binaries' directory is in the path, if it is
250    # not the current prefix
251
252#    if {${qt_dir} ne ${prefix}} {
253#        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
254#    }
255#}