# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 115137 2013-12-26 02:12:09Z jeremyhu@macports.org $

PortSystem          1.0
PortGroup           github 1.0

github.setup        mono webkit-sharp 0.3
categories          devel www gnome
platforms           darwin
maintainers         ryandesign openmaintainer
license             MIT

description         C#/CLI bindings to WebKit/Gtk+

long_description    ${description}

master_sites        http://ftp.novell.com/pub/mono/sources/webkit-sharp/
use_bzip2           yes

checksums           rmd160  10b80ea1fb253e69dde6fadb3c5df5114b7b5e69 \
                    sha256  6633630b6e4834b0f93726570d1c97e884470e3c400ae929cca2f1376b7b959a

depends_build       port:pkgconfig

depends_lib         port:gtk-sharp2 \
                    port:mono \
                    path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk

# mono is not universal
universal_variant   no

# TODO: Check ${configure.cxx_stdlib} directly once MacPorts 2.3 is released
platform darwin {
    set cxxstdlib {}

    if {[info exists configure.cxx_stdlib] &&
        ${configure.cxx_stdlib} ne {} &&
        [string match *clang* ${configure.cxx}]} {
        set cxxstdlib ${configure.cxx_stdlib}
    } elseif {[string match *clang* ${configure.cxx}] &&
              ${os.major} >= 13} {
        set cxxstdlib libc++
    } else {
        set cxxstdlib libstdc++
    }

    if {${cxxstdlib} eq "libstdc++"} {
       depends_lib-delete path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk
       depends_lib-append path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk-2.0
    }
}
