pkgname=re2
pkgver=2024.07.02
_ver=${pkgver//./-}
pkgdesc="Fast, safe, thread-friendly regular expression engine"
arch=('x86_64')
homepage="https://github.com/google/re2"
license=('BSD-3-Clause')
depends=('gcc-libs' 'glibc' 'abseil-cpp')
makedepends=('git' 'cmake')
sources=("${pkgname}-${_ver}.tar.gz")
urls=("https://github.com/google/re2/releases/download/${_ver}/${sources[0]}")
md5sums=("73c94c78678bd2d641beaf8d5a3fd352")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  cmake -B build \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_BUILD_TYPE=Release \
    -D BUILD_SHARED_LIBS=ON \
    -D RE2_BUILD_BENCHMARK=OFF \
    -D RE2_BUILD_TESTING=OFF \
    -D RE2_USE_ICU=OFF
  cmake --build build
}

src_install() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

# vim:ft=sh syn=sh et sw=2:
