# -*- 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 50913 2009-05-12 17:56:12Z devans@macports.org $

PortSystem 1.0

name            inkscape
version         0.46
revision        9
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 59997096c3640b2601c2b4afba8a3d75 \
                sha1 ca68fc9bf539d7bcfc31f36d24f884255b2154e7

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

patchfiles      patch-configure.diff \
                patch-src-Makefile.in.diff \
                patch-src-widgets-sp-xmlview-attr-list.h.diff \
                patch-src-extension-internal-pdfinput-pdf-parser.cpp.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.5

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.5\"|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
}

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

