# -*- 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 107463 2013-06-30 02:27:05Z devans@macports.org $

PortSystem      1.0

name            yelp
version         2.31.6
revision        1
license         GPL-2
set branch      [join [lrange [split ${version} .] 0 1] .]
description     Help browser for GNOME.
long_description \
                Yelp is the default help browser for the \
                GNOME desktop. Yelp provides a simple graphical \
                interface for viewing DocBook, HTML, man, and info \
                formatted documentation.
maintainers     devans openmaintainer
categories      gnome
platforms       darwin
homepage        http://www.gnome.org/
master_sites    gnome:sources/${name}/${branch}/

use_bzip2       yes

checksums       sha256  9f6080b79cbf4b73d682c47088b7320c871ae5c3ee3d38c86aa83321b444dede \
                rmd160  5eddca1e9f63982f6158c060537900f9e13722d3

depends_build   port:pkgconfig \
                port:intltool \
                port:gnome-common \
                port:gnome-doc-utils

depends_lib     port:desktop-file-utils \
                port:gconf \
                port:startup-notification \
                port:xz \
                port:pangox-compat \
                port:webkit-gtk \
                port:yelp-xsl

#
# if yelp is invoked without a URI argument
# it defaults to ghelp:user-guide
#

depends_run     port:gnome-user-docs

patchfiles      patch-src-yelp-application.c.diff \
                patch-yelp.desktop.in.in.diff \
                patch-configure.ac.diff

#
# compiling yelp-2.31.6 with -O1 or higher produces a binary that segfaults on startup
# TODO: find out why
#
configure.optflags-delete -Os -O1 -O2 -O3

use_autoreconf  yes
autoreconf.args -fvi

configure.args  --x-includes=${prefix}/include \
                --x-libraries=${prefix}/lib \
                --with-x \
                --disable-schemas-compile \
                --disable-silent-rules \
                --enable-debug

# This is masking a real bug which should be fixed...
configure.cflags-append -Wno-error=return-type

post-activate {
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
}

livecheck.type  gnome-with-unstable
