# -*- 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 108222 2013-07-16 20:45:57Z devans@macports.org $

PortSystem          1.0

name                gtksourceview3
set gname           gtksourceview
version             3.8.2
license             LGPL-2.1+
set branch          [join [lrange [split ${version} .] 0 1] .]
maintainers         devans openmaintainer
categories          gnome
platforms           darwin
description         GtkSourceView-3.0 is a text widget for GTK+ 3

long_description    GtkSourceView is a text widget that extends the standard \
                    GTK+ 3.x text widget GtkTextView. It improves GtkTextView \
                    by implementing syntax highlighting and other features \
                    typical of a source editor. This port contains version 3 of the \
                    GtkSourceView widget. Port GtkSourceView2 contains version 2 of the \
                    widget and port GtkSourceview contains version 1.

homepage            https://projects.gnome.org/gtksourceview/
master_sites        gnome:sources/${gname}/${branch}/
distname            ${gname}-${version}
use_xz              yes

checksums           rmd160  92ba998ca2f0883ad6154e5f89867e0a267273c8 \
                    sha256  1c2a01f1e04e3c8c9f09ff22f34f73f17b0e4e7ff0d83b2996c209bd02a6501b

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

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:gettext \
                    port:gtk3 \
                    port:libxml2

configure.cflags-append -Wno-format-nonliteral

test.run            yes
test.target         check

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING COPYING.lib MAINTAINERS \
        NEWS README ${destroot}${docdir}
}

#
# disable introspection if building universal
# to match behavior of dependency gtk3
#

if {[variant_isset universal]} {
    configure.args-append --enable-introspection=no
} else {
    depends_lib-append port:gobject-introspection
    configure.args-append --enable-introspection=yes
}

livecheck.type      gnome
livecheck.name      ${gname}
