# -*- 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 PortGroup python 1.0 name youtube-dl if {${subport} eq ${name}} { github.setup ytdl-org ${subport} 2021.12.17 revision 3 checksums rmd160 beca02d231a287488cecffe4c98651b4d6537b9d \ sha256 9f3b99c8b778455165b4525f21505e86c7ff565f3ac319e19733d810194135df \ size 3332299 homepage https://${github.author}.github.io/${github.project}/ python.pep517_backend setuptools set symlinks [list \ etc/bash_completion.d/${subport}.bash-completion \ etc/fish/completions/${subport}.fish \ share/man/man1/${subport}.1 \ share/zsh/site-functions/_${subport} \ ] post-destroot { # https://github.com/ytdl-org/youtube-dl/issues/9231 xinstall -d ${destroot}${python.prefix}/share/zsh/site-functions xinstall -m 0644 ${worksrcpath}/youtube-dl.zsh \ ${destroot}${python.prefix}/share/zsh/site-functions/_youtube-dl } livecheck.type regex livecheck.url ${homepage}/latest/version livecheck.regex {^([0-9.]+)$} } subport yt-dlp { github.setup yt-dlp ${subport} 2024.11.04 revision 0 checksums rmd160 81868df69e2e2e6c38defb09baac697c8174688a \ sha256 0ae3767c48d90d7fd6c5cb5a3d9fcb954441d984abf20c077d5f5bc0789b9aa4 \ size 5790714 dist_subdir ${subport}/${version} distname ${subport} python.pep517_backend hatch set symlinks [list \ share/bash-completion/completions/${subport} \ share/fish/vendor_completions.d/${subport}.fish \ share/man/man1/${subport}.1 \ share/zsh/site-functions/_${subport} \ ] } categories net maintainers {ryandesign @ryandesign} supported_archs noarch platforms {darwin any} license public-domain installs_libs no description command-line program to download videos from YouTube.com and other sites long_description ${name} is a small {*}${description}. github.tarball_from releases worksrcdir ${subport} patchfiles-append ${subport}-config-location.patch \ ${subport}-update.patch post-patch { if {${subport} eq ${name}} { set optfile options.py } else { set optfile utils/_utils.py } reinplace -W ${worksrcpath} "s|@PREFIX@|${prefix}|g" \ README.md \ ${subport}.1 \ [string map {- _} ${subport}]/${optfile} } post-destroot { foreach f ${symlinks} { xinstall -d ${destroot}${prefix}/[file dirname ${f}] ln -s ${python.prefix}/${f} ${destroot}${prefix}/${f} } set docdir ${prefix}/share/doc/${subport} xinstall -d ${destroot}${docdir} xinstall -m 0644 -W ${worksrcpath} LICENSE README.md ${destroot}${docdir} } variant ffmpeg description {Add ffmpeg dependency, used to extract audio} { depends_run-append path:bin/AtomicParsley:AtomicParsley \ path:bin/ffmpeg:ffmpeg } default_variants +ffmpeg variant python38 conflicts python39 python310 python311 python312 description {Use Python 3.8} {} variant python39 conflicts python38 python310 python311 python312 description {Use Python 3.9} {} variant python310 conflicts python38 python39 python311 python312 description {Use Python 3.10} {} variant python311 conflicts python38 python39 python310 python312 description {Use Python 3.11} {} variant python312 conflicts python38 python39 python310 python311 description {Use Python 3.12} {} if {![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311] && ![variant_isset python312]} { default_variants +python312 } if {[variant_isset python38]} { python.default_version 38 } elseif {[variant_isset python39]} { python.default_version 39 } elseif {[variant_isset python310]} { python.default_version 310 } elseif {[variant_isset python311]} { python.default_version 311 } elseif {[variant_isset python312]} { python.default_version 312 } # WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg depends_lib-append port:py${python.version}-pycryptodome