#!/usr/bin/env beesh

# BEE_VERSION ffmpeg-3.3.4-0

SRCURL[0]="https://ffmpeg.org/releases/ffmpeg-${PKGVERSION}.tar.bz2"

# BEE_BUILDTYPE=autotools

# PATCHURL+=()

# EXCLUDE+=()

# build_in_sourcedir

# sourcesubdir_append src

###############################################################################
## Change the default (auto-detected) steps to
## extract, patch, configure/setup, build and install the software.
## Make sure the mee_install function does install everything to the
## image directory "${D}"

#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}"'