# $Id: Portfile 80856 2011-07-19 07:08:43Z jwa@macports.org $

PortSystem 1.0
PortGroup               archcheck 1.0

name			wxWidgets-devel
conflicts		wxgtk wxWidgets
version			2.9.2
revision		1

categories		graphics devel
platforms		darwin
maintainers		jwa
description		mature cross-platform C++ GUI framework
long_description	wxWidgets is a mature open-source cross-platform C++ \
    GUI framework for Mac OS, Unix, Linux, Windows. It can \
    make use of a variety of native widget sets as well as \
    its own widget set: Mac OS, GTK+, Motif, WIN32. \
    wxWidgets will even run on embedded systems using \
    Linux and X11.

homepage		http://www.wxwidgets.org/
distname		wxWidgets
master_sites	sourceforge:wxwindows \
			    http://biolpc22.york.ac.uk/pub/${version}/

use_bzip2		yes

distfiles		${distname}-${version}${extract.suffix}
dist_subdir		${distname}/${version}

checksums           md5     d6cec5bd331ba90b74c1e2fcb0563620 \
                    sha1    1487a8ed4f48cc1bd0c4d37de9385c8edd1a024b \
                    rmd160  f6d85672f02d8888bd779f5bcde5e902f0f6339b
                    
depends_lib		port:jpeg \
			    port:tiff \
			    port:libpng \
			    port:zlib \
			    port:libiconv \
			    port:expat

archcheck.files lib/libjpeg.dylib \
                lib/libtiff.dylib \
                lib/libpng.dylib \
                lib/libz.dylib \
                lib/libiconv.dylib \
                lib/libexpat.dylib

set worksrcdir	${distname}-${version}/build

extract.only	${distname}-${version}${extract.suffix}

patch.dir	${worksrcpath}/..
patchfiles	patch-configure-change_install_names.diff
configure.cmd	../configure
configure.ldflags	-L${build.dir}/lib -L${prefix}/lib
configure.args	--mandir=${prefix}/share/man \
			    --with-libiconv-prefix=${prefix} \
			    --with-libjpeg \
			    --with-libtiff \
			    --with-libpng \
			    --with-zlib \
			    --with-opengl \
			    --with-cocoa \
    			    --without-sdl \
			    --enable-unicode \
			    --enable-display

build.target

universal_variant	no
use_parallel_build	yes

supported_archs	x86_64 ppc64 i386 ppc
configure.ccache = no
configure.cppflags-append -arch ${configure.build_arch}

post-destroot {
    set confscript ${prefix}/lib/wx/config/osx_cocoa-unicode-2.9
    ln -sf ${confscript} ${destroot}${prefix}/bin/wx-config
}

default_variants	+sdl

variant monolithic description {build only one library} {
    configure.args-append	--enable-monolithic
}

variant debug description {add debug info to libraries} {
    configure.args-append	--enable-debug
}

variant sdl description {Use SDL for audio on Unix} { 
    depends_lib-append          path:lib/pkgconfig/sdl.pc:libsdl 
    depends_lib-append          port:libsdl_mixer 
    configure.args-delete       --without-sdl 
    configure.args-append       --with-sdl 
} 
	 
variant stdlib description {add support for various standard library features} { 
    configure.args-append       --enable-stl \ 
    --enable-std_containers \ 
    --enable-std_iostreams \ 
    --enable-std_string \ 
    --enable-std_string_conv_in_wxstring 
} 

livecheck.type		regex
livecheck.url		${homepage}/downloads/
livecheck.regex		Latest Development Release.*(2\\.\[0-9\]\\.\[0-9\]+)
