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

Last change on this file since 115615 was 115615, checked in by cal@…, 5 years ago

add gtk3-devel port at the request of devans, rewrite dependencies to be satisfyable using gtk3-devel, closes #42040

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.6 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 115615 2014-01-07 00:28:17Z cal@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           select          1.0
7PortGroup           wxWidgets       1.0
8
9name                wxWidgets-3.0
10subport             wxPython-3.0 {}
11subport             wxgtk-3.0 {}
12version             3.0.0
13set wxpython_ver    3.0.0.0
14revision            5
15
16set installname     wxWidgets
17set wxtype          osx_cocoa
18
19if {${subport} eq ${name}} {
20    wxWidgets.use   wxWidgets-3.0
21} elseif {${subport} eq "wxPython-3.0"} {
22    wxWidgets.use   wxPython-3.0
23    revision        0
24} elseif {${subport} eq "wxgtk-3.0"} {
25    # with satisfactory Cocoa support there is no real need for GTK-based wxWidgets any more
26    # wxgtk-3.0 is here mainly for testing purposes
27    # it might be useful to report GTK-related bugs upstream
28    # and play with quartz-based GTK
29    # (and maybe backport changes to 2.8)
30    wxWidgets.use   wxGTK-3.0
31    set installname wxGTK
32    set wxtype      gtk3
33}
34set branch          [join [lrange [split ${version} .] 0 1] .]
35
36categories          graphics devel
37platforms           darwin
38license             wxwidgets-3.1
39maintainers         jwa mojca
40
41description         C++ framework for cross-platform GUI development
42long_description    wxWidgets ${branch} is an open-source cross-platform C++ \
43                    GUI framework for Mac OS, Unix, Linux, Windows.
44
45homepage            http://www.wxwidgets.org/
46distname            wxWidgets
47master_sites        sourceforge:project/wxwindows/${version} \
48                    http://biolpc22.york.ac.uk/pub/${version}/ \
49                    http://trac.macports.org/raw-attachment/ticket/19190/:trac
50
51use_bzip2           yes
52
53distfiles           ${distname}-${version}${extract.suffix}
54dist_subdir         ${distname}/${version}
55
56checksums           ${distname}-${version}${extract.suffix} \
57                    rmd160  6113a95125b743309c7b21dd5530f4b675b8b82f \
58                    sha256  ff340539bcb6e45d8dbce848d3c13ebce34da6ffb9004a0a88e9541bec45bf85
59
60depends_lib         port:jpeg \
61                    port:tiff \
62                    port:libpng \
63                    port:zlib \
64                    port:libiconv \
65                    port:expat
66
67depends_run         port:wxWidgets_select
68
69select.group        wxWidgets
70select.file         ${filespath}/${subport}
71
72worksrcdir          ${distname}-${version}/build
73
74patch.dir           ${worksrcpath}/..
75
76patchfiles-append   patch-configure.diff
77
78if {${os.major} >= 10} {
79    # the patch doesn't work on 10.5, but it's still better to have working wxWidgets with a flaw
80    # than not bing able to compile it at all
81    patchfiles-append \
82                    patch-src-osx-cocoa-utils.mm.diff
83}
84
85post-patch {
86    reinplace "s|@@PREFIX@@|${prefix}|g" ${patch.dir}/configure
87}
88
89configure.cmd       ../configure
90configure.args      --prefix=${wxWidgets.prefix} \
91                    --with-libiconv-prefix=${prefix} \
92                    --with-libjpeg \
93                    --with-libtiff \
94                    --with-libpng \
95                    --with-zlib \
96                    --with-opengl \
97                    --with-cocoa \
98                    --without-sdl \
99                    --enable-aui \
100                    --disable-sdltest \
101                    --enable-unicode \
102                    --enable-display \
103                    --enable-xrc \
104                    --enable-graphics_ctx \
105                    --with-macosx-sdk=no \
106                    --with-macosx-version-min=no
107
108if {${subport} eq "wxPython-3.0"} {
109    set wxpythonsubset      wxPython-${wxpython_ver}-MacPorts-subset
110    distfiles-append        ${wxpythonsubset}${extract.suffix}:trac
111
112    description             wxWidgets ${branch} for the wxPython distribution
113    long_description        The port installs wxWidgets ${branch} for wxPython \
114                            to guarantee compatibility even when the upstream versions \
115                            of wxWidgets and wxPython differ.
116
117    checksums-append        ${wxpythonsubset}${extract.suffix} \
118                            rmd160  d3915cf55d6d8244515794ebf2316d151d69ba68 \
119                            sha256  b9377c6917c3a393ab9b190e1d558e4c5b80b13b435b93e11aad748f4d57bf61
120
121    post-destroot {
122        # copy a subset of wxPython to wxWidgets to prevent a conflict
123        # between py2X-wxpython-3.0 and py2Y-wxpython-3.0
124        copy ${workpath}/wxPython ${destroot}${wxWidgets.prefix}/include/wx-${branch}/wx/
125    }
126
127    livecheck.type          none
128} elseif {${subport} eq "wxgtk-3.0"} {
129    # both patches could be added to wxWidgets-3.0, but they are not needed for Cocoa
130    #
131    # patch-sdl.diff: the patch allows using --wxth-sdl
132    patchfiles-append       patch-sdl.diff
133
134    depends_build-append    port:pkgconfig
135    depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo \
136                            port:libsdl \
137                            port:libsdl_mixer
138
139    configure.args-delete   --with-cocoa \
140                            --without-sdl
141    configure.args-append   --with-sdl
142
143    #variant gtk2 conflicts gtk3 description {} {
144    #    depends_lib-append      port:gtk2
145    #    configure.args-append   --with-gtk=2
146    #    set wxtype              gtk2
147    #}
148    #variant gtk3 conflicts gtk2 description {} {
149        depends_lib-append      path:lib/pkgconfig/gtk+-3.0.pc:gtk3
150        configure.args-append   --with-gtk=3
151    #}
152    #variant quartz conflicts x11 {
153    #    require_active_variants path:lib/pkgconfig/cairo.pc:cairo quartz
154    #    require_active_variants gtk3 quartz
155    #}
156    #variant x11 conflicts quartz {
157        depends_lib-append  port:mesa
158        require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
159        require_active_variants gtk3 x11
160    #}
161    #if{![variant_isset gtk2] && ![variant_isset gtk3]} {
162    #    default_variants-append +gtk3
163    #}
164    #if{![variant_isset quartz] && ![variant_isset x11]} {
165    #    default_variants-append +quartz
166    #}
167    #if{[variant_isset gtk2]} {
168    #    if{[variant_isset quartz]} {
169    #        require_active_variants gtk2 quartz
170    #    } else {
171    #        require_active_variants gtk2 x11
172    #    }
173    #} else {
174    #    if{[variant_isset quartz]} {
175    #        require_active_variants gtk3 quartz
176    #    } else {
177    #        require_active_variants gtk3 x11
178    #    }
179    #}
180}
181
182post-destroot {
183    set confscript ${wxWidgets.prefix}/lib/wx/config/${wxtype}-unicode-${branch}
184    ln -sf ${confscript} ${destroot}${wxWidgets.prefix}/bin/wx-config
185    xinstall -m 755 -d ${destroot}${prefix}/share/bakefile/presets
186}
187
188destroot.keepdirs ${destroot}${prefix}/share/bakefile/presets
189
190variant universal {
191    set archs [join ${configure.universal_archs} ,]
192    # --disable-precomp-headers is automatically selected with cocoa, but not with gtk
193    # http://trac.wxwidgets.org/ticket/15454
194    configure.args-append   --enable-universal_binary=${archs} \
195                            --disable-precomp-headers
196}
197
198variant monolithic description {build only one library} {
199    configure.args-append   --enable-monolithic
200}
201
202variant debug description {add debug info to libraries} {
203    configure.args-append   --enable-debug
204}
205
206variant stdlib description {add support for various standard library features} {
207    configure.args-append   --enable-stl \
208                            --enable-std_containers \
209                            --enable-std_iostreams \
210                            --enable-std_string \
211                            --enable-std_string_conv_in_wxstring
212}
213
214livecheck.type      regex
215livecheck.url       ${homepage}/downloads/
216livecheck.regex     Release.*(\[23\]\\.\[0-9\]\\.\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.