# -*- 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 1 checksums rmd160 beca02d231a287488cecffe4c98651b4d6537b9d \ sha256 9f3b99c8b778455165b4525f21505e86c7ff565f3ac319e19733d810194135df \ size 3332299 homepage https://youtube-dl.org 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} 2023.03.04 revision 0 checksums rmd160 3cfc1d605d50853ded5eaa95d0f4e699cabbe66a \ sha256 771d2abefcd5f1e6f3ab6d6d18cdae98be4ab73538d1174e7e7236640418e150 \ size 5125843 dist_subdir ${subport}/${version} distname ${subport} 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.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 python37 conflicts python38 python39 python310 python311 description {Use Python 3.7} {} variant python38 conflicts python37 python39 python310 python311 description {Use Python 3.8} {} variant python39 conflicts python37 python38 python310 python311 description {Use Python 3.9} {} variant python310 conflicts python37 python38 python39 python311 description {Use Python 3.10} {} variant python311 conflicts python37 python38 python39 python310 description {Use Python 3.11} {} if {![variant_isset python37] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { default_variants +python311 } if {[variant_isset python37]} { python.default_version 37 } elseif {[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 } depends_build-append port:py${python.version}-setuptools # WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg depends_lib-append port:py${python.version}-pycryptodome