# $Id$

PortSystem 1.0

PortGroup  muniversal 1.0

name		liboil
version		0.3.17
revision	1
description	A library of simple functions that are optimized for various CPUs.
long_description	${description}
maintainers	nomaintainer
categories	devel
license		BSD
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 automake.patch

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
}

use_autoreconf  yes
autoreconf.args -fvi

if {[variant_isset universal]} { 
    set merger_host(i386) i686-apple-${os.platform}${os.major}
    set merger_host(x86_64) x86_64-apple-${os.platform}${os.major}
} elseif {${build_arch} eq "i386"} {
    configure.args-append \
        --host=i686-apple-${os.platform}${os.major}
} elseif {${build_arch} eq "x86_64"} {
    configure.args-append \
        --host=${build_arch}-apple-${os.platform}${os.major}
}

# icky inline asm... clang doesn't want to touch it, but we can force it
if {[string match *clang* ${configure.compiler}]} {
	configure.cflags-append -fheinous-gnu-extensions
}

test.run                yes 
test.target             check 

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