# $Id: Portfile 55030 2009-08-06 05:03:13Z jeremyhu@macports.org $

PortSystem 1.0

# -universal because of SnowLeopard host_cpu issue (see below)
#PortGroup  muniversal 1.0
universal_variant no

name		liboil
version		0.3.16
description	A library of simple functions that are optimized for various CPUs.
long_description	${description}
maintainers	landonf
categories	devel
platforms	darwin
homepage        http://liboil.freedesktop.org/
master_sites    http://liboil.freedesktop.org/download/
checksums       md5     febb1d9f9bc4c440fcf622dc90f8b6b7 \
                sha1    0d6530ccb22d805c5209a185a94b575111ec34f3 \
                rmd160  5add00151e24ee8cc5a8dfb40223936a576cbffd

patchfiles      patch-configure.diff

depends_build	port:pkgconfig 
# port:libtool
depends_lib	path:lib/pkgconfig/glib-2.0.pc:glib2

variant doc description {Install documentation} {
    depends_build-append   port:gtk-doc
    configure.args-append  --enable-gtk-doc
}

# Building muniversal, configure fails to figure this out
#configure.cppflags-append -DHAVE_SYMBOL_UNDERSCORE

#post-configure {
#	# muniversal mucks up our glibtool
#	foreach arch ${universal_archs_to_use} {
#		copy -force ${prefix}/bin/glibtool ${worksrcpath}-${arch}/libtool
#	}
#}

livecheck.check         regex
livecheck.url           [lindex ${master_sites} 0]?C=M&O=D
livecheck.regex         ${name}-(\\d(?:\\.\\d+)*)

platform darwin 10 {
	# NB: won't work for universal building, but this port doesn't support it yet
	patchfiles-append host_cpu.diff
	post-patch {
		reinplace "s|__HOST_CPU__|${build_arch}|" ${worksrcpath}/configure
	}
}
