makedepends=(cmake)

description="Extensible Binary Meta Language library"
url="https://github.com/Matroska-Org/libebml"

packager="Great-OS Team"
maintainer="Great-OS Team"

name="libebml"
version="1.4.5"
release=1

PKGMK_KEEP_SOURCES=no
source=(https://github.com/Matroska-Org/libebml/archive/refs/tags/release-$version.tar.gz)

prepare() {
  mv $name-release-$version $name-$version
}

build() {
  mkdir build

  cmake -S $name-$version -B build -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DBUILD_SHARED_LIBS=ON

  cmake --build build
}

package() {
  DESTDIR="${PKG}" cmake --install build
}
