# Maintainer: Natanael Copa pkgname=x264 # Upstream doesn't do releases; track branch "stable" # https://code.videolan.org/videolan/x264/-/tree/stable. # The minor version corresponds the ABI version. If it needs to be bumbed, # abuild will alert you. pkgver=0.164_git20220602 _gitrev=baee400fa9ced6f5481a728138fed6e867b0ff7f pkgrel=2 pkgdesc="Free library for encoding H264/AVC video streams" url="https://www.videolan.org/developers/x264.html" arch="all" license="GPL-2.0-or-later" makedepends=" bash coreutils libx11-dev nasm perl " subpackages="$pkgname-dev $pkgname-libs $pkgname-bash-completion" source="$pkgname-$_gitrev.tar.gz::https://code.videolan.org/videolan/x264/-/archive/$_gitrev/x264-$_gitrev.tar.gz" builddir="$srcdir/$pkgname-$_gitrev" prepare() { default_prepare update_config_guess update_config_sub local abi; abi=$(sed -n 's/^#define X264_BUILD \([1-9][0-9]*\).*$/\1/p' x264.h) if [ "${pkgver%_*}" != "0.$abi" ]; then error "ABI version has been changed to $abi!" error "Bump pkgver to 0.${abi}_${pkgver##*_} and rebuild all dependent packages" return 1 fi } build() { local asmopts= case "$CARCH" in # x86 assembly contains TEXTRELs x86) asmopts="--disable-asm";; esac # note: not autotools CFLAGS="${CFLAGS/-Os/} -flto=auto" ./configure \ --host=$CHOST \ --prefix=/usr \ --enable-lto \ --enable-shared \ --enable-static \ $asmopts \ --enable-pic make } check() { ./x264 --version } package() { make DESTDIR="$pkgdir" \ bindir=/usr/bin libdir=/usr/lib includedir=/usr/include \ install mkdir -p "$pkgdir"/usr/share/bash-completion/completions mv "$builddir"/tools/bash-autocomplete.sh \ "$pkgdir"/usr/share/bash-completion/completions/x264 } sha512sums=" 3c7147457cbe0fea20cf3ed8cf7bbdca9ac15060cf86f81b9b5b54b018f922964e91b3c38962c81fedef92bc5b14489e04d0966d03d2b7a85b4dabab6ad816a2 x264-baee400fa9ced6f5481a728138fed6e867b0ff7f.tar.gz "