#!/usr/bin/env beesh

# BEE_VERSION ffmpeg-4.3-0

# SRCURL[0]="https://ffmpeg.org/releases/ffmpeg-${PKGVERSION}.tar.bz2"
SRCURL[0]="https://beehive.molgen.mpg.de/ed9b3002fb491d704b548a97e1d00391/ffmpeg-4.3.tar.bz2"

# BEE_BUILDTYPE=autotools

# PATCHURL+=()

# EXCLUDE+=()

# build_in_sourcedir

# sourcesubdir_append src

#mee_extract() {
#    bee_extract "${@}"
#}

#mee_patch() {
#    bee_patch "${@}"
#}

mee_configure() {
    sed -i 's/-lflite"/-lflite -lasound"/' ${S}/configure
    start_cmd ${S}/configure \
        --prefix=${PREFIX}   \
        --enable-gpl         \
        --enable-version3    \
        --disable-static     \
        --enable-shared      \
        --disable-debug      \
        --enable-libass      \
        --enable-libfreetype \
        --enable-libmp3lame  \
        --enable-libopus     \
        --enable-libtheora   \
        --enable-libvorbis   \
        --enable-libvpx      \
        --enable-libx264     \
        --enable-libx265
}

mee_build() {
    bee_build

    cc ${B}/tools/qt-faststart.c -o ${B}/tools/qt-faststart
}

mee_install() {
    start_cmd make install DESTDIR=${D}

    install -v -m755 -d ${D}/${BINDIR}
    install -v -m755    ${B}/tools/qt-faststart ${D}/${BINDIR}
}

## by default this may be 'make install DESTDIR="${D}"'