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 |
---|
41 | supported_archs i386 x86_64 |
---|
42 | if { ![exists universal_variant] || [option universal_variant] } { |
---|
43 | PortGroup muniversal 1.0 |
---|
44 | universal_archs_supported i386 x86_64 |
---|
45 | } |
---|
46 | |
---|
47 | # standard Qt5 name |
---|
48 | global qt_name |
---|
49 | set qt_name qt5 |
---|
50 | |
---|
51 | # standard install directory |
---|
52 | global qt_dir |
---|
53 | set qt_dir ${prefix}/libexec/qt5 |
---|
54 | |
---|
55 | # standard Qt non-.app executables directory |
---|
56 | global qt_bins_dir |
---|
57 | set qt_bins_dir ${qt_dir}/bin |
---|
58 | |
---|
59 | # standard Qt includes directory |
---|
60 | global qt_includes_dir |
---|
61 | set qt_includes_dir ${qt_dir}/include |
---|
62 | |
---|
63 | # standard Qt libraries directory |
---|
64 | global qt_libs_dir |
---|
65 | set qt_libs_dir ${qt_dir}/lib |
---|
66 | |
---|
67 | # standard Qt libraries directory |
---|
68 | global qt_frameworks_dir |
---|
69 | set qt_frameworks_dir ${qt_libs_dir} |
---|
70 | |
---|
71 | global qt_archdata_dir |
---|
72 | set qt_archdata_dir ${qt_dir} |
---|
73 | |
---|
74 | # standard Qt plugins directory |
---|
75 | global qt_plugins_dir |
---|
76 | set qt_plugins_dir ${qt_archdata_dir}/plugins |
---|
77 | |
---|
78 | # standard Qt imports directory |
---|
79 | global qt_imports_dir |
---|
80 | set qt_imports_dir ${qt_archdata_dir}/imports |
---|
81 | |
---|
82 | # standard Qt qml directory |
---|
83 | global qt_qml_dir |
---|
84 | set qt_qml_dir ${qt_archdata_dir}/qml |
---|
85 | |
---|
86 | # standard Qt data directory |
---|
87 | global qt_data_dir |
---|
88 | set qt_data_dir ${qt_dir} |
---|
89 | |
---|
90 | # standard Qt documents directory |
---|
91 | global qt_docs_dir |
---|
92 | set qt_docs_dir ${qt_data_dir}/doc |
---|
93 | |
---|
94 | # standard Qt translations directory |
---|
95 | global qt_translations_dir |
---|
96 | set qt_translations_dir ${qt_data_dir}/translations |
---|
97 | |
---|
98 | # standard Qt sysconf directory |
---|
99 | global qt_sysconf_dir |
---|
100 | set qt_sysconf_dir ${qt_dir}/etc/xdg |
---|
101 | |
---|
102 | # standard Qt examples directory |
---|
103 | global qt_examples_dir |
---|
104 | set qt_examples_dir ${qt_dir}/examples |
---|
105 | |
---|
106 | # standard Qt tests directory |
---|
107 | global qt_tests_dir |
---|
108 | set qt_tests_dir ${qt_dir}/tests |
---|
109 | |
---|
110 | # data used by qmake |
---|
111 | global qt_host_data_dir |
---|
112 | set 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 |
---|
119 | global qt_mkspecs_dir |
---|
120 | set qt_mkspecs_dir ${qt_dir}/mkspecs |
---|
121 | |
---|
122 | # standard Qt .app executables directory, if created |
---|
123 | global qt_apps_dir |
---|
124 | set qt_apps_dir ${applications_dir}/Qt5 |
---|
125 | |
---|
126 | # standard CMake module directory for Qt-related files |
---|
127 | #global qt_cmake_module_dir |
---|
128 | set qt_cmake_module_dir ${qt_libs_dir}/cmake |
---|
129 | |
---|
130 | # standard qmake command location |
---|
131 | global qt_qmake_cmd |
---|
132 | set qt_qmake_cmd ${qt_dir}/bin/qmake |
---|
133 | |
---|
134 | # standard moc command location |
---|
135 | global qt_moc_cmd |
---|
136 | set qt_moc_cmd ${qt_dir}/bin/moc |
---|
137 | |
---|
138 | # standard uic command location |
---|
139 | global qt_uic_cmd |
---|
140 | set qt_uic_cmd ${qt_dir}/bin/uic |
---|
141 | |
---|
142 | # standard lrelease command location |
---|
143 | global qt_lrelease_cmd |
---|
144 | set qt_lrelease_cmd ${qt_dir}/bin/lrelease |
---|
145 | |
---|
146 | # standard PKGCONFIG path |
---|
147 | global qt_pkg_config_dir |
---|
148 | set 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 |
---|
154 | global qt_qmake_spe |
---|
155 | global qt_qmake_spec_32 |
---|
156 | global qt_qmake_spec_64 |
---|
157 | compiler.whitelist clang |
---|
158 | |
---|
159 | set qt_qmake_spec_32 macx-clang-32 |
---|
160 | set qt_qmake_spec_64 macx-clang |
---|
161 | |
---|
162 | if { ![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 | if {![info exists building_qt5]} { |
---|
181 | depends_lib-append port:qt5-qtbase |
---|
182 | } |
---|
183 | |
---|
184 | # standard configure environment, when not building qt5 |
---|
185 | |
---|
186 | if {![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 |
---|
222 | depends_build-append port:pkgconfig |
---|
223 | |
---|
224 | # standard destroot environment |
---|
225 | if { ![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 | #} |
---|