# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=cereal
pkgver=1.3.2
pkgrel=2
pkgdesc='C++11 library for serialization'
arch=(any)
url=https://github.com/USCiLab/cereal
license=(BSD)
makedepends=(
  boost
  cmake
  git
  ninja
)
_tag=ebef1e929807629befafbb2918ea1a08c7194554
source=(git+https://github.com/USCiLab/cereal.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd cereal
  git describe --tags | sed 's/^v//'
}

build() {
  cmake -S cereal -B build -G Ninja \
    -DCMAKE_BUILD_TYPE='' \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DSKIP_PORTABILITY_TEST=ON \
    -DTHREAD_SAFE=ON \
    -DWITH_WERROR=OFF
  cmake --build build
}

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

# vim: ts=2 sw=2 et:
