pkgname=tomlplusplus
pkgver=3.4.0
pkgdesc="Header-only TOML config file parser and serializer for C++17"
arch=(x86_64)
url="https://marzer.github.io/tomlplusplus/"
license=(MIT)
depends=(
  gcc
  glibc
)
makedepends=(cmake meson)
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/marzer/tomlplusplus/archive/refs/tags/v${pkgver}.tar.gz")
md5sums=("c1f32ced14311fe949b9ce7cc3f7a867")

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

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    -D build_lib=true
    -D generate_cmake_config=true
    -D use_vendored_libs=true
    -D build_tests=false
  )
  meson setup build "${meson_args[@]}"
  meson compile -C build
}

src_install() {
  meson install -C build --destdir "$pkgdir"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}

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