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

legacysupport.newest_darwin_requires_legacy 9
legacysupport.redirect_bins pstoedit

name                pstoedit
version             4.01
revision            0
checksums           rmd160  13c8b21223192912bc2b9b7e3207c05181c8e850 \
                    sha256  459765ab736cb10f9554a7ac02c5ea7f355c6c2e9fcfd217611c7d5102b1076b \
                    size    1335475

categories          graphics
maintainers         nomaintainer
license             GPL-2+

description         Translate PostScript and PDF to other vector formats

long_description    pstoedit converts PostScript™ and PDF files to other \
                    vector graphic formats so that they can be edited \
                    graphically.

homepage            http://www.pstoedit.net
master_sites        sourceforge:project/pstoedit/pstoedit/${version}

depends_build       path:bin/pkg-config:pkgconfig

depends_lib         port:ImageMagick \
                    port:libzip \
                    port:plotutils

depends_run         port:ghostscript

patchfiles          patch-config-pstoedit.pc.in.diff \
                    patch-configure.ac.diff \
                    patch-src-cppcomp.h.diff

use_autoreconf      yes

configure.args      --without-emf \
                    --without-swf

# This disables *rebuilding* of docs; the ones included in the
# distfile are still installed. Needed because rebuilding requires
# latex2man which is in texlive-bin-extra, but texlive-bin-extra
# depends on this port. See https://trac.macports.org/ticket/65674
configure.args-append       --disable-docs

configure.cppflags-append   -Wno-long-long

# drvpdf.cpp:46:14: warning: variable declaration in a constexpr function is a C++14 extension [-Wc++14-extensions]
# although clangs up to clang-9 let this through with a warning,
# gcc generates an error and will not build unless proper std=c++14 is set
compiler.cxx_standard   2014
configure.cxxflags-append   -std=c++14

use_parallel_build  no

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/man/man1 \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath}/doc pstoedit.1 \
        ${destroot}${prefix}/share/man/man1
    xinstall -m 644 {*}[glob -directory ${worksrcpath}/doc *.htm *.tex *.txt] \
        ${destroot}${prefix}/share/doc/${name}
}
