# $Id: Portfile,v 1.8 2005/10/19 08:10:17 blb Exp $

PortSystem		1.0
name			wxgtk
version			2.4.2
categories		x11
maintainers		blb@opendarwin.org
description		The wxWindows GUI toolkit with GTK+ bindings
long_description	\
	A C++ package for platform independent software development

homepage		http://wxwindows.org/
platforms		darwin
master_sites	sourceforge:wxwindows
distname		wxGTK-${version}
checksums		md5 cdadfe82fc93f8a65a2ae18a95b0b0e3
use_bzip2		yes

depends_lib		lib:libgtk.1:gtk1 lib:libtiff:tiff lib:libjpeg:jpeg \
				lib:libpng:libpng lib:libfreetype.6:freetype \
				lib:libz:zlib

configure.env	LDFLAGS="-L${prefix}/lib" \
				CPPFLAGS="-I${prefix}/include -I${x11prefix}/include"
configure.args	--with-gtk --with-libpng --with-libjpeg --with-libtiff \
				--with-freetype --with-zlib

destroot.destdir	prefix=${destroot}/${prefix}

post-destroot {
	xinstall -m 755 -d ${destroot}/${prefix}/share/doc/${name}
	eval xinstall -m 644 [glob ${worksrcpath}/*.txt] \
		${destroot}/${prefix}/share/doc/${name}
}

variant opengl {
	depends_lib-append		lib:libGL:XFree86
	configure.args-append	--with-opengl
}

variant darwin {
	patchfiles	darwin-shared-ld-sh
	post-patch {
		system "chmod 755 distrib/mac/shared-ld-sh"
	}
}

