# -*- 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 100349 2012-12-09 01:54:55Z g5pw@macports.org $

PortSystem              1.0

name                    inkscape-textext
version                 0.4.4
revision                2
categories              graphics tex
maintainers             gmail.com:jjstickel
license                 BSD
platforms               darwin
homepage                http://pav.iki.fi/software/textext/
master_sites            ${homepage}
distname                textext-${version}
worksrcdir              ${name}
supported_archs         noarch
extract.mkdir           yes
use_configure           no

description             LaTeX typesetting in Inkscape

long_description        Textext provides re-editable LaTeX objects to Inkscape’s \
                        repertoire.

checksums               sha256  4d3d262efc8b199dff407b6d153c8822ac9b30d46357e0cdc191c2c0f5fea077 \
                        rmd160  fcaf932207a5477562135b00be29445fc92e1caa
                    
depends_run             port:inkscape \
                        port:pdf2svg \
                        bin:pdflatex:texlive-latex

variant python26 conflicts python27 description {Configure to use Python version 2.6} {}
variant python27 conflicts python26 description {Configure to use Python version 2.7} {}

if { ![variant_isset python26] } {
	default_variants      +python27
}
if {[variant_isset python26]} {
    set python.version 26
} elseif {[variant_isset python27]} {
    set python.version 27
}

variant tkinter description {use py-tkinter backend} {
    depends_run-append  port:py${python.version}-tkinter
}
variant pygtk description {use py-gtk backend} {
    depends_run-append  port:py${python.version}-pygtk
}

default_variants-append    +pygtk

build {}

destroot {
    xinstall -d ${destroot}${prefix}/share/inkscape/extensions
    xinstall -m 644 ${worksrcpath}/textext.inx ${destroot}${prefix}/share/inkscape/extensions/textext.inx
    xinstall -m 755 ${worksrcpath}/textext.py ${destroot}${prefix}/share/inkscape/extensions/textext.py
}
