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

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

wxWidgets-1.0.tcl: remove wxPerl and change order in if-else (cosmetic change)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 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 146155 2016-03-01 12:39:48Z mojca@macports.org $
3
4options     wxWidgets.name
5options     wxWidgets.port
6options     wxWidgets.version
7options     wxWidgets.prefix
8
9options     wxWidgets.wxdir
10options     wxWidgets.wxconfig
11options     wxWidgets.wxrc
12
13options     wxWidgets.sdk
14options     wxWidgets.macosx_version_min
15
16# set to empty
17wxWidgets.name
18wxWidgets.port
19wxWidgets.version
20wxWidgets.prefix
21wxWidgets.wxdir
22wxWidgets.wxconfig
23wxWidgets.wxrc
24wxWidgets.sdk
25wxWidgets.macosx_version_min
26
27options     wxWidgets.use
28option_proc wxWidgets.use wxWidgets._set
29
30## TODO:
31## If the need for this ever arises ...
32##
33## This parameter could be set for every port and could be useful on Tiger
34## to switch to 2.8 automatically even when 3.0 is the default elsewhere
35## or to provent using 3.0 for ports that don't support this
36##
37## With proper implementation wxWidgets.use should only be needed in Portfile
38## in special cases (when a specific port wants to support multiple wxWidgets versions)
39#
40# options     wxWidgets.supported_versions
41# option_proc wxWidgets.supported_versions wxWidgets._set_supported_versions
42# proc wxWidgets._set_supported_versions {option action args} {}
43
44## TODO: it would be nice to make the changes reversible
45##
46## parameters: "wxWidgets-2.8" "wxGTK-2.8" "wxWidgets-3.0" "wxGTK-3.0" "wxPython-3.0"
47proc wxWidgets._set {option action args} {
48    global prefix frameworks_dir os.major
49    global wxWidgets.name wxWidgets.version wxWidgets.prefix wxWidgets.wxdir
50    if {"set" ne ${action}} {
51        return
52    }
53
54    if {${args} eq "wxWidgets-2.8"} {
55        wxWidgets.name      "wxWidgets"
56        wxWidgets.version   "2.8"
57        wxWidgets.port      "wxWidgets-2.8"
58
59        # wxWidgets is not universal and is 32-bit only
60        universal_variant   no
61        supported_archs     i386 ppc
62
63        # wxWidgets-2.8 fails to build with clang
64        compiler.blacklist  *clang*
65
66        pre-fetch {
67            # 10.8 (or later) -or- 10.7 with Xcode 4.4 (or later)
68            if {${os.major} >= 12 || [vercmp $xcodeversion 4.4] >= 0} {
69                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"
70                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"
71            } else {
72                # 10.7
73                if {${os.major} == 11} {
74                    if {[vercmp $xcodeversion 4.3] < 0} {
75                        set sdks_dir "${developer_dir}/SDKs"
76                    } else {
77                        set sdks_dir "${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs"
78                    }
79                    wxWidgets.sdk "${sdks_dir}/MacOSX10.6.sdk"
80                    wxWidgets.macosx_version_min "10.6"
81                }
82            }
83        }
84    } elseif {${args} eq "wxGTK-2.8"} {
85        wxWidgets.name      "wxGTK"
86        wxWidgets.version   "2.8"
87        wxWidgets.port      "wxgtk-2.8"
88    } elseif {${args} eq "wxGTK-3.0"} {
89        wxWidgets.name      "wxGTK"
90        wxWidgets.version   "3.0"
91        wxWidgets.port      "wxgtk-3.0"
92    } elseif {${args} eq "wxWidgets-3.0"} {
93        wxWidgets.name      "wxWidgets"
94        wxWidgets.version   "3.0"
95        wxWidgets.port      "wxWidgets-3.0"
96        if {${os.major} < 9} {
97            pre-fetch {
98                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
99                return -code error "incompatible Mac OS X version"
100            }
101        }
102    } elseif {${args} eq "wxPython-3.0"} {
103        wxWidgets.name      "wxPython"
104        wxWidgets.version   "3.0"
105        wxWidgets.port      "wxPython-3.0"
106        if {${os.major} < 9} {
107            pre-fetch {
108                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
109                return -code error "incompatible Mac OS X version"
110            }
111        }
112    # ugly workaround to allow some C++11-only applications to be built on < 10.9
113    } elseif {${args} eq "wxWidgets-3.0-libcxx"} {
114        wxWidgets.name      "wxWidgets"
115        wxWidgets.version   "3.0-libcxx"
116        wxWidgets.port      "wxWidgets-3.0-libcxx"
117        if {${os.major} < 9} {
118            pre-fetch {
119                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
120                return -code error "incompatible Mac OS X version"
121            }
122        }
123    # preliminary support for wxWidgets 3.1/3.2
124    } elseif {${args} eq "wxWidgets-3.2"} {
125        wxWidgets.name      "wxWidgets"
126        wxWidgets.version   "3.1"
127        wxWidgets.port      "wxWidgets-3.1"
128        if {${os.major} < 9} {
129            pre-fetch {
130                ui_error "${wxWidgets.port} requires Mac OS X 10.5 or later."
131                return -code error "incompatible Mac OS X version"
132            }
133        }
134    } else {
135        # throw an error
136        ui_error "invalid parameter for wxWidgets.use; use one of: wxWidgets-2.8/wxGTK-2.8/wxWidgets-3.0/wxGTK-3.0/wxPython-3.0"
137        return -code return "invalid parameter for wxWidgets.use"
138    }
139    wxWidgets.prefix    ${frameworks_dir}/wxWidgets.framework/Versions/${wxWidgets.name}/${wxWidgets.version}
140
141    wxWidgets.wxdir     ${wxWidgets.prefix}/bin
142    wxWidgets.wxconfig  ${wxWidgets.wxdir}/wx-config
143    wxWidgets.wxrc      ${wxWidgets.wxdir}/wxrc
144}
Note: See TracBrowser for help on using the repository browser.