# -*- 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 90375 2012-03-03 23:18:42Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0
PortGroup           qt4 1.0

name                scribus
epoch               1
version             1.4.0
categories          print
platforms           darwin
maintainers         nomaintainer

description         qt4-based WYSIWYG desktop publishing application

long_description    Scribus is an open source desktop publishing program. It \
                    provides true WYSIWYG editing, excellent PDF export \
                    facilities, and a wide range of other input and output \
                    options.

homepage            http://www.scribus.net/
master_sites        sourceforge:project/scribus/scribus/${version}
use_xz              yes

checksums           rmd160  572a98bfc49cdf5730d3322d9137d0c1206864d4 \
                    sha256  c3bddbb10f16c668b5e5d6cf609fe01ad0e18d7f11a12c0afa68cbd640e55dca

depends_build-append \
                    path:bin/perl:perl5

depends_lib-append  port:fontconfig \
                    port:ghostscript \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    port:boost \
                    port:expat \
                    port:libart_lgpl \
                    port:libiconv \
                    port:lcms \
                    port:libxml2 \
                    port:tiff \
                    port:zlib

set PyFRM           ${frameworks_dir}/Python.framework/Versions

configure.args-append \
                    -DCMAKE_INSTALL_PREFIX="${applications_dir}" \
                    -DWITH_PODOFO=NO

variant python26 conflicts python27 description {Add python 2.6 interface} {
    depends_lib-append      port:python26
    configure.args-append   -DPYTHON_LIBRARY="${prefix}/lib/libpython2.6.dylib"
    configure.args-append   -DPYTHON_INCLUDE_DIR="${PyFRM}/2.6/include/python2.6"
}

variant python27 conflicts python26 description {Add python 2.7 interface} {
    depends_lib-append      port:python27
    configure.args-append   -DPYTHON_LIBRARY="${prefix}/lib/libpython2.7.dylib"
    configure.args-append   -DPYTHON_INCLUDE_DIR="${PyFRM}/2.7/include/python2.7"
}

variant podofo description {Use podofo} {
    depends_lib-append      port:podofo
    configure.args-delete   -DWITH_PODOFO=NO
    configure.args-append   -DWITH_PODOFO=YES
}

build.env           HOME=${worksrcpath}
use_parallel_build  yes

#destroot.target     install-strip

# These can be uncommented to livecheck for the devel version
#livecheck.url       http://sourceforge.net/projects/scribus/files/scribus-devel/
#livecheck.regex     /scribus-devel/(\[a-z0-9\]+(\\.\[a-z0-9\]+)+)/
