summaryrefslogtreecommitdiff
path: root/libre/handbrake-svn/PKGBUILD
blob: ccc0cdc7c54968964df525709caddeb0d561f986 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
# Maintainer (Arch): Evangelos Foutras <evangelos@foutrelis.com>
# Contributor (Arch): Giovanni Scafora <giovanni@archlinux.org>
# Contributor (Arch): Sebastien Piccand <sebcactus gmail com>

pkgname=('handbrake-svn' 'handbrake-cli-svn')
_pkgver=0.9.9.1
pkgver=6103
url="http://handbrake.fr/"
license=('GPL')

pkgrel=1
arch=('i686' 'x86_64')
makedepends=('intltool' 'python2' 'gcc-libs' 'libnotify'
             'gst-plugins-base' 'gtk3' 'dbus-glib')

# The format is: handbrake_name:[system_name|tarball]
# This list should pretty closely correspond to `grep contrib/ make/include/main.defs`
# _config_loc
#    format: "ignored:pacman_pkgname"
#    For packages that optionally use the system's versions.  The
#    build system is not modified, in order that if the module version
#    is used, it fails early (assuming the network is down).
# _config_mod
#    format: "module_name:file_name"
#    For packages that are built as modules.
# _config_sys
#    format: "module_name:pacman_pkgname"
#    For modules that we *force* to be the system versions.
# _config_ign
#    format: "ignored"
#    For modules that are optional, but we don't want to download.
declare -ag _contrib_{loc,sys,mod,ign}
_contrib_loc+=('pkgconfig') # FEATURE.local_pkgconfig
_contrib_loc+=('autoconf' # FEATURE.local_autotools
               'automake'
               'libtool'
               'm4')
_contrib_loc+=('bzip2') # HAS.bz2
_contrib_loc+=('fontconfig'
               'freetype:freetype2'
               'fribidi'
               'libxml2'
               'libass'
               'libogg'
               'libvorbis'
               'libtheora'
               'libsamplerate')
# XXX: I can't get it to set LDFLAGS right to use system fdk-aac
_contrib_mod+=('fdk-aac:fdk-aac-v0.1.1-6-gbae4553.tar.bz2') # FEATURE.fdk_aac (sys:libfdk-aac)
# XXX: I can't get it to set LDFLAGS right to use system mp4v2
_contrib_mod+=('mp4v2:mp4v2-trunk-r355.tar.bz2') # FEATURE.mp4v2 (sys:libmp4v2)
# libmkv is patched to add features
_contrib_mod+=('libmkv:libmkv-0.6.5-0-g82075ae.tar.gz') # FEATURE.libmkv
_contrib_ign+=('x265') # FEATURE.x265
_contrib_sys+=('lame') # always
# Using system ffmpeg will break PGS subtitle processing
# https://forum.handbrake.fr/viewtopic.php?f=13&t=27581
_contrib_mod+=('ffmpeg:libav-v10_beta1.tar.bz2') # always
_contrib_sys+=('libdvdread') # always
# XXX: I don't even know, but system libdvdnav doesn't work
_contrib_mod+=('libdvdnav:libdvdnav-a5c1325.tar.bz2') # always
_contrib_sys+=('libbluray') # always
_contrib_ign+=('libmfx') # FEATURE.qsv
_contrib_sys+=('x264') # always
_contrib_loc+=('zlib') # HAS.libz
_contrib_loc+=('yasm') # FEATURE.local_yasm

makedepends+=("${_contrib_loc[@]#*:}" "${_contrib_sys[@]#*:}")

source=("https://repo.parabolagnulinux.org/other/handbrake/HandBrake-svn${pkgver}.tar.gz")
for _f in "${_contrib_mod[@]#*:}"; do
  source+=("http://download.handbrake.fr/handbrake/contrib/${_f}")
  noextract+=("${_f}")
done; unset _f
sha256sums=('910fc88c7c29eb07c36f99bd7bea79b52ef6f3b2570b846d4e14db81c1324a66'
            'f08584d59a02db5facf548ae860c64d2870db63477f605af763c161a1508dcbc'
            '5b7d4e62df506b1246463da82cc2f02415eb462e6ccd5848f98f5cdcfc1f3d4f'
            '7314a296c68f42b826164074a96e247e52d8ef9287c21ebc5fe1bf9e73643e97'
            '41e7b81c4bf49acf4f5e74a61ffe2a593d22df5326997aa4fb253b5de1410773'
            'd190ce2ca4d1d9878145acd9c1b8ac76636c3b6d12066e8cc87ee674f943fb2a')

mksource=("HandBrake-svn${pkgver}::svn://svn.handbrake.fr/HandBrake/trunk")
mkmd5sums=('SKIP')

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

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

  local contrib
  # Use more system libs
  for contrib in "${_contrib_sys[@]}"; do
    sed -i \
      -e "s/MODULES += contrib\/${contrib%:*}\$/#& # provided by ${contrib#*:}/" \
      make/include/main.defs
  done
  # Use the pre-downloaded files
  mkdir -p download
  for contrib in "${_contrib_mod[@]}"; do
    ln -srf "${srcdir}/${contrib[@]#*:}" download/
  done

  # Fix libhb to work with the stable release of libmp4v2
  if in_array libmp4v2 "${makedepends[@]}"; then
    local arg='\([^,)]*\)'
    sed -i \
      -e "s/MP4Close(${arg})/MP4Close(\1, 0)/" \
      -e "s/MP4Create(${arg},${arg},${arg})/MP4Create(\1,\3)/" \
      -e "s/MP4Optimize(${arg},${arg},${arg})/MP4Optimize(\1,\2)/" \
      -e "s/MP4Read(${arg},${arg})/MP4Read(\1)/" \
      libhb/decmetadata.c libhb/muxmp4.c
  fi

  # Fix configure.ac to work with automake 1.13
  if in_array automake "${makedepends[@]}"; then
    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
  fi
}

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

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

package_handbrake-svn() {
  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
  provides=("${pkgname%-svn}-${_pkgver}")
  conflicts=("${pkgname%-svn}")

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

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

package_handbrake-cli-svn() {
  pkgdesc="Multithreaded video transcoder (CLI)"
  depends=('bzip2' 'gcc-libs' 'zlib' 'fribidi' 'libass' 'libxml2' 'libtheora'
           'libsamplerate' 'libbluray' 'x264')
  provides=("${pkgname%-svn}-${_pkgver}")
  conflicts=("${pkgname%-svn}")

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

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