# $Id: Portfile,v 1.3 2005/04/21 15:57:48 jberry Exp $

PortSystem 1.0

name			chromium
version			0.9.12
categories		games
platforms		darwin
maintainers		mww@opendarwin.org
description		fast paced, arcade-style, top-scrolling space shooter.
long_description	${description}

homepage		http://www.reptilelabour.com/software/chromium/
master_sites	http://www.reptilelabour.com/software/files/chromium/
distfiles		${name}-src-${version}.tar.gz \
				${name}-data-${version}.tar.gz
checksums		${name}-src-${version}.tar.gz \
					md5 969883f2f20f10cd6cdb380582f130c4 \
				${name}-data-${version}.tar.gz \
					md5 173fdf76f1e4d7496142cd5662456a73
patchfiles		patch-configure_functions \
				patch-Makefile.no-setup \
				patch-NCString.cpp \
				patch-Makefile \
				patch-MainSDL_Event.cpp

worksrcdir		Chromium-0.9

depends_lib		lib:libvorbis:libvorbis \
				port:libsdl \
				port:smpeg \
				port:openal

extract.post_args	"| tar -xf - --exclude 'CVS'"

post-patch	{
	reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/configure
	reinplace "s|\"../data\"|\"${prefix}/share/${name}\"|g" \
		${worksrcpath}/src/main.cpp ${worksrcpath}/src/define.h
}
configure.pre_args
configure.args	--enable-sdl \
				--enable-smpeg \
				--enable-vorbis \
				--disable-setup

destroot	{
	xinstall -m 755 ${worksrcpath}/bin/chromium ${destroot}${prefix}/bin
	xinstall -m 755 -d ${destroot}${prefix}/share/
	file copy ${worksrcpath}/data ${destroot}${prefix}/share/${name}
	xinstall -m 644 ${filespath}/powerUpShield.png \
		${destroot}${prefix}/share/${name}/png
}

variant darwin	{
	post-destroot	{
		xinstall -m 755 -d ${destroot}/Applications/DarwinPorts/Chromium.app/Contents/MacOS
		system "ln -s ${prefix}/bin/chromium \
			${destroot}/Applications/DarwinPorts/Chromium.app/Contents/MacOS/Chromium"
	}
}
