# $Id: Portfile 66066 2010-04-05 17:32:50Z snc@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.17
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     47dc734f82faeb2964d97771cfd2e701 \
                    sha1    f9d7103a3a4a4089f56197f81871ae9129d229ed \
                    rmd160  de286350687a5d49868b0a45d4db007526220fec

patchfiles      patch-liboil_liboilcpu-x86.c.diff

depends_build	port:pkgconfig 
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.type          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
	}
}
