# -*- 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            libgnomecanvas
version         2.30.3
revision        6
checksums       rmd160  044d9980fdc0a074d72407a7fa70d99b2823817b \
                sha256  859b78e08489fce4d5c15c676fec1cd79782f115f516e8ad8bed6abcb8dedd40 \
                size    574139

set branch      [join [lrange [split ${version} .] 0 1] .]
description     A graphics library for GNOME.
long_description        The GNOMECanvas library provides a number \
                        of features: \
                        Image loading facilities. Rendering of a \
                        GdkPixBuf into various formats: drawables \
                        (windows, pixmaps), GdkRGB buffers. \
                        A cache interface.
maintainers     nomaintainer
categories      gnome
license         LGPL-2+
homepage        https://www.gnome.org/
master_sites    gnome:sources/${name}/${branch}/

# add a dummy +quartz variant to distinguish the binary packages,
# because they must link against libgtk2-quartz instead of
# libgtk2-x11. See #31303
variant quartz {}

depends_build   port:pkgconfig \
                port:gnome-common \
                port:gtk-doc \
                port:intltool \
                port:autoconf \
                port:automake \
                port:libtool

depends_lib     path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                port:libart_lgpl \
                port:libglade2

use_bzip2       yes

patchfiles      patch-libgnomecanvas-gnome-canvas-widget.c.diff

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
}

configure.cmd   ./autogen.sh

configure.args  --enable-glade

test.run        yes
test.target     check

pre-test {
    set libdirs {}
    fs-traverse {dir} ${worksrcpath} {
        if {[file tail ${dir}] == ".libs" && [file isdirectory ${dir}]} {
            lappend libdirs ${dir}

            continue
        }
    }

    test.env    DYLD_LIBRARY_PATH=[join ${libdirs} :]
}

livecheck.type  gnome
