# Preparations to support the system ffmpeg. Currently fails because it depends on files the system ffmpeg doesn't install.
rm -rf cmake/admFFmpeg* cmake/ffmpeg* avidemux_core/ffmpeg_package buildCore/ffmpeg || die "Failed to remove ffmpeg."
sed -i -e 's/include(admFFmpegUtil)//g' avidemux/commonCmakeApplication.cmake || die "Failed to remove ffmpeg."
sed -i -e '/registerFFmpeg/d' avidemux/commonCmakeApplication.cmake || die "Failed to remove ffmpeg."
sed -i -e 's/include(admFFmpegBuild)//g' avidemux_core/CMakeLists.txt || die "Failed to remove ffmpeg."
else
# Avoid existing avidemux installations from making the build process fail, bug #461496.
sed -i -e "s:getFfmpegLibNames(\"\${sourceDir}\"):getFfmpegLibNames(\"${S}/buildCore/ffmpeg/source/\"):g" cmake/admFFmpegUtil.cmake || die "Failed to avoid existing avidemux installation from making the build fail."
fi
}
src_configure(){
local x mycmakeargs
mycmakeargs="
$(cmake-utils_use nls GETTEXT)
$(cmake-utils_use sdl SDL)
$(cmake-utils_use vdpau VDPAU)
$(cmake-utils_use xv XVIDEO)
"
use debug &&POSTFIX="_debug"&&mycmakeargs+="-DVERBOSE=1 -DCMAKE_BUILD_TYPE=Debug"
mkdir "${S}"/buildCore || die "Can't create build folder."
cd"${S}"/buildCore || die "Can't enter build folder."
cmake -DAVIDEMUX_SOURCE_DIR="${S}"\
-DCMAKE_INSTALL_PREFIX="/usr"\
${mycmakeargs} -G "Unix Makefiles" ../"avidemux_core${POSTFIX}/"|| die "cmake failed."
}
src_compile(){
# Add lax vector typing for PowerPC.
if use ppc || use ppc64 ;then
append-cflags -flax-vector-conversions
fi
# See bug 432322.
use x86 && replace-flags -O0 -O1
# TODO: Report -j1 problem upstream, seems to be within ffmpeg code.
cd"${S}"/buildCore || die "Can't enter build folder."
emake -j1 CC="$(tc-getCC)"CXX="$(tc-getCXX)"
}
src_install(){
# TODO: Report -j1 problem upstream, seems to be within ffmpeg code.
cd"${S}"/buildCore || die "Can't enter build folder."