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

github.setup        rrthomas recode 3.7.15 v
revision            0
checksums           rmd160  c46290e331c8d99a20bbcc7b6cb7cf5f7add76ad \
                    sha256  f590407fc51badb351973fc1333ee33111f05ec83a8f954fd8cf0c5e30439806 \
                    size    2358971

categories          textproc
license             GPL-3+
maintainers         {ryandesign @ryandesign} openmaintainer

description         charset conversion program

long_description    This recode program has the purpose of converting files \
                    between various character sets and usages. When exact \
                    transliterations are not possible, as it is often the \
                    case, the program may get rid of the offending characters \
                    or fall back on approximations.

github.tarball_from releases

set python.branch   3.13
set python.version  [join [split ${python.branch} "."] ""]
set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}
set python.bin      ${python.prefix}/bin/python${python.branch}
set cython.bin      ${python.prefix}/bin/cython

depends_build       port:python${python.version}

depends_lib         port:gettext \
                    port:libiconv

depends_test        port:py${python.version}-cython

if {[string match *gcc* ${configure.compiler}]} {
    patchfiles-append \
                    pragma.patch
}

configure.checks.implicit_function_declaration.whitelist-append strchr

configure.python    ${python.bin}

configure.args      ac_cv_prog_CYTHON=${cython.bin}

post-destroot {
    delete ${destroot}${prefix}/lib/charset.alias
    delete ${destroot}${prefix}/share/info/dir

    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} AUTHORS COPYING COPYING-LIB ChangeLog \
        NEWS README THANKS TODO ${destroot}${docdir}
}

test.run            yes
test.target         check
