source: trunk/dports/graphics/wxWidgets-3.0/Portfile

Last change on this file was 152616, checked in by mojca@…, 14 months ago

wxWidgets-3.0: remove QuickTime loading on Sierra (closes #52069)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.7 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: Portfile 152616 2016-09-13 08:50:59Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           select          1.0
7PortGroup           wxWidgets       1.0
8PortGroup           compiler_blacklist_versions 1.0
9
10name                wxWidgets-3.0
11# ugly workaround to allow some C++11-only applications to be built on < 10.9
12subport             wxWidgets-3.0-libcxx {}
13# for cases when wxPython gets out of sync with wxWidgets releases
14subport             wxPython-3.0 {}
15# build against GTK 3
16subport             wxgtk-3.0 {}
17# TODO: fix dist_subdir at next release
18version             3.0.2
19revision            4
20set wxpython_ver    3.0.2.0
21# when revbumping remember to change the revision also for wxPython-3.0
22
23set installname     wxWidgets
24set wxtype          osx_cocoa
25
26if {${subport} eq ${name}} {
27    wxWidgets.use   wxWidgets-3.0
28} elseif {${subport} eq "wxWidgets-3.0-libcxx"} {
29    # ugly workaround to allow some C++11-only applications to be built on < 10.9
30    wxWidgets.use   wxWidgets-3.0-libcxx
31} elseif {${subport} eq "wxPython-3.0"} {
32    wxWidgets.use   wxPython-3.0
33    version         3.0.2
34    revision        5
35} elseif {${subport} eq "wxgtk-3.0"} {
36    # with satisfactory Cocoa support there is no real need for GTK-based wxWidgets any more
37    # wxgtk-3.0 is here mainly for testing purposes
38    # it might be useful to report GTK-related bugs upstream
39    # and play with quartz-based GTK
40    # (and maybe backport changes to 2.8)
41    wxWidgets.use   wxGTK-3.0
42    set installname wxGTK
43    set wxtype      gtk3
44}
45set branch          [join [lrange [split ${version} .] 0 1] .]
46
47categories          graphics devel
48platforms           darwin
49license             wxwidgets-3.1
50maintainers         jwa mojca
51
52description         C++ framework for cross-platform GUI development
53long_description    wxWidgets ${branch} is an open-source cross-platform C++ \
54                    GUI framework for Mac OS, Unix, Linux, Windows.
55
56homepage            http://www.wxwidgets.org/
57distname            wxWidgets
58master_sites        sourceforge:project/wxwindows/${version} \
59                    http://biolpc22.york.ac.uk/pub/${version}/ \
60                    http://trac.macports.org/raw-attachment/ticket/19190/:trac
61
62use_bzip2           yes
63
64distfiles           ${distname}-${version}${extract.suffix}
65
66checksums           ${distname}-${version}${extract.suffix} \
67                    rmd160  a7f404c8a64ca68fa31e408bded4387c2722196b \
68                    sha256  346879dc554f3ab8d6da2704f651ecb504a22e9d31c17ef5449b129ed711585d
69
70# remove _1 at the end with the next proper version
71dist_subdir         wxWidgets/${version}_1
72worksrcdir          ${distname}-${version}/build
73patch.dir           ${worksrcpath}/..
74
75set selectdir       ${workpath}/select
76select.group        wxWidgets
77select.file         ${selectdir}/${subport}
78
79depends_lib         port:jpeg \
80                    port:tiff \
81                    port:libpng \
82                    port:zlib \
83                    port:libiconv \
84                    port:expat
85
86depends_run         port:wxWidgets-common \
87                    port:wxWidgets_select
88
89patchfiles-append   patch-configure.diff \
90                    patch-upstream-src-osx-carbon-fontdlgosx.mm.diff \
91                    patch-upstream-webkit-proper-types.diff
92
93if {${subport} eq "wxWidgets-3.0-libcxx"} {
94    platform darwin {
95        compiler.blacklist-append   *gcc* {clang < 300}
96        depends_lib-append          port:libcxx
97        configure.cxxflags-append   -std=c++11
98        configure.cxx_stdlib        libc++
99    }
100}
101
102post-patch {
103    reinplace "s|@@PREFIX@@|${prefix}|g" ${patch.dir}/configure
104
105    file mkdir ${selectdir}
106    system "echo \"${wxWidgets.wxdir}/wx-config\n${wxWidgets.wxdir}/wxrc-${branch}\" > ${select.file}"
107}
108
109configure.cmd       ../configure
110configure.args      --prefix=${wxWidgets.prefix} \
111                    --with-libiconv-prefix=${prefix} \
112                    --with-libjpeg \
113                    --with-libtiff \
114                    --with-libpng \
115                    --with-zlib \
116                    --with-opengl \
117                    --with-cocoa \
118                    --without-sdl \
119                    --enable-aui \
120                    --disable-sdltest \
121                    --enable-unicode \
122                    --enable-display \
123                    --enable-xrc \
124                    --enable-graphics_ctx \
125                    --with-macosx-sdk=no \
126                    --with-macosx-version-min=no
127if {[string match *clang* ${configure.cxx}]} {
128    configure.ldflags-append \
129                    -stdlib=${configure.cxx_stdlib}
130}
131# https://trac.macports.org/ticket/52069
132if {${os.platform} eq "darwin" && ${os.major} >= 16} {
133    # The patch probably works on all OS X versions,
134    # but I don't want to risk breaking anything
135    patchfiles-append \
136                    patch-upstream-noquicktime.diff
137    # the sources should be patched,
138    # but this should work as a temporary workaround for Sierra users
139    configure.args-append \
140                    --disable-mediactrl
141}
142
143if {${subport} eq "wxPython-3.0"} {
144# drop _1 from the subset name on next update
145    set wxpythonsubset      wxPython-${wxpython_ver}_1-MacPorts-subset
146    distfiles-append        ${wxpythonsubset}${extract.suffix}:trac
147
148    description             wxWidgets ${branch} for the wxPython distribution
149    long_description        The port installs wxWidgets ${branch} for wxPython \
150                            to guarantee compatibility even when the upstream versions \
151                            of wxWidgets and wxPython differ.
152
153    checksums               ${distname}-${version}${extract.suffix} \
154                            rmd160  a7f404c8a64ca68fa31e408bded4387c2722196b \
155                            sha256  346879dc554f3ab8d6da2704f651ecb504a22e9d31c17ef5449b129ed711585d
156
157    checksums-append        ${wxpythonsubset}${extract.suffix} \
158                            rmd160  09280fd9ad1670162e38719e0055de5e6ddbc059 \
159                            sha256  bc886064820ac90997e10623a591e26ee8b08d73711e8d6d0512eaaffb5e9362
160
161    post-destroot {
162        # copy a subset of wxPython to wxWidgets to prevent a conflict
163        # between py2X-wxpython-3.0 and py2Y-wxpython-3.0
164        copy ${workpath}/wxPython ${destroot}${wxWidgets.prefix}/include/wx-${branch}/wx/
165    }
166
167    livecheck.type          none
168} elseif {${subport} eq "wxgtk-3.0"} {
169    # patch could be added to wxWidgets-3.0, but it is not needed for Cocoa
170    #
171    # patch-sdl.diff: the patch allows using --with-sdl
172    # patch-gtk-quartz.diff: avoid build failure for wxgtk3 +quartz (the patch is not yet complete)
173    patchfiles-append       patch-sdl.diff \
174                            patch-gtk-quartz.diff
175
176    depends_build-append    port:pkgconfig
177    depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo \
178                            port:libsdl \
179                            port:libsdl_mixer
180
181    configure.args-delete   --with-cocoa \
182                            --without-sdl
183    configure.args-append   --with-sdl
184
185    #variant gtk2 conflicts gtk3 description {} {
186    #    depends_lib-append      port:gtk2
187    #    configure.args-append   --with-gtk=2
188    #    set wxtype              gtk2
189    #}
190    #variant gtk3 conflicts gtk2 description {} {
191        depends_lib-append      port:gtk3
192        configure.args-append   --with-gtk=3
193    #}
194    variant quartz conflicts x11 description "(Doesn't work properly yet)" {
195       require_active_variants path:lib/pkgconfig/cairo.pc:cairo quartz
196       require_active_variants gtk3 quartz
197    }
198    variant x11 conflicts quartz {
199        depends_lib-append  port:mesa port:libGLU
200        require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
201        require_active_variants gtk3 x11
202    }
203    #if{![variant_isset gtk2] && ![variant_isset gtk3]} {
204    #    default_variants-append +gtk3
205    #}
206    if {![variant_isset quartz] && ![variant_isset x11]} {
207    #   if {[active_variants gtk3 quartz ""]} {
208    #       default_variants-append +quartz
209    #   } else {
210            default_variants-append +x11
211    #   }
212    }
213    #if{[variant_isset gtk2]} {
214    #    if{[variant_isset quartz]} {
215    #        require_active_variants gtk2 quartz
216    #    } else {
217    #        require_active_variants gtk2 x11
218    #    }
219    #} else {
220    #    if{[variant_isset quartz]} {
221    #        require_active_variants gtk3 quartz
222    #    } else {
223    #        require_active_variants gtk3 x11
224    #    }
225    #}
226}
227
228post-destroot {
229    set confscript ${wxWidgets.prefix}/lib/wx/config/${wxtype}-unicode-${branch}
230    ln -sf ${confscript} ${destroot}${wxWidgets.prefix}/bin/wx-config
231}
232
233variant universal {
234    set archs [join ${configure.universal_archs} ,]
235    # --disable-precomp-headers is automatically selected with cocoa, but not with gtk
236    # http://trac.wxwidgets.org/ticket/15454
237    configure.args-append   --enable-universal_binary=${archs} \
238                            --disable-precomp-headers
239}
240
241variant monolithic description {build only one library} {
242    configure.args-append   --enable-monolithic
243}
244
245variant debug description {add debug info to libraries} {
246    configure.args-append   --enable-debug
247}
248
249variant stdlib description {add support for various standard library features} {
250    configure.args-append   --enable-stl \
251                            --enable-std_containers \
252                            --enable-std_iostreams \
253                            --enable-std_string \
254                            --enable-std_string_conv_in_wxstring
255}
256
257if {${subport} eq ${name}} {
258    livecheck.type  regex
259    livecheck.url   ${homepage}/downloads/
260    livecheck.regex Release.*(3\\.0\\.\[0-9\]+)
261} else {
262    livecheck.type  none
263}
Note: See TracBrowser for help on using the repository browser.