# -*- 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

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           qt4 1.0
PortGroup           boost 1.0

name                scribus
epoch               1
version             1.4.8
revision            7
categories          print
license             GPL-2+
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            https://www.scribus.net/
master_sites        sourceforge:project/scribus/scribus/${version}
use_xz              yes

checksums           rmd160  b145de40f078d37a32861791289c185e9582f00b \
                    sha256  22253bb5994023f39608b37c57c7cd0280059fd97d2a4d71d4011aeeeb18042f \
                    size    73114760

set py_ver          2.7
set py_ver_nodot    [string map {. {}} ${py_ver}]

depends_build-append \
                    path:bin/perl:perl5

depends_lib-append  port:hunspell \
                    port:fontconfig \
                    port:ghostscript \
                    port:hyphen \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    port:expat \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libart_lgpl \
                    port:libiconv \
                    port:lcms2 \
                    port:libpng\
                    port:libxml2 \
                    port:podofo \
                    port:python${py_ver_nodot} \
                    port:tiff \
                    port:zlib

patchfiles          arch-and-deployment-target.patch \
                    lib2geom.patch \
                    ordered-comparison.patch

# podofo requires C++11 with TLS
compiler.cxx_standard 2011
compiler.thread_local_storage yes
configure.cxxflags-append -std=c++11

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

cmake.install_prefix \
                    "${applications_dir}/[string toupper ${name} 0].app"

configure.args-append \
                    -DPYTHON_LIBRARY="${prefix}/lib/libpython${py_ver}.dylib" \
                    -DPYTHON_INCLUDE_DIR="${PyFRM}/${py_ver}/include/python${py_ver}" \
                    -DWITH_PODOFO=YES

livecheck.regex     "${name}-(\\d+\\.\\d*\[02468\](?:\\.\\d+)*)${extract.suffix}"
