# 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.163_git20210613 _gitrev=5db6aa6cab1b146e07b60cc1736a01f21da01154 pkgrel=0 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" 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/}" ./configure \ --host=$CHOST \ --prefix=/usr \ --enable-shared \ --enable-static \ $asmopts \ --enable-pic \ --extra-cflags=-fno-aggressive-loop-optimizations make } check() { ./x264 --version } package() { make DESTDIR="$pkgdir" \ bindir=/usr/bin libdir=/usr/lib includedir=/usr/include \ install } sha512sums=" d2cdd40d195fd6507abacc8b8810107567dff2c0a93424ba1eb00b544cb78a5430f00f9bcf8f19bd663ae77849225577da05bfcdb57948a8af9dc32a7c8b9ffd x264-5db6aa6cab1b146e07b60cc1736a01f21da01154.tar.gz "