pkgname=llhttp
pkgver=9.2.1
pkgdesc='Port of http_parser to llparse'
arch=(x86_64)
url='https://llhttp.org'
license=(MIT)
depends=(glibc)
makedepends=(cmake)
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/nodejs/llhttp/archive/release/v${pkgver}.tar.gz")
md5sums=("355ecc90e622035e3e1693a96a0c233b")

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

src_build() {
  cmake -B build \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DBUILD_SHARED_LIBS=ON

  cmake --build build
}

src_install() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE-MIT
}

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