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

pkgname=libinih
pkgver=61
pkgrel=1
pkgdesc='A simple .INI file parser written in C'
arch=(x86_64 aarch64)
url=https://github.com/benhoyt/inih
license=(BSD-3-Clause)
depends=(
  gcc-libs
  glibc
)
makedepends=(
  git
  meson
)
provides=(
  libinih.so
  libINIReader.so
)
_tag=3eda303b34610adc0554bdea08d02a25668c774c
source=(git+https://github.com/benhoyt/inih.git#tag=${_tag})
b2sums=('0805f00009782f09e17e083a8c36e4a79237686b618e189fcc3cef21fe4fab04e7015e624dff5d8bc61080cdb3548a75213006549f8e3a6348158f11be965862')

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:
