# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem 1.0

name			esdl
version         0.96.0626 
categories		graphics devel erlang
platforms		darwin
maintainers		mac.com:bfulgham
description		Erlang OpenGL/SDL API and Utilities
long_description	ESDL is a library that gives you access to SDL and \
				OpenGL functionality from your Erlang program. \
				SDL handles 2D graphics, user events, and \
				audio, while OpenGL handles 3D graphics.

homepage		http://esdl.sourceforge.net/
master_sites		sourceforge
distfiles		${distname}.src.tar.gz
checksums		md5 5007750ddd989319442e8e040db3b6dd

depends_build		port:libsdl-framework port:erlang

patchfiles 		patch-c_src-Makefile.macOSX patch-c_src-esdl_driver.c patch-Makefile

use_configure		no

pre-build		{
			# Use Macintosh Makefile
			system "cd ${build.dir}/c_src && ln -sf Makefile.macOSX Makefile"
}

build.target		
destroot.destdir		DPORTSDIR=${destroot}

post-destroot		{
	xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
	xinstall -m 0644 -W ${worksrcpath} Readme Readme.MacOSX-Cocoa license.terms \
		${destroot}${prefix}/share/doc/${name}
	file copy ${worksrcpath}/test ${destroot}${prefix}/share/doc/${name}/test
}

livecheck.regex		<title>${name} ${name}-(.*) released.*</title> 
