# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem                  1.0
PortGroup                   github 1.0
PortGroup                   legacysupport 1.1
PortGroup                   makefile 1.0

# Only for wrapper:
legacysupport.newest_darwin_requires_legacy 0
legacysupport.redirect_bins untrunc

# Gentoo uses this fork:
# https://github.com/gentoo/gentoo/blob/1008d86b0e346ca101db3a95bde9474a0495a83f/media-video/untrunc/untrunc-0_pre20240814.ebuild
github.setup                anthwlock untrunc 13cafedf59369db478af537fb909f0d7fd0eb85f
version                     2024.08.15
revision                    0
categories                  multimedia
maintainers                 {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license                     GPL-2
description                 Restore a truncated mp4/mov
long_description            {*}${description}. Improved version of ponchio/untrunc.
checksums                   rmd160  e67405e91efd9160181e5b25ddeee2711fa0f07e \
                            sha256  dde668893161ef82241b1ad87405be299786cca39f2a7482ffd95fa1652a19a3 \
                            size    82313
github.tarball_from         archive

patchfiles                  patch-makefile.diff \
                            patch-file.h.diff \
                            untrunc-0_pre20240814-ffmpeg8.patch

set ffmpeg_v                7

depends_lib-append          port:ffmpeg${ffmpeg_v}

post-patch {
    reinplace "s|@FFMPEG_ROOT@|${prefix}/libexec/ffmpeg${ffmpeg_v}|" ${worksrcpath}/Makefile
}

compiler.cxx_standard       2017

build.target                FF_VER=shared

destroot {
    copy ${worksrcpath}/${name} ${destroot}${prefix}/bin/
}
