pkgname=highway
pkgver=1.3.0
pkgdesc='A C++ library that provides portable SIMD/vector intrinsics'
arch=('x86_64')
url='https://github.com/google/highway/'
license=('Apache-2.0 AND BSD-3-Clause')
depends=(
    'gcc'
    'glibc'
  )
makedepends=('cmake')
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/google/highway/archive/refs/tags/${pkgver}.tar.gz")
md5sums=("6c913a4c4ba849a3306d45318f66078d")

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

src_build() {
  local cmake_args=(
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CMAKE_BUILD_TYPE=Release
    -D BUILD_TESTING=false
    -D HWY_ENABLE_TESTS=false
    -D HWY_WARNINGS_ARE_ERRORS=OFF
    -D BUILD_SHARED_LIBS:BOOL='ON'
  )
  cmake -B build ${cmake_args[@]}
  cmake --build build
}

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

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