# $Id: Portfile,v 1.21 2006/07/05 21:09:04 mww Exp $

PortSystem 1.0
name			libsdl
version			1.2.11
categories		devel multimedia
maintainers		darwinports@opendarwin.org
description		Cross-platform multi-media development API
long_description	Simple DirectMedia Layer is a cross-platform \
			multimedia library designed to provide fast access \
			to the graphics framebuffer and audio device. It is \
			used by MPEG playback software, emulators, and many \
			popular games, including the award winning Linux \
			port of "Civilization: Call To Power." Simple \
			DirectMedia Layer supports Linux, Win32, BeOS, \
			MacOS, Solaris, IRIX, and FreeBSD.
platforms		macosx freebsd
master_sites		http://www.libsdl.org/release/
distname		SDL-${version}
# added subdir due to changes in original distfile
dist_subdir		${name}/a
checksums		sha1 2259134d714e35ab1469d513674a3cd02510d198

configure.args	--enable-shared \
			--mandir=${prefix}/share/man

post-destroot	{
	xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}/docs
	xinstall -m 0644 -W ${worksrcpath} BUGS COPYING CREDITS INSTALL README \
		README-SDL.txt README.MacOSX TODO docs.html \
		${destroot}${prefix}/share/doc/${name}
	xinstall -m 0644 -W ${worksrcpath}/docs index.html \
		${destroot}${prefix}/share/doc/${name}/docs
	system "cp -R ${worksrcpath}/docs/html ${destroot}${prefix}/share/doc/${name}/docs"
}

platform darwin 6 {
	depends_lib-append	lib:libdl:dlcompat
	configure.env		CPPFLAGS="-I${prefix}/include" \
						LDFLAGS="-L${prefix}/lib"
}

platform darwin 7 {
	pre-fetch { system "/bin/bash ${portpath}/${filesdir}/qt-check.sh" }
}

platform darwin 8 {
	patchfiles patch-configure
	configure.env CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
	build.env CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}
