# -*- 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 119604 2014-05-02 09:12:57Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                hgview
version             1.8.0
categories-append   devel
license             GPL-2
platforms           darwin
supported_archs     noarch
maintainers         sean openmaintainer

homepage            http://www.logilab.org/project/${name}
master_sites        http://download.logilab.org/pub/${name}
description         A fast Mercurial log navigator
long_description    hgview is a simple tool aiming at visually navigate \
                    in a Mercurial repository history. It is written in \
                    Python with quick and efficient key-based navigation \
                    in mind, trying to be fast enough to be usable for \
                    big repositories.

depends_build-append port:asciidoc \
                    port:xmlto

depends_lib-append  path:bin/hg:mercurial \
                    port:py27-qscintilla \
                    port:py27-pygments \
                    port:py27-docutils \
                    port:py27-urwid

checksums           rmd160  f517d27fa882fe0e2e715842554a768c2f4a867a \
                    sha256  03c80316cd065378d28ee51452b4ef0617ff49fb145c9b16bfb3bd87126cedfd

conflicts           ${name}-devel

python.versions     27
python.link_binaries_suffix

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     >${name}-(\[0-9.\]+)${extract.suffix}

post-patch {
    reinplace -W $worksrcpath "s,pyrcc4,pyrcc4-2.7," setup.py
    reinplace -W $worksrcpath "s,pyrcc4,pyrcc4-2.7," hgviewlib/qt4/__init__.py
    reinplace -W $worksrcpath "s,pyuic4,pyuic4-2.7," hgviewlib/qt4/hgdialogmixin.py
}

post-destroot {
    move ${destroot}${python.pkgd}/hgext/hgview.py ${destroot}${python.pkgd}/hgview.py
    move ${destroot}${python.pkgd}/hgext/hgview.pyc ${destroot}${python.pkgd}/hgview.pyc
}

subport ${name}-devel {
    version         1.7.99
    revision        1
    fetch.type      hg
    hg.url          http://hg.logilab.org/master/hgview/
    hg.tag          b115909fe347
    conflicts       ${name}
    livecheck.type  none
}

notes               "
To enable ${name}, add the following to your ~/.hgrc:

\[extensions\]
${name} =
"
