summaryrefslogtreecommitdiffstats
path: root/abs/extra/handbrake/PKGBUILD
blob: e2b4833ba99b38ed3cb97cc95356fe1a5f65d3a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# $Id$
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Sebastien Piccand <sebcactus gmail com>

pkgname=('handbrake' 'handbrake-cli')
pkgver=0.9.9
pkgrel=5
arch=('i686' 'x86_64')
url="http://handbrake.fr/"
license=('GPL')
makedepends=('intltool' 'python2' 'yasm' 'wget' 'bzip2' 'gcc-libs' 'libnotify'
             'gst-plugins-base' 'gtk3' 'dbus-glib' 'fribidi' 'libass'
             'fontconfig' 'freetype2' 'libxml2' 'libogg' 'libvorbis'
             'libtheora' 'libsamplerate' 'libbluray' 'x264')
source=(http://downloads.sourceforge.net/project/handbrake/$pkgver/HandBrake-$pkgver.tar.bz2)
sha256sums=('a71dd774104cda00cfb51a813550351d638253791f2f419d04a66f3158a835b3')

prepare() {
  cd "$srcdir/HandBrake-$pkgver"

  # Use Python 2
  sed -i 's/python /python2 /' gtk/src/Makefile.am

  # Use more system libs
  # We had ffmpeg here as well but it broke PGS subtitle processing
  # https://forum.handbrake.fr/viewtopic.php?f=13&t=27581
  sed -i \
    -e '/MODULES += contrib\/libbluray/d' \
    -e '/MODULES += contrib\/x264/d' \
    make/include/main.defs

  # Fix configure.ac to work with automake 1.13
  cd gtk
  sed -i \
    -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' \
    -e '/AM_PROG_CC_STDC/d' \
    -e 's/$pkg_gudev"/gmodule-2.0 $pkg_gudev"/' \
    configure.ac

  autoreconf -vi
}

build() {
  cd "$srcdir/HandBrake-$pkgver"

  ./configure \
    --prefix=/usr \
    --force \
    --disable-gtk-update-checks
  cd build
  make
}

package_handbrake() {
  pkgdesc="Multithreaded video transcoder"
  depends=('bzip2' 'gcc-libs' 'gst-plugins-base' 'libnotify' 'dbus-glib'
           'fribidi' 'libass' 'gtk3' 'fontconfig' 'freetype2' 'libxml2'
           'libogg' 'libvorbis' 'libtheora' 'libsamplerate' 'libbluray'
           'x264' 'desktop-file-utils' 'hicolor-icon-theme')
  optdepends=('gst-plugins-good: for video previews'
              'gst-libav: for video previews')
  install=$pkgname.install

  cd "$srcdir/HandBrake-$pkgver/build"

  make DESTDIR="$pkgdir" install
  rm "$pkgdir/usr/bin/HandBrakeCLI"
}

package_handbrake-cli() {
  pkgdesc="Multithreaded video transcoder (CLI)"
  depends=('bzip2' 'gcc-libs' 'zlib' 'fribidi' 'libass' 'libxml2' 'libtheora'
           'libsamplerate' 'libbluray' 'x264')

  cd "$srcdir/HandBrake-$pkgver/build"
  install -D HandBrakeCLI "$pkgdir/usr/bin/HandBrakeCLI"
}

# vim:set ts=2 sw=2 et: