# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 68421 2010-06-03 05:38:39Z elelay@macports.org $

PortSystem	1.0

name		webkit-gtk
epoch           1
version		1.2.1
revision        0
description	Apple's WebKit HTML rendering library for GTK+
long_description ${description}
maintainers	gmail.com:myschizobuddy devans
categories	www gnome
platforms	darwin freebsd
homepage	http://webkitgtk.org/
master_sites    ${homepage}

distname        webkit-${version}

checksums           md5     eb6f473d8d7be56ecd226e7dd55dcb9b \
                    sha1    ced564514f0be0a88c696e7afd6902d967d532a2 \
                    rmd160  f8c158b67fbcdfd9977edd530d5f8c15e402da6d

patchfiles      patch-WebKitTools-DumpRenderTree-gtk-TestNetscapePlugin-TestNetscapePlugin.cpp.diff \
                TextBreakIterator.diff\
                patch-WebCore-config-h.diff

depends_lib	\
	port:gtk2 \
	port:libsoup \
        port:icu \
	port:libxslt \
	port:sqlite3 \
        port:enchant \
        port:gst-plugins-base
        
depends_build	\
	port:pkgconfig \
        port:gtk-doc

# TODO: Use muniversal, so this is detected per arch
configure.args	\
        --enable-jit=no

post-patch {
    reinplace "s|-licucore|-licui18n -licuuc|" ${worksrcpath}/configure

    # For some reason, this isn't getting created for some people... ? /shrug
    file mkdir ${worksrcpath}/DerivedSources
}

# keep it for debug
post-destroot {
    file copy ${worksrcpath}/Programs/.libs/GtkLauncher ${destroot}${prefix}/bin
}

# see bug #24622
variant quartz {
    configure.args-append    --with-font-backend=pango --with-target=quartz
    patchfiles-append  patch-quartz-WebCore-plugins-gtk-gtkxtbin.c.diff \
                       patch-quartz-WebCore-plugins-gtk-PluginViewGtk.cpp.diff
}

#
# video is now enabled by default so make the variant no_video
#

variant no_video description {Disable HTML5 video support using gstreamer} {
	depends_lib-delete      port:gst-plugins-base
	configure.args-append	--disable-video
}

#
# add new variant to support gnome_keyring
#

variant gnome_keyring description {Enable support for gnomekeyring} {
        depends_lib-append      port:gnome-keyring
        configure.args-append   --enable-gnomekeyring
}

#
# variant to enable filter support which is disabled by default
# was svg_filters previously but renamed to follow configure arg usage
#

variant filters description {Enable support for SVG filters (experimental)} {
	configure.args-append	--enable-filters
}

#
# include dummy variant to ease transition from svg_filters to filters
#

variant svg_filters requires filters description {Build with +filters if +svg_filters was previously installed} {
}

#
# all svg support (except filters) is enabled by default
#

variant no_svg description {Disable all SVG support} {
	configure.args-append	--disable-svg
}

# compile bug when building 1.2.1 on Tiger,
# see https://bugs.webkit.org/show_bug.cgi?id=39847
platform darwin 8 {
	patchfiles-append patch-JavascriptCore-wtf-FastMalloc.cpp.diff
}

livecheck.type  regex
livecheck.url   http://webkitgtk.org/?page=download
livecheck.regex "webkit-(\\d+(?:\\.\\d+)*)${extract.suffix}"
