source: trunk/dports/_resources/port1.0/group/qt4-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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
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: qt4-1.0.tcl 144789 2016-01-18 16:15:32Z mcalhoun@macports.org $
3
4# Copyright (c) 2010-2015 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 Qt4.
34#
35# Usage:
36# PortGroup     qt4 1.0
37
38# check for +debug variant of this port, and make sure Qt was
39# installed with +debug as well; if not, error out.
40platform darwin {
41    pre-extract {
42        if {[variant_exists debug] && \
43            [variant_isset debug] && \
44           ![info exists building_qt4]} {
45            if {![file exists ${qt_frameworks_dir}/QtCore.framework/QtCore_debug]} {
46                return -code error "\n\nERROR:\n\
47In order to install this port as +debug,
48Qt4 must also be installed with +debug.\n"
49            }
50        }
51    }
52}
53
54# standard Qt4 name
55global qt_name
56set qt_name             qt4
57
58# standard install directory
59global qt_dir
60set qt_dir              ${prefix}/libexec/qt4
61
62# standard Qt includes directory
63global qt_includes_dir
64set qt_includes_dir     ${qt_dir}/include
65
66# standard Qt libraries directory
67global qt_libs_dir
68set qt_libs_dir         ${qt_dir}/lib
69
70# standard Qt libraries directory
71global qt_frameworks_dir
72set qt_frameworks_dir   ${qt_dir}/Library/Frameworks
73
74# standard Qt non-.app executables directory
75global qt_bins_dir
76set qt_bins_dir         ${qt_dir}/bin
77
78# standard Qt .app executables directory, if created
79global qt_apps_dir
80set qt_apps_dir         ${applications_dir}/Qt4
81
82# standard Qt share directory
83global qt_share_dir
84set qt_share_dir        ${qt_dir}/share
85
86# standard Qt documents directory
87global qt_docs_dir
88if {${qt_dir} ne ${prefix}} {
89    set qt_docs_dir         ${qt_share_dir}/doc
90} else {
91    set qt_docs_dir         ${qt_share_dir}/doc/${qt_name}
92}
93
94# standard Qt plugins directory
95global qt_plugins_dir
96if {${qt_dir} ne ${prefix}} {
97    set qt_plugins_dir      ${qt_share_dir}/plugins
98} else {
99    set qt_plugins_dir      ${qt_share_dir}/${qt_name}/plugins
100}
101
102# standard Qt mkspecs directory
103global qt_mkspecs_dir
104if {${qt_dir} ne ${prefix}} {
105    set qt_mkspecs_dir      ${qt_share_dir}/mkspecs
106} else {
107    set qt_mkspecs_dir      ${qt_share_dir}/${qt_name}/mkspecs
108}
109
110# standard Qt imports directory
111global qt_imports_dir
112if {${qt_dir} ne ${prefix}} {
113    set qt_imports_dir      ${qt_share_dir}/imports
114} else {
115    set qt_imports_dir      ${qt_share_dir}/${qt_name}/imports
116}
117
118# standard Qt data directory
119# Don't append /data. Here be dragons.
120global qt_data_dir
121if {${qt_dir} ne ${prefix}} {
122    set qt_data_dir         ${qt_share_dir}
123} else {
124    set qt_data_dir         ${qt_share_dir}/${qt_name}
125}
126
127# standard Qt translations directory
128global qt_translations_dir
129if {${qt_dir} ne ${prefix}} {
130    set qt_translations_dir ${qt_share_dir}/translations
131} else {
132    set qt_translations_dir ${qt_share_dir}/${qt_name}/translations
133}
134
135# standard Qt sysconf directory
136global qt_sysconf_dir
137if {${qt_dir} ne ${prefix}} {
138    set qt_sysconf_dir      ${qt_share_dir}/sysconf
139} else {
140    set qt_sysconf_dir      ${qt_share_dir}/${qt_name}/sysconf
141}
142
143# standard Qt examples directory
144global qt_examples_dir
145if {${qt_dir} ne ${prefix}} {
146    set qt_examples_dir     ${qt_share_dir}/examples
147} else {
148    set qt_examples_dir     ${qt_share_dir}/${qt_name}/examples
149}
150
151# standard Qt demos directory
152global qt_demos_dir
153if {${qt_dir} ne ${prefix}} {
154    set qt_demos_dir        ${qt_share_dir}/demos
155} else {
156    set qt_demos_dir        ${qt_share_dir}/${qt_name}/demos
157}
158
159# standard CMake module directory for Qt-related files
160global qt_cmake_module_dir
161set qt_cmake_module_dir ${qt_share_dir}/cmake/Modules
162
163# standard qmake command location
164global qt_qmake_cmd
165set qt_qmake_cmd        ${qt_bins_dir}/qmake
166
167# standard qmake spec
168global qt_qmake_spec
169set qt_qmake_spec       macx-g++
170
171# standard moc command location
172global qt_moc_cmd
173set qt_moc_cmd          ${qt_bins_dir}/moc
174
175# standard uic command location
176global qt_uic_cmd
177set qt_uic_cmd          ${qt_bins_dir}/uic
178
179# standard lrelease command location
180global qt_lrelease_cmd
181set qt_lrelease_cmd     ${qt_bins_dir}/lrelease
182
183# standard lupdate command location
184global qt_lupdate_cmd
185set qt_lupdate_cmd     ${qt_dir}/bin/lupdate
186
187# standard PKGCONFIG path
188global qt_pkg_config_dir
189set qt_pkg_config_dir   ${qt_libs_dir}/pkgconfig
190
191# standard cmake info for Qt4
192global qt_cmake_defines
193set qt_cmake_defines    \
194    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
195     -DQT_QMAKESPEC=${qt_qmake_spec} \
196     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
197     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
198
199# set Qt understood arch types, based on user preference
200options qt_arch_types
201default qt_arch_types {[string map {i386 x86} [get_canonical_archs]]}
202
203# allow for depending on either qt4-mac and qt4-mac-devel, simultaneously
204
205if {![info exists building_qt4]} {
206    if {${os.platform} eq "darwin"} {
207
208        # see if the framework install exists, and if so depend on it;
209        # if not, depend on the library version
210
211        if {[file exists ${qt_frameworks_dir}/QtCore/QtCore]} {
212            depends_lib-append path:Library/Frameworks/QtCore/QtCore:qt4-mac
213        } else {
214            depends_lib-append path:lib/libQtCore.4.dylib:qt4-mac
215        }
216
217    } else {
218        depends_lib-append      path:lib/libQtCore.so.4:qt4-x11
219    }
220}
221
222# standard configure environment, when not building qt4
223
224if {![info exists building_qt4]} {
225    configure.env-append \
226        QTDIR=${qt_dir} \
227        QMAKE=${qt_qmake_cmd} \
228        QMAKESPEC=${qt_qmake_spec} \
229        MOC=${qt_moc_cmd}
230
231    # make sure Qt directories are in various paths, if Qt is not
232    # directly installed into ${prefix}
233
234    if {${qt_dir} ne ${prefix}} {
235        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
236        configure.pkg_config_path-append ${qt_pkg_config_dir}
237    }
238} else {
239    configure.env-append QMAKE_NO_DEFAULTS=""
240}
241
242# standard build environment, when not building qt4
243
244if {![info exists building_qt4]} {
245    build.env-append \
246        QTDIR=${qt_dir} \
247        QMAKE=${qt_qmake_cmd} \
248        QMAKESPEC=${qt_qmake_spec} \
249        MOC=${qt_moc_cmd}
250
251    # make sure the Qt binaries' directory is in the path, if it is
252    # not the current prefix
253
254    if {${qt_dir} ne ${prefix}} {
255        build.env-append    PATH=${qt_dir}/bin:$env(PATH)
256    }
257} else {
258    build.env-append QMAKE_NO_DEFAULTS=""
259}
260
261# use PKGCONFIG for Qt discovery in configure scripts
262depends_build-append    port:pkgconfig
263
264# standard destroot environment
265
266destroot.env-append \
267    INSTALL_ROOT=${destroot} \
268    DESTDIR=${destroot}
269
270# standard destroot environment, when not building qt4
271
272if {![info exists building_qt4]} {
273    destroot.env-append \
274        QTDIR=${qt_dir} \
275        QMAKE=${qt_qmake_cmd} \
276        QMAKESPEC=${qt_qmake_spec} \
277        MOC=${qt_moc_cmd}
278
279    # make sure the Qt binaries' directory is in the path, if it is
280    # not the current prefix
281
282    if {${qt_dir} ne ${prefix}} {
283        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
284    }
285} else {
286    destroot.env-append QMAKE_NO_DEFAULTS=""
287}
Note: See TracBrowser for help on using the repository browser.