pkgname=x264
pkgver=20240513
pkgdesc="Free library for encoding X264/AVC streams"
homepage="https://www.videolan.org/developers/x264.html"
licenses=("GPL-2")
depends=(">=dev-lang/nasm-2.13")
_commit="4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1"
sources=("${pkgname}-${pkgver}.tar.bz2")
urls=("https://code.videolan.org/videolan/x264/-/archive/${_commit}/${pkgname}-${_commit}.tar.bz2")
sha512sums=("6d0d9e079d6c7650abb5c00ad60cf3cfe72a220b3ee7cd030d4daeefdd9feeb4d056cf2e01b2f8d2fb0a66ccc15cdde860237f8ac5eac42ede6e5444a81346f8")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  local conf_args=(
    --prefix=/usr
    --libdir=/usr/lib
    --disable-cli
    --disable-avs
    --disable-lavf
    --disable-swscale
    --disable-ffms
    --disable-gpac
    --enable-pic
    --enable-shared
    --disable-opencl
  )
  ./configure "${conf_args[@]}"
  make
}

src_install() {
  make DESTDIR="$pkgdir" install
}

# vim:ft=sh syn=sh et sw=2:
