# Description: Open Source h264 codec implementation
# URL: https://www.openh264.org/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: nasm

name=openh264
version=2.3.1
release=1
source=(https://github.com/cisco/openh264/archive/v$version/$name-$version.tar.gz)

build() {
  meson setup $name-$version build \
    --prefix=/usr \
    --buildtype=plain \
    --wrap-mode nodownload \
    -D b_lto=true \
    -D b_pie=true \
    -D tests=disabled

  meson compile -C build
  DESTDIR=$PKG meson install -C build

  install -Dm755 build/codec/console/dec/h264dec $PKG/usr/bin/h264dec
  install -Dm755 build/codec/console/enc/h264enc $PKG/usr/bin/h264enc
}