Ticket #31812: Portfile

File Portfile, 5.1 KB (added by guillaume.chevrot@…, 13 years ago)

Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=2:ts=2:sts=2
2# $Id$
3
4PortSystem      1.0
5PortGroup       archcheck 1.0
6
7name            wxWidgets-python
8conflicts       wxgtk wxWidgets
9version         2.8.10.1
10revision        2
11categories      graphics devel
12platforms       darwin
13maintainers     nomaintainer
14
15description     mature cross-platform C++ GUI framework
16long_description    wxWidgets is a mature open-source cross-platform C++ \
17    GUI framework for Mac OS, Unix, Linux, Windows. It can \
18    make use of a variety of native widget sets as well as \
19    its own widget set: Mac OS, GTK+, Motif, WIN32. \
20    wxWidgets will even run on embedded systems using \
21    Linux and X11.  This port version is meant to be in sync with py*-wxpython.
22
23homepage        http://www.wxwidgets.org/
24distname        wxWidgets
25master_sites    sourceforge:wxpython
26
27use_bzip2       yes
28
29distname        wxPython-src
30distfiles       ${distname}-${version}${extract.suffix}
31checksums           md5     65d5ef166f23fe8b4c67f58df164f93e \
32                    sha1    6598fbafd979a91f20100171fa23a91779f6dc62 \
33                    rmd160  bb606046d140623041b988e64ab268ced9aa958f
34
35depends_lib \
36    port:jpeg \
37    port:tiff \
38    port:libpng \
39    port:zlib \
40    port:libiconv \
41    port:expat \
42    path:lib/pkgconfig/sdl.pc:libsdl \
43    port:libsdl_mixer
44
45archcheck.files lib/libjpeg.dylib \
46                lib/libtiff.dylib \
47                lib/libpng.dylib \
48                lib/libz.dylib \
49                lib/libiconv.dylib \
50                lib/libexpat.dylib \
51                lib/libSDL.dylib \
52                lib/libSDL_mixer.dylib
53
54set worksrcdir  ${distname}-${version}/build
55
56extract.only    ${distname}-${version}${extract.suffix}
57
58patchfiles  changeset_r61009.diff
59patch.dir   ${workpath}/${distname}-${version}
60patch.pre_args  -p4
61
62configure.cmd       ../configure
63configure.ldflags   -L${build.dir}/lib -L${prefix}/lib
64configure.args      --mandir=${prefix}/share/man \
65                    --with-libiconv-prefix=${prefix} \
66                    --with-libjpeg \
67                    --with-libtiff \
68                    --with-libpng \
69                    --with-zlib \
70                    --with-sdl \
71                    --with-opengl \
72                    --disable-sdltest \
73                    --enable-unicode \
74                    --enable-display \
75                    --enable-monolithic \
76                    --enable-graphics_ctx
77
78set contrib         "gizmos stc ogl"
79set installtype     release
80
81build.target
82
83universal_variant   no
84use_parallel_build  no
85
86variant carbon conflicts gtk description {use carbon} {
87    supported_archs i386 ppc
88    configure.args-append --with-mac
89    configure.cflags-append -arch ${configure.build_arch}
90    configure.ldflags-append -arch ${configure.build_arch}
91    configure.cxxflags-append -arch ${configure.build_arch}
92    configure.cppflags-append -arch ${configure.build_arch}
93    configure.objcflags-append -arch ${configure.build_arch}
94}
95variant gtk conflicts carbon description {use gtk} {
96    depends_lib-append    port:gtk2
97    depends_lib-append    port:mesa
98    depends_lib-delete    path:lib/pkgconfig/sdl.pc:libsdl
99    depends_lib-delete    port:libsdl_mixer
100    archcheck.files-delete lib/libSDL.dylib \
101                          lib/libSDL_mixer.dylib
102    configure.args-delete --with-sdl
103    configure.args-append --with-gtk
104}
105variant nonmonolithic description {build libraries separately} {
106    configure.args-delete   --enable-monolithic
107}
108variant debug description {add debug info to libraries} {
109    configure.args-append   --enable-debug
110    set installtype debug
111}
112if {![variant_isset carbon]} {
113    default_variants-append +gtk
114}
115
116post-configure {
117    if {[variant_isset gtk]} {
118        # for some reason, 'configure --with-gtk' does not specify to link the X11 opengl libs
119        # not sure what happens if quartz variant of gtk2 is used
120        reinplace "s|EXTRALIBS_OPENGL = |EXTRALIBS_OPENGL = -lGL -lGLU -lglut|g" ${worksrcpath}/Makefile
121    }
122}
123post-build {
124    foreach c { ${contrib} } {
125        system "cd ${build.dir} && make -C contrib/src/${c}"
126    }
127}
128post-destroot {
129    foreach c { ${contrib} } {
130        system "cd ${build.dir} && make -C contrib/src/${c} install ${destroot.destdir}"
131    }
132    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
133    #xinstall -m 644 -W ${workpath}/${distname}-${version} \
134    #    install-mac.txt install-mgl.txt install-motif.txt \
135    #    INSTALL-OS2.txt install-x11.txt readme-cocoa.txt \
136    #    readme-gtk.txt readme-mac.txt \
137    #    readme-mgl.txt readme-motif.txt readme-x11.txt \
138    #    ${destroot}${prefix}/share/doc/${name}
139    if {[variant_isset carbon]} {
140        set confscript ${prefix}/lib/wx/config/mac-unicode-${installtype}-2.8
141    }
142    if {[variant_isset gtk]} {
143        set confscript ${prefix}/lib/wx/config/gtk2-unicode-${installtype}-2.8
144    }
145    reinplace "s|-L${build.dir}/lib||" ${destroot}${confscript}
146    ln -sf ${confscript} ${destroot}${prefix}/bin/wx-config
147}
148
149livecheck.type      regex
150livecheck.url       ${homepage}/downloads/
151livecheck.regex     Current Stable Release.*(2\\.\[0-9\]\\.\[0-9\]+)