# Maintainer : Gork             <bertsmithzp@gmail.com>
# Contributor: Christoph Reiter <reiter.christoph@gmail.com>

pkgname=fmt
pkgver=12.0.0
pkgrel=1
pkgdesc='Open-source formatting library for C++'
arch=(x86_64 i686)
url=https://fmt.dev
msys2_repository_url="https://github.com/fmtlib/fmt"
license=(spdx:MIT)
depends=(gcc-libs)
makedepends=(
  cmake
  ninja
  gcc
)
source=("https://github.com/fmtlib/fmt/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('aa3e8fbb6a0066c03454434add1f1fc23299e85758ceec0d7d2d974431481e40')

build() {
  cmake -S "${pkgname}-${pkgver}" -B build \
    -GNinja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_SHARED_LIBS=ON
  cmake --build build
}
check() {
  cmake --build build --target test
}
package() {
  DESTDIR="${pkgdir}" cmake --build build --target install
  install -Dm 644 "${pkgname}-${pkgver}"/LICENSE -t "${pkgdir}"/usr/share/licenses/fmt/
}
