summaryrefslogtreecommitdiff
path: root/libre/handbrake/PKGBUILD
blob: e4e2baabe840b668de4d86b0dd8ed1a16a0eab3b (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
81
82
83
84
85
86
# Maintainer (Arch): Evangelos Foutras <evangelos@foutrelis.com>
# Contributor (Arch): Giovanni Scafora <giovanni@archlinux.org>
# Contributor (Arch): Sebastien Piccand <sebcactus gmail com>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=('handbrake' 'handbrake-cli')
pkgver=1.1.2
pkgrel=1
pkgrel+=.par1
arch=('x86_64')
arch+=('i686' 'armv7h')
url="https://handbrake.fr/"
license=('GPL')
makedepends=('intltool' 'python2' 'yasm' 'wget' 'cmake' 'bzip2' 'gcc-libs'
             'zlib' 'libnotify' 'gst-plugins-base' 'gtk3' 'dbus-glib' 'libass'
             'lame' 'libxml2' 'opus' 'libvorbis' 'libtheora' 'libsamplerate'
             'x264' 'jansson' 'librsvg' 'libgudev')
makedepends+=('ffmpeg' 'libdvdnav')
source=(https://download.handbrake.fr/releases/$pkgver/HandBrake-$pkgver-source.tar.bz2
        https://github.com/HandBrake/HandBrake/releases/download/$pkgver/HandBrake-$pkgver-source.tar.bz2.sig
        handbrake-fix-missing-x265-link-flag.patch
        handbrake-no-download.patch
        handbrake-supress-clip_id.patch
        switch-libav-to-ffmpeg.patch)
sha256sums=('ba9a4a90a7657720f04e4ba0a2880ed055be3bd855e99c0c13af944c3904de2e'
            'SKIP'
            '05e212e76b6e0b94a04de02cbeb7bf9db607059e19297b5bd3d0d143135285c4'
            'd8116caa83f870803581f0d02e1302b3b8990479d446e4c73bedd35bed531042'
            '6407a96c59baa030a4e5fa46c53ddb3e841c7d4787613d391e032a62600d527f'
            '7f82adce83d41552e19cdd74268db4084190f201be549b45802817f80fbc37bb')
validpgpkeys+=('1629C061B3DDE7EB4AE34B81021DB8B44E4A8645') # HandBrake Team <developers@handbrake.fr>

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

  # https://bugs.gentoo.org/show_bug.cgi?id=552792
  patch -Np1 -i ../handbrake-fix-missing-x265-link-flag.patch

  patch -Np1 -i ../handbrake-no-download.patch
  patch -Np1 -i ../handbrake-supress-clip_id.patch
  patch -Np1 -i ../switch-libav-to-ffmpeg.patch

  # Use more system libs
  # Bundled libbluray is kept because it is patched locally
  for _lib in ffmpeg x265 libvpx libdvdnav libdvdread; do
    sed -i "/MODULES += contrib\/$_lib/d" make/include/main.defs
  done
}

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

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

package_handbrake() {
  pkgdesc="Multithreaded video transcoder"
  depends=('bzip2' 'gcc-libs' 'zlib' 'gst-plugins-base' 'libnotify' 'dbus-glib'
           'gtk3' 'libass' 'lame' 'libxml2' 'opus' 'libvorbis' 'libtheora'
           'libsamplerate' 'x264' 'jansson' 'librsvg' 'libgudev'
           'desktop-file-utils' 'hicolor-icon-theme')
  depends+=('ffmpeg' 'libdvdnav')
  optdepends=('gst-plugins-good: for video previews'
              'gst-libav: for video previews'
              'libdvdcss: for decoding encrypted DVDs')

  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' 'libass' 'lame' 'libxml2' 'opus'
           'libvorbis' 'libtheora' 'libsamplerate' 'x264' 'jansson')
  depends+=('ffmpeg' 'libdvdnav')
  optdepends=('libdvdcss: for decoding encrypted DVDs')

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

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