Comment
The change is low risk. It only refactors the build/package steps for the existing upstream x264 git source: it creates build directories in a simpler location, reuses a common configure option array, and adds installation/renaming of bash completion files alongside the already-existing 8-bit/10-bit split binaries. The source remains the official Videolan HTTPS git repo, there are no new network fetches, no shell-eval/obfuscation, no privilege escalation, and no writes outside $pkgdir during packaging. I do note the package now installs bash completion via an upstream make target, but that is a normal local build artifact and is still staged into $pkgdir. No malicious persistence or supply-chain red flags are evident in this diff.
@@ -38,49 +42,46 @@ pkgver() {
}
build() {
+ local -a _common_opts=(
+ '--prefix=/usr'
+ '--enable-shared'
+ '--enable-lto'
+ '--enable-pic'
+ '--disable-avs'
+ '--disable-swscale'
+ '--disable-lavf'
+ '--disable-gpac')
+
printf '%s\n' ' -> Building for 8-bit...'
- cd x264/build-8bit
- ../configure \
- --prefix='/usr' \
- --enable-shared \
- --bit-depth='8' \
- --enable-lto \
- --enable-pic \
- --disable-avs \
- --disable-swscale \
- --disable-lavf \
- --disable-gpac
+ cd build-8bit
+ ../x264/configure \
+ "${_common_opts[@]}" \
+ --bit-depth='8'
make
printf '%s\n' ' -> Building for 10-bit...'
- cd "${srcdir}/x264/build-10bit"
- ../configure \
- --prefix='/usr' \
+ cd "${srcdir}/build-10bit"
+ ../x264/configure \
+ "${_common_opts[@]}" \
--libdir='/usr/lib/x264-10bit' \
--includedir='/usr/include/x264-10bit' \
- --enable-shared \
- --bit-depth='10' \
- --enable-lto \
- --enable-pic \
- --disable-avs \
- --disable-swscale \
- --disable-lavf \
- --disable-gpac
+ --bit-depth='10'
make
}
package() {
- cd x264
+ export BASHCOMPLETIONSDIR='/usr/share/bash-completion/completions'
local _depth
for _depth in 10 8
do
printf '%s\n' " -> Installing for ${_depth}-bit..."
- make -C "build-${_depth}bit" DESTDIR="$pkgdir" install-cli install-lib-shared
+ make -C "build-${_depth}bit" DESTDIR="$pkgdir" install-cli install-lib-shared install-bashcompletion
- if [ "$_depth" -eq '10' ]
+ if [ "$_depth" -eq '10' ]
then
- mv "${pkgdir}/usr/bin/x264" "${pkgdir}/usr/bin/x264-${_depth}bit"
+ mv "${pkgdir}/usr/bin/x264"{,"-${_depth}bit"}
+ mv "${pkgdir}/usr/share/bash-completion/completions/x264"{,"-${_depth}bit"}
fi
done
}