# -*- 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
PortGroup           python 1.0

name                hgview
version             1.9.0
revision            1
categories          devel python
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.

python.default_version     27

depends_build-append port:asciidoc \
                    port:xmlto

depends_lib-append  path:bin/hg:mercurial \
                    port:py${python.version}-qscintilla-qt4 \
                    port:py${python.version}-pygments \
                    port:py${python.version}-docutils \
                    port:py${python.version}-urwid

checksums           rmd160  31ada351796ecd636c7a454f4fc0492e9c00d6d7 \
                    sha256  8b2e5e10544deaa79ba9ef3f6339e103af357edbeb4b2594be079fddf7b8e6ed

conflicts           ${name}-devel

livecheck.type      regex
livecheck.url       https://pypi.python.org/pypi/hgview
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/mixins.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        2
    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} =
"