source: trunk/dports/_resources/port1.0/group/qt4-1.0.tcl @ 94241

Last change on this file since 94241 was 94241, checked in by michaelld@…, 7 years ago

qt4-mac : upgrade to 4.8.2; upgrade and fix certain dependent ports.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.7 KB
Line 
1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: qt4-1.0.tcl 94241 2012-06-13 02:36:06Z michaelld@macports.org $
3
4# Copyright (c) 2010 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/QtCore_debug] &&
46                ![file exists ${qt_libs_dir}/libQtCore_debug.dylib]} {
47                return -code error "\n\nERROR:\n\
48In order to install this port as +debug,
49Qt4 must also be installed with +debug.\n"
50            }
51        }
52    }
53}
54
55# standard Qt4 name
56global qt_name
57set qt_name             qt4
58
59# standard install directory
60global qt_dir
61set qt_dir              ${prefix}
62
63# standard Qt documents directory
64global qt_docs_dir
65set qt_docs_dir         ${qt_dir}/share/doc/${qt_name}
66
67# standard Qt plugins directory
68global qt_plugins_dir
69set qt_plugins_dir      ${qt_dir}/share/${qt_name}/plugins
70
71# standard Qt mkspecs directory
72global qt_mkspecs_dir
73set qt_mkspecs_dir      ${qt_dir}/share/${qt_name}/mkspecs
74
75# standard Qt imports directory
76global qt_imports_dir
77set qt_imports_dir      ${qt_dir}/share/${qt_name}/imports
78
79# standard Qt includes directory
80global qt_includes_dir
81set qt_includes_dir     ${qt_dir}/include
82
83# standard Qt libraries directory
84global qt_libs_dir
85set qt_libs_dir         ${qt_dir}/lib
86
87# standard Qt libraries directory
88global qt_frameworks_dir
89set qt_frameworks_dir   ${qt_dir}/Library/Frameworks
90
91# standard Qt non-.app executables directory
92global qt_bins_dir
93set qt_bins_dir         ${qt_dir}/bin
94
95# standard Qt .app executables directory, if created
96global qt_apps_dir
97set qt_apps_dir         ${applications_dir}/Qt4
98
99# standard Qt data directory
100global qt_data_dir
101set qt_data_dir         ${qt_dir}/share/${qt_name}
102
103# standard Qt translations directory
104global qt_translations_dir
105set qt_translations_dir ${qt_dir}/share/${qt_name}/translations
106
107# standard Qt sysconf directory
108global qt_sysconf_dir
109set qt_sysconf_dir      ${qt_dir}/etc/${qt_name}
110
111# standard Qt examples directory
112global qt_examples_dir
113set qt_examples_dir     ${qt_dir}/share/${qt_name}/examples
114
115# standard Qt demos directory
116global qt_demos_dir
117set qt_demos_dir        ${qt_dir}/share/${qt_name}/demos
118
119# standard CMake module directory for Qt-related files
120global qt_cmake_module_dir
121set qt_cmake_module_dir ${qt_dir}/share/cmake/modules
122
123# standard qmake command location
124global qt_qmake_cmd
125set qt_qmake_cmd        ${qt_dir}/bin/qmake
126
127# standard qmake spec
128global qt_qmake_spec
129set qt_qmake_spec       macx-g++
130
131# standard moc command location
132global qt_moc_cmd
133set qt_moc_cmd          ${qt_dir}/bin/moc
134
135# standard uic command location
136global qt_uic_cmd
137set qt_uic_cmd          ${qt_dir}/bin/uic
138
139# standard lrelease command location
140global qt_lrelease_cmd
141set qt_lrelease_cmd     ${qt_dir}/bin/lrelease
142
143# standard PKGCONFIG path
144global qt_pkg_config_dir
145set qt_pkg_config_dir   ${qt_libs_dir}/pkgconfig
146
147# standard cmake info for Qt4
148global qt_cmake_defines
149set qt_cmake_defines    \
150    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
151     -DQT_QMAKESPEC=${qt_qmake_spec} \
152     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
153     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
154
155# set Qt understood arch types, based on user preference
156options qt_arch_types
157default qt_arch_types {[string map {i386 x86} [get_canonical_archs]]}
158
159# allow for depending on either qt4-mac and qt4-mac-devel, simultaneously
160
161if {![info exists building_qt4]} {
162    if {${os.platform} == "darwin"} {
163
164        # see if the framework install exists, and if so depend on it;
165        # if not, depend on the library version
166
167        if {[file exists ${qt_frameworks_dir}/QtCore/QtCore]} {
168            depends_lib-append path:Library/Frameworks/QtCore/QtCore:qt4-mac
169        } else {
170            depends_lib-append path:lib/libQtCore.4.dylib:qt4-mac
171        }
172
173    } else {
174        depends_lib-append      path:lib/libQtCore.so.4:qt4-x11
175    }
176}
177
178# standard configure environment, when not building qt4
179
180if {![info exists building_qt4]} {
181    configure.env-append \
182        QTDIR=${qt_dir} \
183        QMAKE=${qt_qmake_cmd} \
184        QMAKESPEC=${qt_qmake_spec} \
185        MOC=${qt_moc_cmd}
186
187    # make sure the Qt binaries' directory is in the path, if it is
188    # not the current prefix
189
190    if {${qt_dir} != ${prefix}} {
191        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
192    }
193} else {
194    configure.env-append QMAKE_NO_DEFAULTS=""
195}
196
197# standard build environment, when not building qt4
198
199if {![info exists building_qt4]} {
200    build.env-append \
201        QTDIR=${qt_dir} \
202        QMAKE=${qt_qmake_cmd} \
203        QMAKESPEC=${qt_qmake_spec} \
204        MOC=${qt_moc_cmd}
205
206    # make sure the Qt binaries' directory is in the path, if it is
207    # not the current prefix
208
209    if {${qt_dir} != ${prefix}} {
210        build.env-append    PATH=${qt_dir}/bin:$env(PATH)
211    }
212} else {
213    build.env-append QMAKE_NO_DEFAULTS=""
214}
215
216# use PKGCONFIG for Qt discovery in configure scripts
217depends_build-append    port:pkgconfig
218
219# standard destroot environment
220
221destroot.env-append \
222    INSTALL_ROOT=${destroot} \
223    DESTDIR=${destroot}
224
225# standard destroot environment, when not building qt4
226
227if {![info exists building_qt4]} {
228    destroot.env-append \
229        QTDIR=${qt_dir} \
230        QMAKE=${qt_qmake_cmd} \
231        QMAKESPEC=${qt_qmake_spec} \
232        MOC=${qt_moc_cmd}
233
234    # make sure the Qt binaries' directory is in the path, if it is
235    # not the current prefix
236
237    if {${qt_dir} != ${prefix}} {
238        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
239    }
240} else {
241    destroot.env-append QMAKE_NO_DEFAULTS=""
242}
243
244# append Qt's PKGCONFIG path to whatever is there now.
245set qt_pkg_config_path ${qt_pkg_config_dir}
246if {${qt_dir} != ${prefix}} {
247    set qt_pkg_config_path ${pkg_config_path}:${prefix}/lib/pkgconfig
248}
249if {${configure.pkg_config_path} == ""} {
250    configure.pkg_config_path ${qt_pkg_config_path}
251} else {
252    configure.pkg_config_path ${qt_pkg_config_path}:${configure.pkg_config_path}
253}
254unset qt_pkg_config_path
Note: See TracBrowser for help on using the repository browser.