Improve options for i686

Removed cuvid and cuda (actually named ffnvcodec on current ffmpeg
git master) from the x86_64 specific options (it can be build with
them on i686). Only cuda_sdk and libnpp seems to be x86_64 specific
(at least from the build perspective).

also on this commit:
- improved command to detect presence of nvidia-340xx-utils
- removed nvidia-304xx-utils from being searched (not maintained
  anymore, was dropped from official repositories and currently
  there is no AUR package for it).
- moved the nvcc path configuration to the prepare() function
- cosmetic changes
This commit is contained in:
Daniel Bermond
2018-03-06 21:40:31 -03:00
parent b3182982b6
commit f78673d829
2 changed files with 19 additions and 20 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
pkgbase = ffmpeg-full pkgbase = ffmpeg-full
pkgdesc = Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac) pkgdesc = Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac)
pkgver = 3.4.2 pkgver = 3.4.2
pkgrel = 1 pkgrel = 2
url = http://www.ffmpeg.org/ url = http://www.ffmpeg.org/
arch = i686 arch = i686
arch = x86_64 arch = x86_64
+18 -19
View File
@@ -4,7 +4,7 @@
pkgname=ffmpeg-full pkgname=ffmpeg-full
_srcname=ffmpeg _srcname=ffmpeg
pkgver=3.4.2 pkgver=3.4.2
pkgrel=1 pkgrel=2
pkgdesc='Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac)' pkgdesc='Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac)'
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url='http://www.ffmpeg.org/' url='http://www.ffmpeg.org/'
@@ -59,6 +59,10 @@ sha256sums=('2b92e9578ef8b3e49eeab229e69305f5f4cbc1fdaa22e927fc7fca18acccd740'
prepare() { prepare() {
cd "${_srcname}-${pkgver}" cd "${_srcname}-${pkgver}"
# strictly specifying nvcc path is needed if package is installing
# cuda for the first time (nvcc path will be in $PATH only after relogin)
sed -i "s|^nvcc_default=.*|nvcc_default='/opt/cuda/bin/nvcc'|" configure
patch -Np1 -i "${srcdir}/ffmpeg-full-rkmpp-build-fix.patch" patch -Np1 -i "${srcdir}/ffmpeg-full-rkmpp-build-fix.patch"
patch -Np1 -i "${srcdir}/ffmpeg-full-rkmpp-remove-stream-start.patch" patch -Np1 -i "${srcdir}/ffmpeg-full-rkmpp-remove-stream-start.patch"
} }
@@ -69,34 +73,28 @@ build() {
# set x86_64 specific options # set x86_64 specific options
if [ "$CARCH" = 'x86_64' ] if [ "$CARCH" = 'x86_64' ]
then then
local _cuda='--enable-cuda'
local _cudasdk='--enable-cuda-sdk' local _cudasdk='--enable-cuda-sdk'
local _cuvid='--enable-cuvid'
local _libnpp='--enable-libnpp' local _libnpp='--enable-libnpp'
local _cflags='-I/opt/cuda/include'
# '-L/usr/lib/nvidia' (for cuda_sdk) needs to be enabled only on local _cflags='-I/opt/cuda/include'
# systems with nvidia-340xx-utils or nvidia-304xx-utils local _ldflags='-L/opt/cuda/lib64'
if pacman -Qqs '^nvidia-340xx-utils$' | grep -q '^nvidia-340xx-utils$' ||
pacman -Qqs '^nvidia-304xx-utils$' | grep -q '^nvidia-304xx-utils$' # set path of -lcuda (libcuda.so.x, required by cuda_sdk)
# on systems with legacy nvidia drivers
if pacman -Qs '^nvidia-340xx-utils' >/dev/null 2>&1
then then
local _nvidia_340xx_ldflags='-L/usr/lib/nvidia' _ldflags="${_ldflags} -L/usr/lib/nvidia"
fi fi
local _ldflags="-L/opt/cuda/lib64 ${_nvidia_340xx_ldflags}" _ldflags="${_ldflags} -Wl,-rpath -Wl,/opt/intel/mediasdk/lib64:/opt/intel/mediasdk/plugins"
local _ldflags="${_ldflags} -Wl,-rpath -Wl,/opt/intel/mediasdk/lib64:/opt/intel/mediasdk/plugins"
# strictly specifying nvcc path is needed if package is installing
# cuda for the first time (nvcc path will be in $PATH only after relogin)
sed -i "s@^nvcc_default=.*@nvcc_default='/opt/cuda/bin/nvcc'@" configure
fi fi
msg2 'Running ffmpeg configure script. Please wait...' msg2 'Running ffmpeg configure script. Please wait...'
./configure \ ./configure \
--prefix='/usr' \ --prefix='/usr' \
--extra-cflags="${_cflags}" \ --extra-cflags="$_cflags" \
--extra-ldflags="${_ldflags}" \ --extra-ldflags="$_ldflags" \
\ \
--disable-rpath \ --disable-rpath \
--enable-gpl \ --enable-gpl \
@@ -190,9 +188,9 @@ build() {
--enable-xlib \ --enable-xlib \
--enable-zlib \ --enable-zlib \
\ \
$_cuda \ --enable-cuda \
$_cudasdk \ $_cudasdk \
$_cuvid \ --enable-cuvid \
--enable-libdrm \ --enable-libdrm \
--enable-libmfx \ --enable-libmfx \
$_libnpp \ $_libnpp \
@@ -202,6 +200,7 @@ build() {
--enable-rkmpp \ --enable-rkmpp \
--enable-vaapi \ --enable-vaapi \
--enable-vdpau --enable-vdpau
make make
make tools/qt-faststart make tools/qt-faststart
} }