# -*- 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 119158 2014-04-18 09:08:13Z jeremyhu@macports.org $

PortSystem      1.0
PortGroup       compiler_blacklist_versions 1.0

name            gjs
version         1.40.1
set branch      [join [lrange [split ${version} .] 0 1] .]
description     GObject JavaScriptCore bridge
long_description \
                Gjs is a JavaScript binding for GNOME. It's mainly based \
                on SpiderMonkey JavaScript engine and the GObject \
                Introspection framework.

maintainers     gmail.com:juanrgar openmaintainer
license         LGPL-2.1+
categories      gnome
platforms       darwin
homepage        https://wiki.gnome.org/Projects/Gjs
master_sites    gnome:sources/${name}/${branch}/
use_xz          yes

checksums       rmd160  6139ca59f9b13d37dfe715012efb9b5f46a94428 \
                sha256  2f0d80ec96c6284785143abe51377d8a284977ea6c3cf0cef1020d92eae41793

depends_build   port:pkgconfig \
                port:gnome-common \
                port:gettext

depends_lib     port:gobject-introspection \
                port:readline \
                path:lib/pkgconfig/cairo.pc:cairo \
                port:dbus-glib \
                port:mozjs24 \
                port:gnome-js-common

# Teach glibtool about -stdlib=libc++
use_autoreconf  yes
autoreconf.args -fvi

# Blacklist needs to match mozjs24:
# /opt/local/include/mozjs-24/mozilla/Compiler.h:22:4: error: #error "mfbt (and Gecko) require at least gcc 4.4 to build."
compiler.blacklist  *gcc* {clang < 300}

configure.args  --disable-silent-rules

# gobject-introspection uses g-ir-scanner, which uses $CC from env
build.args-append       CC="${configure.cc} ${configure.cc_archflags}"

# The rules enabled by gobject-introspection require GNU make 3.81+
platform darwin 8 {
    depends_build-append    port:gmake
    build.cmd               ${prefix}/bin/gmake
}

livecheck.type  gnome
