--- /usr/portage/media-video/ffmpeg/ffmpeg-9999.ebuild 2016-09-30 12:20:42.034388420 +0200 +++ ffmpeg-9999.ebuild 2016-10-02 00:12:26.961968235 +0200 @@ -91,13 +91,13 @@ # Same as above but for encoders, i.e. they do something only with USE=encode. FFMPEG_ENCODER_FLAG_MAP=( amrenc:libvo-amrwbenc mp3:libmp3lame - faac:libfaac kvazaar:libkvazaar nvenc:nvenc + kvazaar:libkvazaar nvenc:nvenc openh264:libopenh264 snappy:libsnappy theora:libtheora twolame:libtwolame wavpack:libwavpack webp:libwebp x264:libx264 x265:libx265 xvid:libxvid ) IUSE=" - alsa doc +encode jack oss pic static-libs test v4l + alsa cuda doc +encode jack libnpp nasm oss pic static-libs test v4l ${FFMPEG_FLAG_MAP[@]%:*} ${FFMPEG_ENCODER_FLAG_MAP[@]%:*} " @@ -162,13 +162,12 @@ cdio? ( >=dev-libs/libcdio-paranoia-0.90_p1-r1[${MULTILIB_USEDEP}] ) celt? ( >=media-libs/celt-0.11.1-r1[${MULTILIB_USEDEP}] ) chromaprint? ( >=media-libs/chromaprint-1.2-r1[${MULTILIB_USEDEP}] ) + cuda? ( >=x11-drivers/nvidia-drivers-367.35 >=dev-util/nvidia-cuda-toolkit-7.5 ) ebur128? ( >=media-libs/libebur128-1.1.0[${MULTILIB_USEDEP}] ) encode? ( amrenc? ( >=media-libs/vo-amrwbenc-0.1.2-r1[${MULTILIB_USEDEP}] ) - faac? ( >=media-libs/faac-1.28-r3[${MULTILIB_USEDEP}] ) kvazaar? ( media-libs/kvazaar[${MULTILIB_USEDEP}] ) mp3? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] ) - nvenc? ( media-video/nvidia_video_sdk ) openh264? ( >=media-libs/openh264-1.4.0-r1[${MULTILIB_USEDEP}] ) snappy? ( >=app-arch/snappy-1.1.2-r1[${MULTILIB_USEDEP}] ) theora? ( @@ -251,7 +250,10 @@ doc? ( sys-apps/texinfo ) >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] ladspa? ( >=media-libs/ladspa-sdk-1.13-r2[${MULTILIB_USEDEP}] ) - cpu_flags_x86_mmx? ( >=dev-lang/yasm-1.2 ) + cpu_flags_x86_mmx? ( + !nasm? ( || ( >=dev-lang/yasm-1.2 dev-lang/nasm ) ) + nasm? ( dev-lang/nasm ) + ) test? ( net-misc/wget sys-devel/bc ) v4l? ( sys-kernel/linux-headers ) " @@ -274,14 +276,16 @@ ) " REQUIRED_USE=" + cuda? ( abi_x86_64 ) + libnpp? ( cuda ) libv4l? ( v4l ) fftools_cws2fws? ( zlib ) test? ( encode ) ${GPL_REQUIRED_USE} ${CPU_REQUIRED_USE}" RESTRICT=" - encode? ( faac? ( bindist ) ) gpl? ( openssl? ( bindist ) fdk? ( bindist ) ) + cuda? ( bindist ) " S=${WORKDIR}/${P/_/-} @@ -299,6 +303,8 @@ multilib_src_configure() { local myconf=( ${EXTRA_FFMPEG_CONF} ) + local extra_cflags=() + local extra_ldflags=() local ffuse=( "${FFMPEG_FLAG_MAP[@]}" ) use openssl && use gpl && myconf+=( --enable-nonfree ) @@ -312,9 +318,6 @@ if use amrenc ; then myconf+=( --enable-version3 ) fi - if use faac ; then - myconf+=( --enable-nonfree ) - fi else myconf+=( --disable-encoders ) fi @@ -327,9 +330,10 @@ use xcb || ffuse+=( X:x11grab ) # Outdevs - for i in alsa oss sdl ; do + for i in alsa oss ; do use ${i} || myconf+=( --disable-outdev=${i} ) done + use sdl || myconf+=( --disable-outdev=sdl2 ) # Decoders use amr && myconf+=( --enable-version3 ) @@ -340,6 +344,15 @@ myconf+=( $(use_enable ${i%:*} ${i#*:}) ) done + if [[ ${ABI} == amd64 ]] && use cuda; then + myconf+=( --enable-nonfree --enable-cuda ) + use libnpp && myconf+=( --enable-libnpp ) + extra_cflags+=( "-I/opt/cuda/include" ) + extra_ldflags+=( "-L/opt/cuda/lib64" ) + fi + + use nasm && myconf+=( --yasmexe=nasm ) + # (temporarily) disable non-multilib deps if ! multilib_is_native_abi; then for i in frei0r ; do @@ -421,6 +434,8 @@ --cxx="$(tc-getCXX)" \ --ar="$(tc-getAR)" \ --optflags="${CFLAGS}" \ + --extra-cflags="${extra_cflags[*]}" \ + --extra-ldflags="${extra_ldflags[*]}" \ $(use_enable static-libs static) \ "${myconf[@]}" echo "${@}"