# -*- 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        klartext any-dl 6b079b70dc8d0ad2761e76fe05faa5917037ac44
version             2026.02.22
revision            1
categories          net ocaml www
license             GPL-3
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         ${name} is a generic mediathek-downloader
long_description    {*}${description}
checksums           rmd160  4dbe29ae9ff839772ecfcba63747e5d7c39f8352 \
                    sha256  e8fad469305966523ac373f8501f5376519d192ab25b130a888fce171c87817d \
                    size    91065
github.tarball_from archive

patchfiles          patch-fix-target.diff

depends_lib-append  path:lib/pkgconfig/gnutls.pc:gnutls \
                    port:ocaml \
                    port:ocaml-csv \
                    port:ocaml-ocamlnet \
                    port:ocaml-pcre \
                    port:ocaml-xmlm \
                    port:ocaml-yojson
depends_run-append  port:rtmpdump \
                    port:yt-dlp

use_configure       no

if {${configure.build_arch} in [list ppc ppc64]} {
    build.target    byte
}

# Error: Unbound module Parsetreetypes
use_parallel_build  no

destroot {
    copy ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    xinstall -d ${destroot}${prefix}/share/${name}
    xinstall -m 644 ${worksrcpath}/README ${destroot}${prefix}/share/${name}/
    xinstall -m 644 ${worksrcpath}/rc-file.adl ${destroot}${prefix}/etc/any-dl.rc
}

notes "
You may need to copy config file from ${prefix}/etc/any-dl.rc to ~/.config/
"
