blob: 49a329ffbfad40af61876a2905edd182c06adfd0 (
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
169
170
171
172
|
# Maintainer: Holger Obermaier <holgerob@gmx.de>
# Contributor: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Sebastien Piccand <sebcactus gmail com>
pkgname=(
'handbrake-llvm-optimized'
'handbrake-llvm-optimized-cli'
)
# Follow handbrakes most current stable branch 1.9.x
# https://github.com/HandBrake/HandBrake/commits/1.9.x
readonly _commit=e117cfe7fca37abeec59ea4201e5d93ed7477746
pkgver() {
git -C HandBrake/ gc --auto --prune=now
git -C HandBrake/ describe ${_commit} | sed -e 's/^v//g' -e 's/-/.r/' -e 's/-/./'
}
pkgver=1.9.2
pkgrel=4
arch=('x86_64')
url="https://handbrake.fr/"
license=('GPL')
_commondeps=(
'bzip2'
'fribidi'
'gcc-libs'
'jansson'
'lame'
'libass'
'libjpeg-turbo'
'libogg'
'libtheora'
'libva'
'libvorbis'
'libvpx'
'libxml2'
'numactl'
'opus'
'speex'
'x264'
'xz'
'zlib'
)
_guideps=(
'at-spi2-core'
'cairo'
'fontconfig'
'freetype2'
'gdk-pixbuf2'
'glib2'
'gst-plugins-base'
'gst-plugins-base-libs'
'gstreamer'
'gtk4'
'harfbuzz'
'libgudev'
'pango'
)
makedepends=(
'base-devel'
'intltool'
'python'
'nasm'
'wget'
'cmake'
'meson'
'git'
'clang>=20'
'lld'
'llvm'
# AMD VCE encoding on Linux requires Vulkan
'vulkan-headers'
"${_commondeps[@]}"
"${_guideps[@]}"
)
options=('!lto') # https://bugs.archlinux.org/task/72600
source=("HandBrake::git+https://github.com/HandBrake/HandBrake.git#tag=${_commit}")
sha256sums=('SKIP')
prepare() {
# contrib: update SVT-AV1 to 3.0.0
git -C HandBrake cherry-pick --no-commit 75f9c84c140c8841cfe1324ef59452025899ad8b
# contrib: add cpuinfo
git -C HandBrake cherry-pick --no-commit 2012ab9e674a744c1366b96b8cf2720e75670248
# contrib: update to SVT-AV1 3.0.1
git -C HandBrake cherry-pick --no-commit eb3a7e7c01313d687ebd487b59e08c700fe753d1
# contrib: update SVT-AV1 to version 3.0.2
git -C HandBrake cherry-pick --no-commit f9e7678bd4e42232188315e842e32387af9ac3ca
# Update bundled x265 to fix build with current cmake
# contrib: update to x265 rev 13212
git -C HandBrake cherry-pick --no-commit a53d20a48bfca3c7dbf4f50710505c65e4334c89
}
setup_compiler() {
export CC="/usr/bin/clang"
unset CFLAGS
export CXX="/usr/bin/clang++"
unset CXXFLAGS
export CPP="/usr/bin/clang-cpp"
export LD="/usr/bin/lld"
export LDFLAGS="-fuse-ld=lld"
export AR="/usr/bin/llvm-ar"
export RANLIB="/usr/bin/llvm-ranlib"
export NM="/usr/bin/llvm-nm"
export ADDR2LINE="/usr/bin/llvm-addr2line"
export OBJCOPY="/usr/bin/llvm-objcopy"
export OBJDUMP="/usr/bin/llvm-objdump"
export READELF="/usr/bin/llvm-readelf"
export STRIP="/usr/bin/llvm-strip"
}
build() {
setup_compiler
local -a CONFIGURE_OPTIONS=(
--launch-jobs=0
--prefix=/usr
--cc="${CC}"
--ar="${AR}"
--ranlib="${RANLIB}"
--strip="${STRIP}"
--optimize=speed
--cpu=native
--lto=on
--enable-qsv
--enable-vce
)
cd "${srcdir}/HandBrake" || exit
./configure "${CONFIGURE_OPTIONS[@]}"
make -C build
}
package_handbrake-llvm-optimized() {
pkgdesc="Multithreaded video transcoder optimized with LLVM"
depends=(
'desktop-file-utils'
'hicolor-icon-theme'
"${_commondeps[@]}"
"${_guideps[@]}"
)
optdepends=(
'gst-plugins-good: for video previews'
'gst-libav: for video previews'
'intel-media-sdk: Intel QuickSync support'
'libdvdcss: for decoding encrypted DVDs'
)
provides=(handbrake)
conflicts=(handbrake)
make \
--directory="${srcdir}/HandBrake/build" \
DESTDIR="${pkgdir}" \
install
rm "${pkgdir}/usr/bin/HandBrakeCLI"
}
package_handbrake-llvm-optimized-cli() {
pkgdesc="Multithreaded video transcoder optimized with LLVM (CLI)"
depends=("${_commondeps[@]}")
optdepends=(
'intel-media-sdk: Intel QuickSync support'
'libdvdcss: for decoding encrypted DVDs'
)
provides=(handbrake-cli)
conflicts=(handbrake-cli)
install -D "${srcdir}/HandBrake/build/HandBrakeCLI" "${pkgdir}/usr/bin/HandBrakeCLI"
}
|