# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=editorconfig-core-c
pkgver=%version%
pkgrel=%release%
pkgdesc='EditorConfig core code written in C (for use by plugins supporting EditorConfig parsing)'
arch=(x86_64)
url='https://github.com/editorconfig/editorconfig-core-c'
license=(BSD)
depends=(pcre2)
makedepends=(cmake doxygen)
source=(https://github.com/editorconfig/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('f89d2e144fd67bdf0d7acfb2ac7618c6f087e1b3f2c3a707656b4180df422195')

build() {
  cmake -B build -S $pkgname-$pkgver \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 $pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
