# $Id: Portfile 75159 2011-01-17 02:00:53Z rmstonecipher@macports.org $

PortSystem		1.0
name			simage
version			1.7.0
revision                1
description		library for loading and saving images, sound and video
long_description	simage is a library capable of loading, manipulating \
	and saving images, creating and saving movies (AVI and mpeg), and    \
	loading audio. The simage library relies heavily on 3rd party        \
	libraries to perform these tasks.

categories		graphics devel
homepage		http://www.coin3d.org/lib/simage/
platforms		darwin
maintainers		css
master_sites		http://ftp.coin3d.org/coin/src/all/
checksums		md5     c479cc27fc80ffc39142318a233c6ae2 \
			sha1    32b2bbfd7f2e7ec3591f506094c9d006e4af3921 \
			rmd160  be5e13c0acc345a39f4686e3121222faa3cdbd51

depends_lib		port:jpeg \
			port:libpng \
			port:libsndfile \
			port:giflib \
			port:tiff \
			port:zlib

use_configure		yes
configure.args		--disable-quicktime \
			--with-jpeg=${prefix} \
			--with-png=${prefix} \
			--with-libsndfile=${prefix} \
			--with-ungif=${prefix} \
			--with-tiff=${prefix} \
			--with-zlib=${prefix}

post-build {
	reinplace -E {s|-arch [a-z0-9_]+||g} \
		${worksrcpath}/simage.pc \
		${worksrcpath}/simage-default.cfg
}

# The QuickTime variant uses QuickTime for image loading, removing
# the dependencies on additional image libraries.
variant quicktime description {Use QuickTime instead of the many smaller libraries} {
	depends_lib-delete	port:jpeg \
				port:libpng \
				port:giflib \
				port:tiff \
				port:zlib
	configure.args-delete	--disable-quicktime \
				--with-jpeg=${prefix} \
				--with-png=${prefix} \
				--with-ungif=${prefix} \
				--with-tiff=${prefix} \
				--with-zlib=${prefix}
	configure.args-append	--enable-quicktime
}
