Ticket #24350: Portfile

File Portfile, 4.6 KB (added by jjstickel@…, 14 years ago)

wxWidgets-python

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