# $Id: Portfile,v 1.38 2006/03/11 21:17:21 rhwood Exp $
PortSystem 1.0
name		gnome-vfs
version		2.12.2
description	This is the GNOME Virtual File System.
long_description        This is the GNOME Virtual File System. \
			GNOME VFS is currently used as one of the \
			foundations of the Nautilus file manager.
maintainers	gnome-darwinports@opendarwin.org rhwood@opendarwin.org
categories	gnome
platforms	darwin 
homepage	http://www.gnome.org/
master_sites    gnome:sources/${name}/2.12/
checksums	sha1 fa8248e18cb8b44f617a5b1bb776df37628828ea

depends_lib	\
			port:gnome-mime-data \
			port:gconf

use_bzip2 	yes

configure.args  --mandir=${prefix}/share/man --enable-ipv6 --disable-static 
configure.env   CPPFLAGS="-L${prefix}/lib -I${prefix}/include" \
		LDFLAGS="-lresolv"

post-patch {
	reinplace "s|data_dirs = \"/usr|data_dirs = \"${prefix}/share:/usr|g" \
		${worksrcpath}/libgnomevfs/xdgmime.c \
		${worksrcpath}/libgnomevfs/gnome-vfs-mime-info.c 
	reinplace "s|\"/etc/fstab\"|\"/etc/fstab.hd\"|g" \
		${worksrcpath}/libgnomevfs/gnome-vfs-unix-mounts.c

	if {[variant_isset darwin_6]} {
        reinplace "s|#include <arpa/nameser.h>|#include <arpa/nameser.h>\\
		#ifndef T_SRV\\
		#define T_SRV 33\\
		#endif|g" \
			${worksrcpath}/libgnomevfs/gnome-vfs-dns-sd.c 
        reinplace "s|#include <limits.h>|#include <limits.h>\\
		#if \!defined getc_unlocked \\&\\& \!defined HAVE_GETC_UNLOCKED\\
		#define getc_unlocked(fp) getc (fp)\\
		#endif|g" \
			${worksrcpath}/libgnomevfs/xdgmimemagic.c
    	reinplace "s|socklen_t|int|g" ${worksrcpath}/modules/ftp-method.c
	}
	
	if {[variant_isset darwin_7]} {
		reinplace "s|#include <stdio.h>|#include <stdio.h>\\
		#include <stdint.h>|g" ${worksrcpath}/libgnomevfs/xdgmimecache.c
	}

}

pre-build {
	reinplace "s|-lkrb5support||g" \
		${worksrcpath}/Makefile ${worksrcpath}/daemon/Makefile \
		${worksrcpath}/devel-docs/Makefile ${worksrcpath}/doc/Makefile \
		${worksrcpath}/devel-docs/gnome-vfs-tutorial/Makefile \
		${worksrcpath}/imported/Makefile ${worksrcpath}/imported/neon/Makefile \
		${worksrcpath}/libgnomevfs/Makefile ${worksrcpath}/modules/Makefile \
		${worksrcpath}/monikers/Makefile ${worksrcpath}/programs/Makefile \
		${worksrcpath}/schemas/Makefile 
}

platform darwin 6 {
        configure.env-delete LDFLAGS="-lresolv"
	patchfiles	patch-xdgmimecache.c
}

platform darwin 7 {
	depends_lib-append	port:openssl
	patchfiles	patch-xdgmimecache.c
}

variant use-sys-deps {
	depends_lib	\
		lib:gnome-mime-magic:gnome-mime-data \
		lib:gconf-2:gconf
}
