# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                gdl
version             2.30.1
revision            6
license             LGPL
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          gnome devel
maintainers         nomaintainer
description         Provides docking features for GTK+ 2
long_description \
                    GNOME Docking Library provides docking features for GTK+ 2. \
                    This port provides gdl-2.0.  For gdl-3.0 see port gdl3.

platforms           darwin

homepage            http://www.anjuta.org/
master_sites        gnome:sources/${name}/${branch}/
use_bzip2           yes

checksums           rmd160  56cdb623c627504bceaffba91d338cae5bbe2955 \
                    sha256  027dd1cd0191996fe1a0dc902da857698cc79564cb057ba13b09097e56e30cc1 \
                    size    569211

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

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

patchfiles          returns.patch \
                    patch_glib_2.30_G_CONST_RETURN.diff

post-patch {
    # reconfigure using upstream autogen.sh for intltool 0.51 compatibility
    xinstall -m 0755 ${filespath}/autogen.sh ${worksrcpath}

    # Convert files processed by glib-mkenums to UTF-8 to avoid:
    # "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 7: ordinal not in range(128)"
    foreach f {gdl-dock-item.h gdl-dock-layout.h gdl-dock-master.h gdl-dock-object.h gdl-dock-placeholder.h} {
        system -W ${worksrcpath}/gdl "${prefix}/bin/iconv -f ISO8859-1 -t UTF-8 ${f} > ${f}.tmp && mv ${f}.tmp ${f}"
    }
}

configure.cmd       ./autogen.sh

configure.args      --disable-silent-rules

# this is the last stable version of gdl that provides gdl-2.0
livecheck.type      none
