# $Id: Portfile 117425 2014-02-26 03:08:45Z devans@macports.org $

PortSystem 1.0

name            seed
version         3.8.1
set branch      [join [lrange [split ${version} .] 0 1] .]
description     GObject JavaScriptCore bridge
long_description \
                GObject JavaScriptCore bridge

maintainers     nomaintainer
categories      gnome
platforms       darwin
license         LGPL-2
homepage        https://wiki.gnome.org/Projects/Seed
master_sites    gnome:sources/${name}/${branch}/
use_xz          yes

checksums       md5     f5afeb04343e0cb56d2396f0d0458988 \
                sha1    1c4498c0ae2c17652a1e89caa93351e6df91d587 \
                rmd160  8449a20e3f54c69de4fadde957e600e9de7b2ecd

depends_build   port:pkgconfig \
                port:intltool \
		port:gtk-doc

depends_lib     port:gobject-introspection \
                port:gettext \
                port:readline \
                port:gnome-js-common \
                path:lib/pkgconfig/cairo.pc:cairo \
                path:lib/pkgconfig/webkitgtk-3.0.pc:webkit-gtk3 \
                port:dbus-glib \
                port:libffi \
                port:mpfr \
                port:libxml2 \
                port:sqlite3

# autoreconf with our intltool.m4

use_autoreconf  yes
autoreconf.args -fvi

configure.args  --disable-gettext-module

# 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/webkitgtk-3.0.pc:webkit-gtk3
       depends_lib-append path:lib/pkgconfig/webkitgtk-3.0.pc:webkit-gtk3-2.0
    }
}

livecheck.type  gnome
