# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=liburing
pkgver=2.12
pkgrel=1
pkgdesc="Linux-native io_uring I/O access library"
arch=(x86_64 aarch64)
url="https://git.kernel.dk/cgit/liburing"
license=(
  'GPL-2.0-only WITH Linux-syscall-note OR MIT'
  LGPL-2.0-or-later
  MIT
)
makedepends=(git)
provides=(
  liburing.so
  liburing-ffi.so
)
source=("git+https://github.com/axboe/liburing.git?signed#tag=$pkgname-$pkgver")
sha512sums=('c86c015ac715e7077d0b8aa1734b474c5b73a2899c680a36a15e8b36c95ef7d5dea9c006b18b825cb95c7ea652e475bd54c4d48f979840927bc2894d1d1aaef3')
b2sums=('bcbcccf5dff845ac5f0def0b864746032796c4e53759143ee54cc91c5d69aa7b734dd597388351cd035b15a264aaa9ccd87039ade7b223a9113153b8f925c075')
validpgpkeys=(C0FC392DCADE26D975FA5E4AF7D358FB2971E0A6)  # Jens Axboe <axboe@kernel.dk>

build() {
  local configure_options=(
    --prefix=/usr
    --mandir=/usr/share/man
  )

  cd $pkgname
  ./configure "${configure_options[@]}"
  make
}

package() {
  make DESTDIR="$pkgdir" install -C $pkgname
  install -vDm 644 $pkgname/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
