# $Id: Portfile,v 1.1 2005/04/05 17:54:11 olegb Exp $
PortSystem		1.0
name			libgphoto2
version			2.1.5
categories		devel
maintainers		namely_void@yahoo.co.uk
description		The gphoto2 digital camera library 
long_description	The gphoto2 library can be used by applications to \
			access various digital camera models. 
homepage		http://www.gphoto.org/proj/libgphoto2/ 
master_sites		sourceforge:gphoto
checksums		md5 210844f0d88f58842917af6eaff06382
depends_build		bin:pkg-config:pkgconfig 
depends_lib		lib:libusb-0.1.4:libusb \
			lib:libjpeg:jpeg \
			lib:libintl.3:gettext \
			lib:libiconv:libiconv
patchfiles	patch-configure patch-dlsym
configure.env	CFLAGS="-I${prefix}/include -no-cpp-precomp" \
		LDFLAGS="-L${prefix}/lib"
configure.args		--without-exif --mandir=${prefix}/share/man --with-drivers=all	


variant exif {
	configure.args-delete --without-exif
	depends_lib-append	lib:libexif.12:libexif
}

platform darwin 6 {
	depends_lib-append lib:libdl:dlcompat
	post-configure {
		reinplace "s|#define HAVE_WCHAR_T 1|#undef HAVE_WCHAR_T|" \
			${worksrcpath}/config.h
		reinplace "s|#define HAVE_WCHAR_T 1|#undef HAVE_WCHAR_T|" \
			${worksrcpath}/libgphoto2_port/config.h
	}
}


