# -*- 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 67589 2010-05-13 17:41:26Z macsforever2000@macports.org $

PortSystem 1.0

name            inkscape
conflicts       inkscape-devel
version         0.47
revision        2
maintainers     devans
categories      graphics gnome
platforms       darwin
homepage        http://www.inkscape.org/

description     Inkscape is an open source SVG editor.

long_description \
                Inkscape is an open source SVG editor with \
                capabilities similar to Illustrator, CorelDraw, \
                Visio, etc. Supported SVG features include basic \
                shapes, paths, text, alpha blending, transforms, \
                gradients, node editing, svg-to-png export, \
                grouping, and more.

universal_variant no

use_bzip2       yes
master_sites    sourceforge
checksums       md5 7b497c8f673e40b05295a29f6e2111f4 \
                sha1 7c75352f3882ebf4fcaebc22413bcb79bf3b7895

depends_lib     port:libgnomeprintui \
                port:boehmgc \
                port:gsl \
                port:gtkmm \
                port:gnome-vfs \
                port:libxslt \
                port:lcms \
                port:dbus \
                port:dbus-glib \
                port:py26-xml \
                port:libcroco \
                port:poppler \
                port:py26-numpy \
                port:py26-lxml \
                port:boost \
                port:ImageMagick \
                port:libwpg

patchfiles      patch-configure.diff \
                patch-poppler-0.12.2.diff

configure.args  \
        --mandir=${prefix}/share/man \
        --with-xft \
        --with-gnome-print \
        --with-gnome-vfs \
        --with-python \
        --enable-lcms \
        --enable-inkboard

configure.python \
        ${prefix}/bin/python2.6

configure.cppflags-append \
        -I${worksrcpath}/src/extension/script

default_variants \
        disable_debugging

variant disable_debugging conflicts enable_debugging description {Disable debugging. Strip executables to save disk space} {
        # this variant strips the executables saving @200MB of disk space
        # at the cost of not being able to get meaningful debugging information
        # in the event of an application crash
        post-destroot {
            system "strip ${destroot}${prefix}/bin/inkscape"
            system "strip ${destroot}${prefix}/bin/inkview"
        }
}

variant enable_debugging conflicts disable_debugging description {Enable debugging. Executables not stripped} {
        # does nothing but offer a counter-point to disable_debugging
}

post-patch {
        reinplace "s|\"python-interpreter\", \"python\"|\"python-interpreter\", \"python2.6\"|g" ${worksrcpath}/src/extension/implementation/script.cpp
        reinplace "s|^#include \"Object.h\"|#include \"${prefix}/include/poppler/Object.h\"|" ${worksrcpath}/src/extension/internal/pdfinput/pdf-parser.h
        reinplace "s|^#include \"Object.h\"|#include \"${prefix}/include/poppler/Object.h\"|" ${worksrcpath}/src/extension/internal/pdfinput/pdf-parser.cpp
}

livecheck.type          regex
livecheck.url           http://sourceforge.net/export/rss2_projfiles.php?project=${name}
livecheck.regex         <title>${name} (\[0-9.\]+) released.*</title>

