# $Id: Portfile 71889 2010-09-26 05:50:06Z ryandesign@macports.org $

PortSystem	1.0

name		yap
conflicts	yap-devel
version		6.0.5
revision	1
categories	lang
maintainers	logtalk.org:pmoura
platforms	darwin
description	YAP Prolog compiler

long_description	\
		YAP is a high-performance Prolog compiler developed at    \
		CRACS/Universidade do Porto and at COPPE Sistemas/UFRJ.   \
		Its Prolog engine is based in the WAM (Warren Abstract    \
		Machine), with several optimizations for better           \
		performance. YAP follows the Edinburgh tradition, and     \
		is largely compatible with the ISO-Prolog standard and    \
		with Quintus and SICStus Prolog.

homepage        http://www.dcc.fc.up.pt/~vsc/Yap/
master_sites    ${homepage}
checksums		sha1 1084b1630b48a430d60d6aee8e31914ecc6d5369 \
                rmd160 b35264a7911c73d095426fb3790a104d41d44157

depends_lib		port:readline port:gmp

worksrcdir      yap-6

configure.args  --with-gmp=${prefix} \
                --with-readline=${prefix}

if {${os.platform} == "darwin" && ${build_arch} == "x86_64"} {
    configure.args-append --build=${build_arch}-apple-${os.platform}${os.version}
}

default_variants +java

variant tabling {
    configure.args-append --enable-tabling
}

variant java {
    configure.args-append --with-jpl=/Library/Java/Home
}

variant condor {
    configure.args-append --enable-condor
}

variant threads {
    configure.args-append --enable-threads
    configure.args-append --enable-pthread-locking
    configure.args-append --enable-or-parallelism
}

variant debug {
    configure.args-append --enable-debug-yap
    configure.args-append --enable-low-level-tracer
}

livecheck.url   ${homepage}downloads.html
livecheck.regex {yap-([0-9.]+)}
