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

Last change on this file was 152283, checked in by ryandesign@…, 15 months ago

wxWidgets-2.8: remove archcheck portgroup

MacPorts base has included arch checking code for years.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.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 152283 2016-09-02 12:34:24Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           select          1.0
7PortGroup           wxWidgets       1.0
8
9name                wxWidgets-2.8
10version             2.8.12
11revision            3
12set branch          [join [lrange [split ${version} .] 0 1] .]
13set wxpythonsubset  wxPython-2.8.12.1-MacPorts-subset
14
15categories          graphics devel
16platforms           darwin
17license             LGPL-2+
18maintainers         jwa mojca
19
20description         C++ framework for cross-platform GUI development
21long_description    wxWidgets ${branch} is an open-source cross-platform C++ \
22                    GUI framework for Mac OS, Unix, Linux, Windows. \
23                    Version 2.8 doesn't work with 64-bit Cocoa, so users \
24                    can choose between native 32-bit Carbon-based wxWidgets-2.8 \
25                    (requires SDK for 10.6 or lower) \
26                    and X11-based wxgtk-2.8 which also works in 64-bit.\
27                    The port is provided for compatibility reasons only \
28                    and will be removed as soon as all dependencies \
29                    start working with wxWidgets-3.0.
30
31homepage            http://www.wxwidgets.org/
32distname            wxWidgets
33master_sites        sourceforge:project/wxwindows/${version} \
34                    http://biolpc22.york.ac.uk/pub/${version}/ \
35                    http://trac.macports.org/raw-attachment/ticket/19190/:trac
36
37use_bzip2           yes
38
39distfiles           ${distname}-${version}${extract.suffix} \
40                    ${wxpythonsubset}${extract.suffix}:trac
41dist_subdir         ${distname}/${version}
42
43checksums           ${distname}-${version}${extract.suffix} \
44                    rmd160  928e221abe1a00cd2d72d2a4fd3640ba639b9915 \
45                    sha256  3b0ac1d2d017683851841501c8e1b744b97242d684a1668ded61809b0504f707 \
46                    ${wxpythonsubset}${extract.suffix} \
47                    rmd160  df824e5cd99cb2fc927194526edadd2f650a1c87 \
48                    sha256  01d77736aca3d16d1c26aa1002748bf43cd8ad261802f35e9a8f7b75c2227e8a
49
50subport wxgtk-2.8   {}
51
52if {${name} eq ${subport}} {
53    wxWidgets.use   wxWidgets-2.8
54    set installname wxWidgets
55    set wxtype      mac
56} else {
57    wxWidgets.use   wxGTK-2.8
58    set installname wxGTK
59    set wxtype      gtk2
60}
61set installtype     release
62set contrib         "gizmos stc ogl"
63
64depends_lib         port:jpeg \
65                    port:tiff \
66                    port:libpng \
67                    port:zlib \
68                    port:libiconv \
69                    port:expat
70
71depends_run         port:wxWidgets-common\
72                    port:wxWidgets_select
73
74set selectdir       ${workpath}/select
75select.group        wxWidgets
76select.file         ${selectdir}/${subport}
77
78worksrcdir          ${distname}-${version}/build
79
80patchfiles          patch-chkconf.diff \
81                    patch-configure.diff \
82                    patch-sdl.diff \
83                    patch-src-gtk-app.cpp.diff
84patch.dir           ${workpath}/${distname}-${version}
85
86post-patch {
87    reinplace "s|@@ARCHS@@|[get_canonical_archflags]|g" ${patch.dir}/configure
88    reinplace "s|@@PREFIX@@|${prefix}|g"                ${patch.dir}/configure
89
90    file mkdir ${selectdir}
91    system "echo \"${wxWidgets.wxdir}/wx-config\n${wxWidgets.wxdir}/wxrc-${branch}\" > ${select.file}"
92}
93
94configure.cmd       ../configure
95configure.args      --prefix=${wxWidgets.prefix} \
96                    --with-mac \
97                    --with-libiconv-prefix=${prefix} \
98                    --with-libjpeg \
99                    --with-libtiff \
100                    --with-libpng \
101                    --with-zlib \
102                    --with-opengl \
103                    --without-sdl \
104                    --disable-sdltest \
105                    --enable-unicode \
106                    --enable-display \
107                    --enable-graphics_ctx \
108                    --enable-universal_binary
109
110if {${wxWidgets.sdk} eq ""} {
111    configure.args-append   --with-macosx-sdk=no \
112                            --with-macosx-version-min=no
113} else {
114    configure.args-append   --with-macosx-sdk=${wxWidgets.sdk} \
115                            --with-macosx-version-min=${wxWidgets.macosx_version_min}
116}
117
118# wxgtk-2.8 (it doesn't work with Quartz)
119if {${name} ne ${subport}} {
120    depends_build-append    port:pkgconfig
121    depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo \
122                            port:gtk2 \
123                            port:libGLU \
124                            port:mesa \
125                            port:libsdl \
126                            port:libsdl_mixer
127
128    require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
129    require_active_variants gtk2 x11
130
131    configure.args-delete   --with-mac \
132                            --without-sdl
133    configure.args-append   --with-gtk \
134                            --with-sdl
135}
136
137post-build {
138    foreach c { ${contrib} } {
139        system -W ${build.dir} "make -C contrib/src/${c}"
140    }
141    # remove -arch flags from `wx-config --libs`
142    reinplace -E {s|-arch [a-z0-9_]+||g} lib/wx/config/${wxtype}-unicode-${installtype}-${branch}
143}
144
145post-destroot {
146    foreach c { ${contrib} } {
147        system -W ${build.dir} "make -C contrib/src/${c} install ${destroot.destdir}"
148    }
149
150    # copy a subset of wxPython to wxWidgets to prevent a conflict
151    # between py2X-wxpython-2.8 and py2Y-wxpython-2.8
152    copy ${workpath}/wxPython ${destroot}${wxWidgets.prefix}/include/wx-${branch}/wx/
153
154    # copy a subset of documetation
155    set destdocdir ${destroot}${wxWidgets.prefix}/share/doc/${distname}
156    xinstall -d -m 755 ${destdocdir}
157    xinstall -m 644 -W ${workpath}/${distname}-${version} \
158    install-mac.txt readme-mac.txt \
159    install-gtk.txt readme-gtk.txt ${destdocdir}
160
161    # maybe not needed
162    set confscript ${wxWidgets.prefix}/lib/wx/config/${wxtype}-unicode-${installtype}-${branch}
163    ln -sf ${confscript} ${destroot}${wxWidgets.prefix}/bin/wx-config
164}
165
166variant aui description {add support for AUI docking library} {
167    configure.args-append    --enable-aui
168}
169
170variant monolithic description {build only one library} {
171    configure.args-append    --enable-monolithic
172}
173
174variant debug description {add debug info to libraries} {
175    configure.args-append    --enable-debug
176    set installtype debug
177}
178
179
180if {${subport} eq ${name}} {
181    # when version 3.2 gets released, the livecheck might not be valid any more
182    livecheck.type  regex
183    livecheck.url   ${homepage}/downloads/
184    livecheck.regex Previous Stable Release.*(2\\.8\\.\[0-9\]+)
185} else {
186    livecheck.type  none
187}
Note: See TracBrowser for help on using the repository browser.