# $Id: Portfile 75159 2011-01-17 02:00:53Z rmstonecipher@macports.org $

PortSystem 1.0

name			wxWidgets26
version			2.6.4
revision                3
categories		graphics devel
platforms		darwin
supported_archs	i386 ppc
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		${distname}-${version}${extract.suffix} \
				md5 3df4d9f1d3d785fcc6d66dbbf4b672b6 \
			${distname}-${version}${extract.suffix} \
				sha1 34a8d923d4947129cd0c7ada36219c81f7b5e82d \
			${distname}-${version}${extract.suffix} \
				rmd160 790bc04ae32562ce87928228876656450f2fd19a

depends_lib		port:jpeg \
				port:tiff \
				port:libpng \
				port:zlib \
				port:libiconv \
				port:expat \
				path:lib/pkgconfig/sdl.pc:libsdl \
				port:libsdl_mixer

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

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

patchfiles	patch.MoreFilesX.h.diff \
	patch.MoreFilesX.c.diff \
	patch.MoreFilesX.cpp.diff \
	patch.thread.cpp.diff

#configure.cmd	../${distname}-${version}/configure
configure.cmd	../configure
configure.args	--mandir=${prefix}/share/man \
				--with-libiconv-prefix=${prefix} \
				--with-libjpeg \
				--with-libtiff \
				--with-libpng \
				--with-zlib \
				--with-sdl \
				--with-opengl \
				--with-mac \
				--disable-sdltest \
				--enable-unicode \
				--enable-display \
				--enable-monolithic

set contrib		"animate gizmos stc ogl"

use_parallel_build no
build.target

platform darwin 8 {
    patchfiles-delete	patch.MoreFilesX.h.diff \
	patch.MoreFilesX.c.diff \
	patch.MoreFilesX.cpp.diff \
	patch.thread.cpp.diff
}

post-build {
		system "cd ${build.dir} && make -C contrib/src/animate"
		system "cd ${build.dir} && make -C contrib/src/gizmos"
		system "cd ${build.dir} && make -C contrib/src/stc"
		system "cd ${build.dir} && make -C contrib/src/ogl"
}

post-destroot {
		system "cd ${destroot.dir} && make -C contrib/src/animate install ${destroot.destdir}"
		system "cd ${destroot.dir} && make -C contrib/src/gizmos install ${destroot.destdir}"
		system "cd ${destroot.dir} && make -C contrib/src/stc install ${destroot.destdir}"
		system "cd ${destroot.dir} && make -C contrib/src/ogl install ${destroot.destdir}"

	xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${workpath}/${distname}-${version} \
		INSTALL-MAC.txt INSTALL-MGL.txt INSTALL-MOTIF.txt \
		INSTALL-OS2.txt INSTALL-X11.txt \
		README.txt README-MAC.txt \
		README-MGL.txt README-MOTIF.txt README-X11.txt \
		${destroot}${prefix}/share/doc/${name}
	system "cd ${destroot}${prefix}/bin && \
		ln -sf ${prefix}/lib/wx/config/mac-unicode-release-2.6 wx-config"
}

livecheck.type		regex
livecheck.url		${homepage}/downloads/
livecheck.regex		ftp.wxwidgets.org/pub/(2.6.\[0-9\]+)/
