# $Id: Portfile,v 1.13 2006/03/31 18:48:39 matt Exp $

PortSystem 1.0
name			gnubg
version			0.14.3
revision		3
categories		games
platforms		darwin
maintainers		darwinports@opendarwin.org
homepage		http://www.gnubg.org/
description		GNU Backgammon

long_description	GNU Backgammon (gnubg) is a software for playing and analysing \
			backgammon positions, games and matches. It's based on a neural \
			network. Although it already plays at a very high level, it's \
			still work in progress. You can play at GNU Backgammon using the \
			command line or via a graphical interface based (on GTK+).

master_sites		ftp://alpha.gnu.org/gnu/${name}/ \
			http://public.planetmirror.com/pub/gnu-alpha/${name}/ \
			ftp://ftp.funet.fi/pub/mirrors/alpha.gnu.org/gnu/${name}/
			
distfiles		${distname}.tar.gz ${name}.weights-0.14.gz
extract.only		${distname}.tar.gz
			
checksums		${name}-${version}.tar.gz md5 b3ab1ace76fa4bea69db8e617ab587da \
			${name}.weights-0.14.gz md5 9f1154a9b327954a260726aa6aa6eea5

depends_lib		lib:libgtk.2:gtk2 \
			lib:libxml.2:libxml2 \
			lib:freetype:freetype \
			lib:libreadline:readline \
			bin:pkg-config:pkgconfig

post-extract {		cd ${worksrcpath}
			system "cp ${distpath}/${name}.weights-0.14.gz ."
			system "gzip -d ${name}.weights-0.14.gz"
			system "mv ${name}.weights-0.14 ${name}.weights"
			}

patchfiles		patch-configure.diff

platform darwin 8	{ patchfiles-append	patch-rollout.h.diff }

configure.env		CPPFLAGS="-I${prefix}/include" \
			CFLAGS="-lmx" \
			LDFLAGS="-L${prefix}/lib -L${x11prefix}/lib -lX11 \
			-bind_at_load -multiply_defined suppress"
			

configure.args		--mandir=${prefix}/share/man \
			--infodir=${prefix}/share/info \
			--sysconfdir=${prefix}/etc \
			--libdir=${prefix}/lib \
			--disable-gtkextratest \
			--disable-libarttest \
			--disable-esdtest \
			--disable-audiofiletest \
			--disable-gtkglext-test \
			--disable-artsc-test \
			--disable-nas \
			--without-sound \
			--without-board3d \
			--without-libintl-prefix \
			--without-python \
			--without-gtkextra \
			--with-gtk2


post-destroot {		xinstall -d ${destroot}${prefix}/share/doc/${name}
			xinstall -m 644 -v -W ${worksrcpath} \
				AUTHORS ChangeLog README TODO \
				${destroot}${prefix}/share/doc/${name}
			system "rm -rf ${destroot}${prefix}/share/${name}/sounds"
			}

variant gdbm {		depends_lib-append	lib:libgdbm:gdbm
			configure.args-append	--with-gdbm
			}

variant guile {		depends_lib-append	bin:guile:guile
			configure.args-append	--with-guile
			}

variant python {	depends_lib-append	bin:python:python24
			configure.args-delete	--without-python
			configure.args-append	--with-python
			}

