source: trunk/dports/_resources/port1.0/group/wxWidgets-1.0.tcl @ 146156

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

wxWidgets-1.0.tcl: add wxWidgets-3.0-devel, document the PortGroup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.2 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: wxWidgets-1.0.tcl 146156 2016-03-01 12:40:44Z mojca@macports.org $
3
4# This PortGroup is to be used with all projects that depend on wxWidgets
5# (including some that need wxPython).
6#
7# Usage:
8#
9# After the PortSystem 1.0 line, put:
10#
11#   PortGroup           wxWidgets 1.0
12#
13# Then, assuming that the port needs wxWidgets 3.0, use
14#
15#   wxWidgets.use       wxWidgets-3.0
16#
17# to specify the version/variant of wxWidgets.
18#
19# Valid options for wxWidgets.use are as follows:
20#
21# * 'wxWidgets-3.0'
22#   You should generally use this one unless there are valid reasons for
23#   a different choice.
24#
25# * 'wxPython-3.0'
26#   This is almost the same as 'wxWidgets-3.0' except that a separate
27#   instance of wxWidgets was made available for cases when wxPython
28#   releases lag behind the wxWidgets releases.
29#   You should only use this option for ports that need both wxPython
30#   (usually py27-wxpython) as well as require linking of C++ code against
31#   wxWidgets via the usual ./configure && make. Using 'wxPython-3.0'
32#   avoids any version mismatches between wxPython and wxWidgets.
33#
34# * 'wxWidgets-2.8' or 'wxGTK-2.8'
35#   For projects that are still not fully compatible with wxWidgets 3.0
36#   (even though we strongly encourage you to try to make the package work
37#   with wxWidgets 3.0 instead).
38#   'wxWidgets-2.8' requires Carbon and can only be compiled as 32-bit app
39#   against MacOSX10.6.sdk or earlier. It gives a native look and feel and
40#   might be preferred to wxGTK on systems where it works.
41#   'wxGTK-2.8' should work on modern systems as well, but depends on X11.
42#
43# * 'wxGTK-3.0'
44#   Mainly for testing purposes. wxGTK 3.0 currently uses GTK 3 (and could
45#   be compiled against quartz if desired). Many programs make assumptions
46#   that GTK != Mac, some programs work with wxGTK, but not with wxOSX.
47#   This could help you write proper patches and submit them upstream.
48#
49# * 'wxWidgets-3.0-libcxx'
50#   A workaround to make software written in C++11 (but without other C++
51#   dependencies) work on OS X < 10.9. This is just wxWidgets 3.0
52#   compiled against libc++ even where libstdc++ is default. See also
53#   https://trac.macports.org/wiki/LibcxxOnOlderSystems
54#
55# * 'wxWidgets-3.0-devel'
56#   Tracking latest commits from the 3.0 branch for development purposes.
57#   (This variant will be removed at some point, so try not to rely on its
58#   existence.)
59#
60# * 'wxWidgets-3.2'
61#   At the moment still mainly for development purposes, for testing ports
62#   for compatibility with wxWidgets 3.1/3.2.
63#   It uses wxWidgets 3.1 at the moment, but will switch to wxWidgets 3.2
64#   after the first release of version 3.2 becomes available.
65#   If you already want to provide a special variant for your port with
66#   'wxWidgtes-3.2', you might only need a revbump after the switch to 3.2
67#
68#
69# You should note an important aspect of 'wxWidgets.use' though:
70# it does not actually do anything useful yet other than failing during
71# the 'pre-fetch' phase in case your OS is not compatible with the choice.
72#
73# To actually use wxWidgets, you need at least two additional steps:
74#
75# * add a dependency with
76#   depends_lib[-append] port:${wxWidgets.port}
77#
78# * add the appropriate configure flags
79#   (depending on the project configuration/requirements)
80#
81# For adding appropirate configure flags you can you use any of the
82# following variables:
83#
84# * wxWidgets.prefix
85# * wxWidgets.wxdir
86# * wxWidgets.wxconfig
87# * wxWidgets.wxrc
88#
89# Examples of their typical values are:
90#
91# * wxWidgets.prefix (PATH)
92#   /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0
93#
94# * wxWidgets.wxdir (PATH)
95#   /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin
96#
97# * wxWidgets.wxconfig (SHELL SCRIPT)
98#   /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wx-config
99#
100# * wxWidgets.wxrc (BINARY)
101#   /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wxrc
102#
103#
104# You should study your port's build scripts to figure out the proper
105# configuration flag. A typical configure-based build would work with:
106#
107#   configure.args[-append] \
108#       --with-wxdir=${wxWidgets.wxdir}
109#
110# and equally well with either one of the following:
111#
112#       --with-wx-config=${wxWidgets.wxconfig}
113#       --with-wx-prefix=${wxWidgets.prefix}
114#
115# A CMake-based installation could require
116#
117#   configure.args-append \
118#       -DwxWidgets_CONFIG_EXECUTABLE=${wxWidgets.wxconfig}
119#
120# and/or:
121#
122#       -DwxWidgets_wxrc_EXECUTABLE=${wxWidgets.wxrc}
123#
124# Sometimes enviromental variables are required, like:
125#
126#   configure.env[-append] \
127#       WX_CONFIG=${wxWidgets.wxconfig}
128#
129# and/or:
130#
131#       WXRC=${wxWidgets.wxrc}
132#
133# But you should always check the build documentation.
134#
135#
136# You are strongly encouraged not to use any hardcoded values
137# (not even for the port name)
138# to minimize problems in case the layout changes in the future.
139# If you switch to a different version of wxWidgets it would also be
140# sufficient to change one single line line with 'wxWidgets.use <name>'.
141
142options     wxWidgets.name
143options     wxWidgets.port
144options     wxWidgets.version
145options     wxWidgets.prefix
146
147options     wxWidgets.wxdir
148options     wxWidgets.wxconfig
149options     wxWidgets.wxrc
150
151options     wxWidgets.sdk
152options     wxWidgets.macosx_version_min
153
154# set to empty
155wxWidgets.name
156wxWidgets.port
157wxWidgets.version
158wxWidgets.prefix
159wxWidgets.wxdir
160wxWidgets.wxconfig
161wxWidgets.wxrc
162wxWidgets.sdk
163wxWidgets.macosx_version_min
164
165options     wxWidgets.use
166option_proc wxWidgets.use wxWidgets._set
167
168## TODO: it would be nice to make the changes reversible
169##
170## parameters:
171## - wxWidgets-2.8
172## - wxGTK-2.8
173## - wxWidgets-3.0
174## - wxGTK-3.0
175## - wxPython-3.0
176## - wxWidgets-3.0-libcxx
177## - wxWidgets-3.0-devel
178## - wxWidgets-3.2
179proc wxWidgets._set {option action args} {
180    global prefix frameworks_dir os.major
181    global wxWidgets.name wxWidgets.version wxWidgets.prefix wxWidgets.wxdir
182    if {"set" ne ${action}} {
183        return
184    }
185
186    if {${args} eq "wxWidgets-2.8"} {
187        wxWidgets.name      "wxWidgets"
188        wxWidgets.version   "2.8"
189        wxWidgets.port      "wxWidgets-2.8"
190
191        # wxWidgets is not universal and is 32-bit only
192        universal_variant   no
193        supported_archs     i386 ppc
194
195        # wxWidgets-2.8 fails to build with clang
196        compiler.blacklist  *clang*
197
198        pre-fetch {
199            # 10.8 (or later) -or- 10.7 with Xcode 4.4 (or later)
200            if {${os.major} >= 12 || [vercmp $xcodeversion 4.4] >= 0} {
201                ui_error "${wxWidgets.port} cannot be built on Moc OS X >= 10.7 with Xcode >= 4.4, please use port wxWidgets-3.0 or wxgtk-2.8 instead"
202                return -code return "wxWidgets-2.8 cannot be built on Moc OS X >= 10.7 with Xcode >= 4.4, please use port wxWidgets-3.0 or wxgtk-2.8 instead"
203            } else {
204                # 10.7
205                if {${os.major} == 11} {
206                    if {[vercmp $xcodeversion 4.3] < 0} {
207                        set sdks_dir "${developer_dir}/SDKs"
208                    } else {
209                        set sdks_dir "${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs"
210                    }
211                    wxWidgets.sdk "${sdks_dir}/MacOSX10.6.sdk"
212                    wxWidgets.macosx_version_min "10.6"
213                }
214            }
215        }
216    } elseif {${args} eq "wxGTK-2.8"} {
217        wxWidgets.name      "wxGTK"
218        wxWidgets.version   "2.8"
219        wxWidgets.port      "wxgtk-2.8"
220    } elseif {${args} eq "wxGTK-3.0"} {
221        wxWidgets.name      "wxGTK"
222        wxWidgets.version   "3.0"
223        wxWidgets.port      "wxgtk-3.0"
224    } elseif {${args} eq "wxWidgets-3.0"} {
225        wxWidgets.name      "wxWidgets"
226        wxWidgets.version   "3.0"
227        wxWidgets.port      "wxWidgets-3.0"
228        if {${os.major} < 9} {
229            pre-fetch {
230                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
231                return -code error "incompatible Mac OS X version"
232            }
233        }
234    } elseif {${args} eq "wxPython-3.0"} {
235        wxWidgets.name      "wxPython"
236        wxWidgets.version   "3.0"
237        wxWidgets.port      "wxPython-3.0"
238        if {${os.major} < 9} {
239            pre-fetch {
240                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
241                return -code error "incompatible Mac OS X version"
242            }
243        }
244    # ugly workaround to allow some C++11-only applications to be built on < 10.9
245    } elseif {${args} eq "wxWidgets-3.0-libcxx"} {
246        wxWidgets.name      "wxWidgets"
247        wxWidgets.version   "3.0-libcxx"
248        wxWidgets.port      "wxWidgets-3.0-libcxx"
249        if {${os.major} < 9} {
250            pre-fetch {
251                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
252                return -code error "incompatible Mac OS X version"
253            }
254        }
255    # temporary development version of wxWidgets 3.0.x
256    } elseif {${args} eq "wxWidgets-3.0-devel"} {
257        wxWidgets.name      "wxWidgets"
258        wxWidgets.version   "3.0-devel"
259        wxWidgets.port      "wxWidgets-3.0-devel"
260        if {${os.major} < 9} {
261            pre-fetch {
262                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
263                return -code error "incompatible Mac OS X version"
264            }
265        }
266    # preliminary support for wxWidgets 3.1/3.2
267    } elseif {${args} eq "wxWidgets-3.2"} {
268        wxWidgets.name      "wxWidgets"
269        wxWidgets.version   "3.1"
270        wxWidgets.port      "wxWidgets-3.1"
271        if {${os.major} < 9} {
272            pre-fetch {
273                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
274                return -code error "incompatible Mac OS X version"
275            }
276        }
277    } else {
278        # throw an error
279        ui_error "invalid parameter for wxWidgets.use; use one of:\n\twxWidgets-2.8/wxGTK-2.8/wxWidgets-3.0/wxGTK-3.0/wxPython-3.0/wxWidgets-3.2"
280        # wxWidgets-3.0-libcxx, wxWidgets-3.0-devel
281        return -code return "invalid parameter for wxWidgets.use"
282    }
283    wxWidgets.prefix    ${frameworks_dir}/wxWidgets.framework/Versions/${wxWidgets.name}/${wxWidgets.version}
284
285    wxWidgets.wxdir     ${wxWidgets.prefix}/bin
286    wxWidgets.wxconfig  ${wxWidgets.wxdir}/wx-config
287    wxWidgets.wxrc      ${wxWidgets.wxdir}/wxrc
288}
Note: See TracBrowser for help on using the repository browser.