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: Portfile 109243 2013-08-11 11:49:49Z mojca@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup active_variants 1.1 |
---|
6 | PortGroup archcheck 1.0 |
---|
7 | PortGroup select 1.0 |
---|
8 | |
---|
9 | name wxWidgets-2.8 |
---|
10 | # temporary conflict to prevent wrong linking |
---|
11 | conflicts wxgtk wxWidgets wxWidgets-python wxWidgets30 wxWidgets-devel |
---|
12 | version 2.8.12 |
---|
13 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
14 | |
---|
15 | categories graphics devel |
---|
16 | platforms darwin |
---|
17 | license LGPL-2+ |
---|
18 | maintainers jwa mojca |
---|
19 | |
---|
20 | description mature cross-platform C++ GUI framework |
---|
21 | long_description wxWidgets is a mature open-source cross-platform C++ \ |
---|
22 | GUI framework for Mac OS, Unix, Linux, Windows. It can \ |
---|
23 | make use of a variety of native widget sets as well as \ |
---|
24 | its own widget set: Mac OS, GTK+, Motif, WIN32. \ |
---|
25 | wxWidgets will even run on embedded systems using \ |
---|
26 | Linux and X11. |
---|
27 | |
---|
28 | homepage http://www.wxwidgets.org/ |
---|
29 | distname wxWidgets |
---|
30 | master_sites sourceforge:wxwindows \ |
---|
31 | http://biolpc22.york.ac.uk/pub/${version}/ |
---|
32 | |
---|
33 | use_bzip2 yes |
---|
34 | |
---|
35 | distfiles ${distname}-${version}${extract.suffix} |
---|
36 | dist_subdir ${distname}/${version} |
---|
37 | |
---|
38 | checksums rmd160 928e221abe1a00cd2d72d2a4fd3640ba639b9915 \ |
---|
39 | sha256 3b0ac1d2d017683851841501c8e1b744b97242d684a1668ded61809b0504f707 |
---|
40 | |
---|
41 | # TODO: put this into PortGroup |
---|
42 | # TODO: create a subport wxGTK-2.8 in addition to wxWidgets-2.8 and put it under |
---|
43 | # ${frameworks_dir}/wxWidgets.framework/Versions/wxGTK/${branch} |
---|
44 | set installdir ${frameworks_dir}/wxWidgets.framework/Versions/${distname}/${branch} |
---|
45 | |
---|
46 | depends_lib port:jpeg \ |
---|
47 | port:tiff \ |
---|
48 | port:libpng \ |
---|
49 | port:zlib \ |
---|
50 | port:libiconv \ |
---|
51 | port:expat |
---|
52 | |
---|
53 | depends_run port:wxWidgets_select |
---|
54 | |
---|
55 | select.group wxWidgets |
---|
56 | select.file ${filespath}/${name} |
---|
57 | |
---|
58 | archcheck.files lib/libjpeg.dylib \ |
---|
59 | lib/libtiff.dylib \ |
---|
60 | lib/libpng.dylib \ |
---|
61 | lib/libz.dylib \ |
---|
62 | lib/libiconv.dylib \ |
---|
63 | lib/libexpat.dylib |
---|
64 | |
---|
65 | set worksrcdir ${distname}-${version}/build |
---|
66 | |
---|
67 | patchfiles patch-chkconf.diff \ |
---|
68 | patch-configure.diff |
---|
69 | patch.dir ${workpath}/${distname}-${version} |
---|
70 | |
---|
71 | post-patch { |
---|
72 | reinplace "s|@@ARCHS@@|[get_canonical_archflags]|g" ${workpath}/${distname}-${version}/configure |
---|
73 | reinplace "s|@@PREFIX@@|${prefix}|g" ${workpath}/${distname}-${version}/configure |
---|
74 | } |
---|
75 | |
---|
76 | compiler.blacklist clang |
---|
77 | |
---|
78 | set contrib "gizmos stc ogl" |
---|
79 | set installtype release |
---|
80 | |
---|
81 | # SDK |
---|
82 | set conf_sdk "no" |
---|
83 | set conf_macosx_version_min "no" |
---|
84 | pre-fetch { |
---|
85 | if {[variant_isset carbon]} { |
---|
86 | # 10.8 (or later) -or- 10.7 with Xcode 4.4 (or later) |
---|
87 | if {${os.major} >= 12 || [vercmp $xcodeversion 4.4] >= 0} { |
---|
88 | return -code return "${name} cannot be built on Moc OS X >= 10.7 with Xcode >= 4.4, please use port ${distname}-3.0 instead" |
---|
89 | } else { |
---|
90 | # 10.7 |
---|
91 | if {${os.major} == 11} { |
---|
92 | if {[vercmp $xcodeversion 4.3] < 0} { |
---|
93 | set sdks_dir "${developer_dir}/SDKs" |
---|
94 | } else { |
---|
95 | set sdks_dir "${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs" |
---|
96 | } |
---|
97 | set conf_sdk "${sdks_dir}/MacOSX10.6.sdk" |
---|
98 | set conf_macosx_version_min "10.6" |
---|
99 | } |
---|
100 | } |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | configure.cmd ../configure |
---|
105 | configure.args --prefix=${installdir} \ |
---|
106 | --with-libiconv-prefix=${prefix} \ |
---|
107 | --with-libjpeg \ |
---|
108 | --with-libtiff \ |
---|
109 | --with-libpng \ |
---|
110 | --with-zlib \ |
---|
111 | --with-opengl \ |
---|
112 | --without-sdl \ |
---|
113 | --disable-sdltest \ |
---|
114 | --enable-unicode \ |
---|
115 | --enable-display \ |
---|
116 | --enable-graphics_ctx \ |
---|
117 | --with-macosx-sdk=${conf_sdk} \ |
---|
118 | --with-macosx-version-min=${conf_macosx_version_min} \ |
---|
119 | --enable-universal_binary |
---|
120 | |
---|
121 | post-build { |
---|
122 | foreach c { ${contrib} } { |
---|
123 | system "cd ${build.dir} && make -C contrib/src/${c}" |
---|
124 | } |
---|
125 | } |
---|
126 | |
---|
127 | post-destroot { |
---|
128 | foreach c { ${contrib} } { |
---|
129 | system "cd ${build.dir} && make -C contrib/src/${c} install ${destroot.destdir}" |
---|
130 | } |
---|
131 | |
---|
132 | set destdocdir ${destroot}${prefix}/share/doc/${distname}/${branch} |
---|
133 | xinstall -d -m 755 ${destdocdir} |
---|
134 | xinstall -m 644 -W ${workpath}/${distname}-${version} \ |
---|
135 | install-mac.txt install-mgl.txt install-motif.txt \ |
---|
136 | INSTALL-OS2.txt install-x11.txt readme-cocoa.txt \ |
---|
137 | readme-gtk.txt readme-mac.txt \ |
---|
138 | readme-mgl.txt readme-motif.txt readme-x11.txt \ |
---|
139 | ${destdocdir} |
---|
140 | set confscript ${installdir}/lib/wx/config/mac-unicode-${installtype}-2.8 |
---|
141 | ln -sf ${confscript} ${destroot}${installdir}/bin/wx-config |
---|
142 | } |
---|
143 | |
---|
144 | variant carbon conflicts gtk x11 quartz description {} { |
---|
145 | supported_archs i386 ppc |
---|
146 | use_parallel_build no |
---|
147 | configure.args-append --with-mac |
---|
148 | } |
---|
149 | variant gtk conflicts carbon description {} { |
---|
150 | depends_lib-append port:cairo \ |
---|
151 | port:gtk2 |
---|
152 | # TODO: try to make sdl work |
---|
153 | # path:lib/pkgconfig/sdl.pc:libsdl \ |
---|
154 | # port:libsdl_mixer |
---|
155 | #configure.args-delete --without-sdl |
---|
156 | configure.args-append --with-gtk |
---|
157 | } |
---|
158 | variant x11 requires gtk conflicts carbon quartz description {} { |
---|
159 | # TODO: not sure about freeglut |
---|
160 | depends_lib-append port:mesa \ |
---|
161 | port:freeglut |
---|
162 | |
---|
163 | require_active_variants cairo x11 |
---|
164 | require_active_variants gtk2 x11 |
---|
165 | } |
---|
166 | variant quartz requires gtk conflicts carbon x11 description {} { |
---|
167 | # TODO: doesn't work |
---|
168 | require_active_variants cairo quartz |
---|
169 | require_active_variants gtk2 quartz |
---|
170 | } |
---|
171 | |
---|
172 | variant aui description {add support for AUI docking library} { |
---|
173 | configure.args-append --enable-aui |
---|
174 | } |
---|
175 | |
---|
176 | variant monolithic description {build only one library} { |
---|
177 | configure.args-append --enable-monolithic |
---|
178 | } |
---|
179 | |
---|
180 | variant debug description {add debug info to libraries} { |
---|
181 | configure.args-append --enable-debug |
---|
182 | set installtype debug |
---|
183 | } |
---|
184 | |
---|
185 | if {![variant_isset carbon] && ![variant_isset gtk] && ![variant_isset x11] && ![variant_isset quartz]} { |
---|
186 | default_variants +carbon |
---|
187 | } |
---|
188 | |
---|
189 | livecheck.type regex |
---|
190 | livecheck.url ${homepage}/downloads/ |
---|
191 | livecheck.regex Current Stable Release.*(2\\.\[0-9\]\\.\[0-9\]+) |
---|