# $Id: Portfile 89879 2012-02-14 00:35:57Z cal@macports.org $

PortSystem          1.0

name                diffuse
version             0.4.6
categories          devel
platforms           darwin
maintainers         tommyd openmaintainer
license             GPL-2+
supported_archs     noarch

description         diffuse is a graphical diffing and merging tool
long_description    Ddiffuse is a small and simple text merge tool \
                    written in Python. With Diffuse, you can easily \
                    merge, edit, and review changes to your code.

homepage            http://diffuse.sourceforge.net
master_sites        sourceforge

checksums           sha256  748922902573de316a4829f1ccc2cb6fab218b4aaf69a1a4aadba7fd8f8fd916 \
                    rmd160  4545012a068d71292c7382cda41559472968777f

use_bzip2           yes

set pythonexec ""

variant python24 conflicts python25 python26 python27 description {Use python24} {
    depends_lib-append    port:py-gtk2
    set pythonexec        ${prefix}/bin/python2.4
}

variant python25 conflicts python24 python26 python27 description {Use python25} {
    depends_lib-append    port:py25-gtk
    set pythonexec        ${prefix}/bin/python2.5
}

variant python26 conflicts python24 python25 python27 description {Use python26} {
    depends_lib-append    port:py26-gtk
    set pythonexec        ${prefix}/bin/python2.6
}

variant python27 conflicts python24 python25 python26 description {Use python27} {
    depends_lib-append    port:py27-gtk
    set pythonexec        ${prefix}/bin/python2.7
}

if {![variant_isset python24] && ![variant_isset python25] && ![variant_isset python26]} {
    default_variants +python27
}

use_configure       no

post-patch {
    reinplace "s|/usr/bin/env python|${pythonexec}|g" \
        ${worksrcpath}/src/usr/bin/diffuse
}

build {}

destroot {
    system "cd ${worksrcpath} && ${pythonexec} \
       ./install.py \
       --prefix=${prefix} \
       --destdir=${destroot} \
       --sysconfdir=${prefix}/etc"
}
