# -*- 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 60579 2009-11-16 03:01:41Z ryandesign@macports.org $

PortSystem 1.0

name            inkscape-devel
conflicts       inkscape
set svn_rev     22457
version         0.46.${svn_rev}
epoch           1
maintainers     devans
categories      graphics gnome
platforms       darwin
homepage        http://www.inkscape.org/

description     Unstable development version of Inkscape from \
                recent SVN leading up to release of version 0.47.

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

fetch.type      svn

svn.url         http://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk
svn.revision    ${svn_rev}
worksrcdir      trunk

depends_build   port:pkgconfig \
                port:autoconf \
                port:automake \
                port:p5-xml-parser \
                port:intltool

depends_lib     port:boehmgc \
                port:poppler \
                port:lcms \
                port:libwpg \
                port:ImageMagick \
                port:gtkmm \
                port:aspell-dict-en \
                port:gtkspell2 \
                port:gsl \
                port:boost

depends_run     port:ghostscript

patchfiles      patch-autogen.sh.diff \
                patch-configure.ac.diff

configure.cmd   {./autogen.sh && ./configure}

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

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

variant no_x11 {
    configure.args-delete --with-xft
    configure.args-append --without-xft
}

variant enable_debugging description {Enable debugging. Executables not stripped} {
}

if {![variant_isset enable_debugging]} {

# if +enable_debugging is not set (default) strip the executables
# this saves @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"
    }
}

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
        reinplace "s|^#include \"Object.h\"|#include \"${prefix}/include/poppler/Object.h\"|" ${worksrcpath}/src/extension/internal/pdfinput/pdf-parser.cpp
}

livecheck.type           none
