# -*- 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 108339 2013-07-20 00:34:43Z dports@macports.org $

PortSystem              1.0

name                    goffice
epoch                   1
version                 0.10.4

set branch              [join [lrange [split ${version} .] 0 1] .]
description             GOffice is a library of document-centric objects and utilities.
long_description        GOffice is a library of document-centric objects \
                        and utilities building on top of GLib and Gtk+ and \
                        used by software such as Gnumeric.
maintainers             nomaintainer
categories              gnome devel
platforms               darwin
license                 {GPL-2 GPL-3}

homepage                http://freecode.com/projects/goffice
master_sites            gnome:sources/${name}/${branch}/
use_xz                  yes

checksums               rmd160  c81ab86f437f7c959e8d94583884c2cd579cc799 \
                        sha256  30cb91693abff241e1b14b741ac23bc588f428b4524b12e3fecd1ea3f0bc67ba

depends_build           port:intltool \
                        port:pkgconfig

depends_lib             port:gtk3 \
                        port:libgsf \
                        port:librsvg \
                        path:lib/pkgconfig/glib-2.0.pc:glib2

use_parallel_build      yes

livecheck.type          gnome


# Snapshot of goffice @0.8.17 for gnucash.
# Can be removed once gnucash no longer needs this version.

subport goffice08 {
    version             0.8.17

    master_sites        gnome:sources/${name}/0.8/
    
    checksums           sha256  165070beb67b84580afe80a8a100b674a81d553ab791acd72ac0c655f4fadb15 \
                        rmd160  91d1df371c8164c8c5c9860c7c9c87b9fb69f6c3

    license             GPL-2

    depends_lib         port:gconf \
                        port:libgsf \
                        port:libxml2 \
                        port:pcre

    patchfiles-append   patch-goffice-utils-regutf8.c.diff

    pre-activate {
        if {![catch {set installed [lindex [registry_active goffice] 0]}]} {
            set _version [lindex $installed 1]
            if {[vercmp $_version 0.10] < 0} {
                registry_deactivate_composite goffice "" [list ports_nodepcheck 1]
            }
        }
    }
}
