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

name                libtranslate
version             0.99
revision            1
checksums           rmd160  a6776a45b6e60b38a308809973676d6b7da44fbf \
                    sha256  4b2becb139e51663022d9531c430ebcc81d8b26edc73f6ddc05707ff9950eb34 \
                    size    532516

categories          textproc
license             BSD
maintainers         nomaintainer

description         A natural language translation library

long_description    libtranslate is a library for translating text and \
                    web pages between natural languages. Its modular \
                    infrastructure allows to implement new translation \
                    services separately from the core library. \
                    libtranslate is shipped with a generic module \
                    supporting web-based translation services such as \
                    Babel Fish, Google Language Tools and SYSTRAN. \
                    Moreover, the generic module allows to add new \
                    services simply by adding a few lines to a XML \
                    file. The libtranslate distribution includes a \
                    powerful command line interface (see translate(1)).

homepage            https://www.nongnu.org/libtranslate/
master_sites        https://download.savannah.nongnu.org/releases/libtranslate/

depends_build       port:intltool \
                    port:pkgconfig

depends_lib         port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:libiconv

patchfiles          remove-intltool-perl-hack.diff \
                    implicit.patch \
                    dynamic_lookup-11.patch

configure.args      --disable-talkfilters \
                    --disable-generic \
                    --mandir=${prefix}/share/man

platform darwin arm {
    depends_build-append    port:automake

    post-patch {
        # Use newer config.guess and config.sub to support Apple Silicon.
        set automake_dirs [glob -directory ${prefix}/share automake-*]
        set automake_dir [lindex [lsort -command vercmp $automake_dirs] end]
        copy -force ${automake_dir}/config.guess ${automake_dir}/config.sub \
            ${worksrcpath}
    }
}
