# $Id: Portfile,v 1.36 2006/03/27 16:05:57 gwright Exp $

PortSystem	1.0
name		logtalk
version		2.27.1

categories	lang
maintainers	pmoura@mac.com
platforms	darwin freebsd linux
description	Logtalk - Open source object-oriented extension to Prolog

long_description	\
		Logtalk is an open source object-oriented extension to the 	\
		Prolog programming language. Integrating logic programming 	\
		with object-oriented and event-driven programming, it is 	\
		compatible with most Prolog compilers. It supports both 	\
		prototypes and classes. In addition, it supports component-	\
		based programming through category-based composition.

homepage        http://www.logtalk.org/
master_sites	${homepage}/files/

checksums		md5 3366b292cb3e9145f15a89b9a8443602

distname		lgt2271
extract.suffix	.tgz

configure	{}

build		{}

destroot	{
	system "mkdir ${destroot}${prefix}/share/${distname}"
	cd ${destroot}${prefix}/share/${distname}

	system "cp -R ${workpath}/${worksrcdir}/* ."
	system "chmod -R go-w,a+r ."
	system "chmod a+x scripts/*.sh"
	system "chmod a+x xml/*.sh"
}

post-destroot	{
	cd ${destroot}/${prefix}/share
	system "ln -sf ${distname} logtalk"
	cd ../bin
	system "ln -sf ../share/${distname}/scripts/cplgtdirs.sh cplgtdirs"
	system "ln -sf ../share/${distname}/xml/lgt2xml.sh lgt2xml"
	system "ln -sf ../share/${distname}/xml/lgt2html.sh lgt2html"
	system "ln -sf ../share/${distname}/xml/lgt2pdf.sh lgt2pdf"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_ciaolgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_eclipselgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_gplgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_plclgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_sicstuslgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_swilgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_xsblgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_xsbcvslgt.sh ${destroot}/${prefix}"
	system "export LOGTALKHOME=../share/${distname}; ../share/${distname}/scripts/make_yaplgt.sh ${destroot}/${prefix}"
}

post-activate {
	ui_msg "****************************************************************************"
	ui_msg "*  Integration scripts have been created for running Logtalk with selected"
	ui_msg "*  back-end Prolog compilers (which must be properly installed for running"
	ui_msg "*  the scripts!):"
	ui_msg "*"
	ui_msg "*    CIAO:           ciaolgt"
	ui_msg "*    ECLiPSe:        eclipselgt"
	ui_msg "*    GNU Prolog:     gplgt"
	ui_msg "*    K-Prolog:       plclgt"
	ui_msg "*    SICStus Prolog: sicstuslgt"
	ui_msg "*    SWI-Prolog:     swilgt"
	ui_msg "*    XSB:            xsblgt"
	ui_msg "*    XSB CVS:        xsbcvslgt"
	ui_msg "*    YAP:            yaplgt"
	ui_msg "*"
	ui_msg "* Remember to set the environment variable LOGTALKHOME to the path to"
	ui_msg "* the Logtalk distribution: ${prefix}/share/${distname}"
	ui_msg "* and the environment variable LOGTALKUSER to your local configuration"
	ui_msg "* directory (usually ~/logtalk), which you can create by running the"
	ui_msg "* command cplgtdirs. See the file \$LOGTALKHOME/INSTALL for details on"
	ui_msg "* how to customize your working environment."
	ui_msg "****************************************************************************"
}
