# Maintainer: Bartlomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=pkgconf
pkgver=1.8.0
pkgrel=1
pkgdesc='pkg-config compatible utility which does not depend on glib'
url='https://github.com/pkgconf/pkgconf'
arch=('i686' 'x86_64')
license=('ISC')
groups=('base-devel')
makedepends=('meson'
             'ninja')
conflicts=('pkg-config')
provides=('pkg-config')
replaces=('pkg-config')
source=(https://github.com/pkgconf/pkgconf/archive/refs/tags/$pkgname-$pkgver.tar.gz)
sha256sums=('d84a2a338a17e0f68e6a8d6c9caf40d6a2c9580c4ae1d475b338b8d956e483aa')

prepare() {
  mv "${pkgname}-${pkgname}-${pkgver}" "${pkgname}-${pkgver}"
  cd "${srcdir}/${pkgname}-${pkgver}"

}

build() {
  mkdir "${srcdir}"/build && cd "${srcdir}"/build

  meson \
    --buildtype=plain \
     --prefix=/usr \
     -Dtests=false \
    "../${pkgname}-${pkgver}"

  meson compile
}

package() {
  cd "${srcdir}"/build

  DESTDIR="$pkgdir" meson install

  cp "$pkgdir"/usr/bin/pkgconf "$pkgdir/usr/bin/${MSYSTEM_CHOST}-pkg-config"
  cp "$pkgdir"/usr/bin/pkgconf "$pkgdir"/usr/bin/pkg-config
}
