# -*- 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$

PortSystem      1.0

name            gecko-sharp2
set my_name     gecko-sharp-2.0
version         0.13
categories      devel
license         {MPL-1.1 LGPL-2.1}
maintainers     nomaintainer
platforms       darwin
description     GeckoSharp is a wrapper for the GtkEmbedMoz widget.

long_description \
    GeckoSharp is a wrapper for the GtkEmbedMoz widget. It provides \
    the abilty to embed the Mozilla rendering engine (Gecko) into your \
    Gtk# application.

homepage        http://www.mono-project.com/GeckoSharp
master_sites    http://ftp.novell.com/pub/mono/sources/$name/
distname        ${my_name}-${version}
use_bzip2       yes

checksums       md5     f88eaa06e71f8d8fa34cf59a3e034a6b \
                sha1    2435ce6fdb130d59e7479758d1bd98d334704e58 \
                rmd160  af1eafb98583f2eb5e3f3ee877ea3f8fd0e6757f

depends_build   port:pkgconfig

depends_lib     port:mono \
                port:gtk2 \
                port:gtk-sharp2

# mono is not universal
universal_variant   no

configure.args  ac_cv_path_MONODOCER=no

post-configure {
    # TODO This shouldn't be needed, we need to fix Mono dllmap library path.
    fs-traverse {f} ${worksrcpath} {
        if {[string match *.dll.config ${f}]} {
            reinplace -E "s|(target=\")|\\1${prefix}/lib/|" ${f}
        }
    }

    reinplace "s/libgtk-x11-2\\.0\\.0\\.dylib/[glob -tail -path $prefix/lib/ libgtk-*-2.0.0.dylib]/" \
        $worksrcpath/gtkmozembed/gecko-sharp.dll.config
}

use_parallel_build  yes

livecheck.type  regex
livecheck.url   http://go-mono.com/sources-stable/
livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)