# $Id: Portfile 64763 2010-03-15 16:31:33Z nox@macports.org $

PortSystem 1.0

name		libgdiplus
version		2.6
revision        1
categories	devel
platforms	darwin
maintainers	stechert openmaintainer
description	An Open Source implementation of the GDI+ API
long_description	An implementation of the GDI+ API for Mono, an \
			effort to create an open source implementation of \
			the .NET Development Framework including a C# compiler.

homepage	http://www.mono-project.com/Libgdiplus
master_sites	http://www.go-mono.com/sources/libgdiplus/
use_bzip2	yes

checksums       md5     9107b4429fdafde914bd23405544c58d \
                sha1    170836d0cb99812b1838e0207a844ac7f9e4232b \
                rmd160  25f5680dae2f5515c6e69229541ede4bdcb381ef

depends_build   port:pkgconfig

depends_lib	port:jpeg \
		port:tiff \
		path:include/gif_lib.h:giflib \
		port:libpng \
		port:zlib \
		port:fontconfig \
		port:libiconv \
		port:libexif \
		path:lib/pkgconfig/glib-2.0.pc:glib2 \
		port:xorg-libsm \
		port:xrender

post-patch {
 	reinplace "s/-pthread/-lpthread/g" ${worksrcpath}/configure
}

test.run        yes
test.target     check

post-destroot {
	set docdir ${prefix}/share/doc/${name}
	xinstall -d ${destroot}${docdir}
	xinstall -m 0644 -W ${worksrcpath} AUTHORS COPYING ChangeLog LICENSE NEWS \
		README TODO ${destroot}${docdir}
}

variant pango description {Enable Pango font rendering support (experimental)} {
    depends_lib-append      path:lib/pkgconfig/pango.pc:pango

    configure.args-append   --with-cairo=system \
                            --with-pango

    pre-configure {
        if {[file exists ${prefix}/include/cairo/cairo-quartz.h]} {
            ui_error "cairo and pango must be installed without their +quartz variant"
            ui_error "to enable mono +pango variant."
            error "Please reinstall cairo and pango without +quartz."
        }
    }
}

platform darwin 10 {
	patchfiles-append	patch-disable-atsui-support.diff
}

livecheck.type  regex
livecheck.url   http://www.go-mono.com/sources-stable/
livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)
