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

PortSystem          1.0

name                vala-devel
conflicts           vala
set my_name         vala
version             0.56.19
revision            0

categories          lang
license             LGPL-2.1+
maintainers         {mascguy @mascguy} openmaintainer

description         Compiler for the GObject type system
long_description    Vala is a new programming language that aims to bring modern programming \
                    language features to GNOME developers without imposing any additional \
                    runtime requirements and without using a different ABI compared to \
                    applications and libraries written in C.
homepage            https://wiki.gnome.org/Projects/Vala

set branch          [join [lrange [split ${version} .] 0 1] .]
master_sites        gnome:sources/${my_name}/${branch}/
dist_subdir         ${my_name}
distname            ${my_name}-${version}
use_xz              yes

checksums           rmd160  62cd33aa1fa25202f8a7bf59424adbcf734eaf55 \
                    sha256  5ad7cbbfcc0de61b403d6797c9ef60455bfbebd8e162aec33b5b0b097adfb9d5 \
                    size    4007612

if { [string match *clang* ${configure.compiler}] } {
    # Quiet warnings
    configure.cflags-append \
                    -Wno-deprecated-declarations \
                    -Wno-incompatible-pointer-types-discards-qualifiers \
                    -Wno-error=unknown-warning-option \
                    -Wno-unknown-warning-option
}

depends_build-append \
                    port:bison \
                    port:docbook-xml \
                    port:docbook-xsl-nons \
                    port:flex \
                    port:gettext \
                    port:help2man \
                    port:libxslt \
                    path:bin/pkg-config:pkgconfig

depends_lib-append \
                    port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection

configure.args-append \
                    --disable-silent-rules \
                    --disable-valadoc

variant valadoc description {Install valadoc and documentation} {
    # valadoc links aaginst libraries installed by graphviz
    depends_lib-append \
                    path:bin/dot:graphviz

    configure.args-delete \
                    --disable-valadoc
}

default_variants-append \
                    +valadoc

test.run            yes

livecheck.type      gnome
livecheck.name      ${my_name}
