diff options
Diffstat (limited to 'community/x264/APKBUILD')
-rw-r--r-- | community/x264/APKBUILD | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/community/x264/APKBUILD b/community/x264/APKBUILD new file mode 100644 index 00000000000..28853419997 --- /dev/null +++ b/community/x264/APKBUILD @@ -0,0 +1,72 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +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_git20231001 +_gitrev=31e19f92f00c7003fa115047ce50978bc98c3a0d +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 $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_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=" +707ff486677a1b5502d6d8faa588e7a03b0dee45491c5cba89341be4be23d3f2e48272c3b11d54cfc7be1b8bf4a3dfc3c3bb6d9643a6b5a2ed77539c85ecf294 x264-31e19f92f00c7003fa115047ce50978bc98c3a0d.tar.gz +" |