# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Alberto Oporto Ames <otreblain@gmail.com>

pkgname=libinih
pkgver=62
pkgrel=2
pkgdesc='A simple .INI file parser written in C'
arch=(x86_64 aarch64)
url=https://github.com/benhoyt/inih
license=(BSD-3-Clause)
depends=(
  libgcc
  libstdc++
  glibc
)
makedepends=(
  git
  meson
)
provides=(
  libinih.so
  libINIReader.so
)
_tag=26254ee9de7681f8825433415443e7116ff24b98
source=(git+https://github.com/benhoyt/inih.git#tag=${_tag})
b2sums=('c5ce1ee01a318cfc0cb2fd4c5ecbfc3ae950af51f41a61b774891be0150326fa6088ebb868a89176bb5cbe1819d84a5bf15062540525d64d25530b8c10fafd12')

pkgver() {
  cd inih
  git describe --tags | sed 's/^r//'
}

build() {
  arch-meson inih build \
    -Ddefault_library=shared \
    -Ddistro_install=true \
    -Dwith_INIReader=true
  meson compile -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build
  install -Dm 644 inih/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/libinih/
}

# vim: ts=2 sw=2 et:
