# $Id: Portfile,v 1.1 2006/03/07 07:40:40 yves Exp $
PortSystem 1.0
name		mozilla-devel
version		1.8b1
categories	www	
description	Mozilla browser.
long_description	${description}
homepage	http://www.mozilla.org/
platforms	darwin
maintainers	darwinports@opendarwin.org
distname	mozilla-source-${version}
worksrcdir	mozilla
master_sites	http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla${version}/source/
checksums	md5 42a0b25d405ee60128adb0eef4bc0fa0
use_bzip2	yes
depends_build	bin:zip:zip bin:gmake:gmake bin:libIDL-config-2:libidl
depends_lib	lib:libgtk.2:gtk2

configure.args	--enable-default-toolkit=gtk2 --mandir=${prefix}/share/man \
		--enable-optimize --enable-crypto --disable-freetype2 --disable-debug \
		--enable-application=suite --disable-tests --enable-xft \
		--enable-extensions=all 
		
post-configure {
    reinplace "/MOZ_GTK2_LIBS/ s/lpangocairo/lpangox-1.0 -lpangocairo/" \
        ${worksrcpath}/config/autoconf.mk
}

variant nomail {
		configure.args-append  --disable-mailnews 
}

variant calendar {
		configure.args-append --enable-calendar
}

variant no-crypto {
		configure.args-delete --enable-crypto
		configure.args-append --disable-crypto
}

variant gtk1 { 
		configure.args-delete --enable-default-toolkit=gtk2
		configure.args-append --enable-default-toolkit=gtk 
		depends_lib-delete lib:libgtk.2:gtk2
		depends_lib-append lib:libgtk.1:gtk1
}

# needs to be build on HFS 
variant aqua { 
		configure.args-delete --enable-default-toolkit=gtk2
		configure.args-append --enable-default-toolkit=mac
		configure.args-append --enable-prebinding
		
		depends_lib-append lib:libIDL:libidl1
		depends_lib-delete lib:libgtk.2:gtk2
}

platform darwin 8 {
    pre-fetch {
        set fl [open "| gcc --version"]
        set data [read $fl]
        if {[regexp "build 4061" $data]} {
            ui_msg "\n\
                Xcode 2.0 has a buggy gcc and won't build mozilla \n\
                Upgrades are available at http://connect.apple.com/"
            exit 1
        }
    }
    patchfiles-append   patch-oiddata.h
}

