# -*- 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 76664 2011-03-04 22:11:53Z ryandesign@macports.org $

PortSystem                  1.0

name                        MyPaint
set my_name                 mypaint
version                     0.9.1
homepage                    http://mypaint.info/
categories                  graphics
maintainers                 ryandesign
license                     GPL-2 LGPL
use_bzip2                   yes
platforms                   darwin
use_parallel_build          yes
distname                    ${my_name}-${version}

description                 a fast and easy graphics application for digital painters

long_description            ${name} is ${description}. It lets you focus on the art \
                            instead of the program. You work on your canvas with \
                            minimum distractions, bringing up the interface only \
                            when you need it.

master_sites                http://download.gna.org/mypaint/

checksums                   sha1    b2fe2e311619a4c4815cd698abd41e99b6692b43 \
                            rmd160  16bd0492b567822b5ea4d6e3153e73436828a728

depends_build               port:pkgconfig \
                            port:scons \
                            port:swig-python

depends_lib                 port:protobuf-python26 \
                            port:libpng \
                            port:py26-numpy \
                            port:py26-gtk

depends_run                 port:tango-icon-theme

patchfiles                  patch-SConstruct.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/SConstruct
}

use_configure               no

build.cmd                   scons
build.target
build.args                  prefix=${prefix}

destroot.destdir            prefix=${destroot}${prefix}

post-destroot {
    move ${destroot}${prefix}/lib/mypaint/_mypaintlib ${destroot}${prefix}/lib/mypaint/_mypaintlib.so
    
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        COPYING \
        LICENSE \
        README \
        ${docdir}
    
    set appdir ${destroot}${applications_dir}/${name}.app/Contents/MacOS
    xinstall -d ${appdir}
    xinstall -m 755 ${filespath}/${name}.in ${appdir}/${name}
    reinplace "s|@PREFIX@|${prefix}|g" ${appdir}/${name}
}

livecheck.type              regex
livecheck.url               [lindex ${master_sites} 0]
livecheck.regex             ${my_name}-(\[0-9.\]+)\\.tar
