# Maintainer: Luke Shumaker # Maintainer (Arch): Evangelos Foutras # Contributor (Arch): Giovanni Scafora # Contributor (Arch): Sebastien Piccand pkgname=('handbrake' 'handbrake-cli') pkgver=0.10.5 pkgrel=2.parabola3 url="http://handbrake.fr/" license=('GPL') arch=('i686' 'x86_64' 'armv7h') depends=('gcc-libs') _gui_depends=('libnotify' 'dbus-glib' 'gtk3' 'gst-plugins-base') makedepends=('intltool' 'python2' "${_gui_depends[@]}") source=(https://handbrake.fr/mirror/HandBrake-$pkgver.tar.bz2 libav-fix_libvpxenc.patch) # HandBrake has a bunch of dependencies that may be either pacman # packages, or built in the contrib/ directory as "modules". This is # a big config section to decide which dependencies are going to be # pacman packages, and which dependencies are going to be modules. # # This list should pretty closely correspond to # `grep contrib/ make/include/main.defs` # # The format for _depends[n] is: handbrake_name[:pacman_name] # The format for _modules[n] is: handbrake_name:tarball_name makedepends+=('pkgconfig') # module if FEATURE.local_pkgconfig makedepends+=('cmake') # module if FEATURE.local_cmake makedepends+=('autoconf') # module if FEATURE.local_autotools makedepends+=('automake') # module if FEATURE.local_autotools makedepends+=('libtool') # module if FEATURE.local_autotools makedepends+=('m4') # module if FEATURE.local_autotools depends+=('bzip2') # module if !HAS.bz2 depends+=('fontconfig') # module if on darwin, cygwin, or mingw depends+=('freetype2') # module if on darwin, cygwin, or mingw depends+=('fribidi') # module if on darwin, cygwin, or mingw depends+=('libxml2') # module if on darwin, cygwin, or mingw depends+=('libass') # module if on darwin, cygwin, or mingw depends+=('libogg') # module if on darwin, cygwin, or mingw depends+=('libvorbis') # module if on darwin, cygwin, or mingw depends+=('libtheora') # module if on darwin, cygwin, or mingw depends+=('libsamplerate') # module if on darwin, cygwin, or mingw depends+=('lame') # module if on darwin, cygwin, or mingw depends+=('libx264') # module if on darwin, cygwin, or mingw _depends+=('fdk-aac:libfdk-aac') # enable as module if FEATURE.fdk_aac _depends+=('x265') # enable as module if FEATURE.x265 # Using system ffmpeg will break PGS subtitle processing # https://forum.handbrake.fr/viewtopic.php?f=13&t=27581 _modules+=('ffmpeg:libav-v10.1.tar.bz2') # always a module _depends+=('libvpx') # always a module _depends+=('libdvdread') # always a module; also forced in Arch _depends+=('libdvdnav') # always a module; also forced in Arch _depends+=('libbluray') # always a module; also forced in Arch _depends+=('libgudev') # always a module; also forced in Arch #_depends+=('pthreadw32') # module if !HAS.pthread (glibc) #_depends+=('libmfx') # enable as module if FEATURE.qsv #_depends+=('libiconv') # module if !HAS.iconv (glibc) depends+=('zlib') # module if !HAS.libz #_depends+=('libgnurx') # module if !HAS.regex (glibc) makedepends+=('yasm') # module if FEATURE.local_yasm depends+=("${_depends[@]#*:}") source+=("${_modules[@]/#*:/http://download.handbrake.fr/handbrake/contrib/}") #noextract+=("${_modules[@]#*:}") # Lock the specific version of libx264, as it changes often. depends+=('libx264.so') sha256sums=('fb9230dd121b456f6829d1d25ac8bbf76e503b51c4efc70f0a7fd2bb8607e2f0' 'fabf99d9492345af058c502e83b613b23f939c7f9092c9e80aa260b72cbed595' 'bc3807426d4e73fe8c245730b0df4ba95766cf7e17e47c738ee302f73d066ac9') prepare() { # Fixing libav cd "$srcdir/libav-v10.1" patch -Np1 -i ../libav-fix_libvpxenc.patch cd "$srcdir/HandBrake-$pkgver" local dep # Use more system libraries for dep in "${_depends[@]}"; do sed -i \ -e "s/MODULES += contrib\/${dep%:*}\$/#& # provided by ${dep#*:}/" \ make/include/main.defs done echo 'TEST.GCC.l += fdk-aac x265' >> test/module.defs # Use the libav patched mkdir -p download bsdtar -cjf download/libav-v10.1.tar.bz2 -C .. libav-v10.1 } build() { cd "$srcdir/HandBrake-$pkgver" ./configure \ --prefix=/usr \ --force \ --disable-gtk-update-checks cd build make } package_handbrake() { pkgdesc="Multithreaded video transcoder" depends+=("${_gui_depends[@]}" 'hicolor-icon-theme' 'desktop-file-utils') optdepends=('gst-plugins-good: for video previews' 'gst-libav: for video previews') conflicts=("$pkgname-svn") replaces=("$pkgname-svn") cd "$srcdir/HandBrake-$pkgver/build" make DESTDIR="$pkgdir" install rm "$pkgdir/usr/bin/HandBrakeCLI" } package_handbrake-cli() { pkgdesc+="Multithreaded video transcoder (CLI)" conflicts=("$pkgname-svn") replaces=("$pkgname-svn") cd "$srcdir/HandBrake-$pkgver/build" install -D HandBrakeCLI "$pkgdir/usr/bin/HandBrakeCLI" } # vim:set ts=2 sw=2 et: