# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=utf8cpp
pkgver=4.0.5
pkgrel=1.1
pkgdesc="UTF-8 with C++ in a Portable Way"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://github.com/nemtrif/utfcpp"
license=(custom:BSL)
makedepends=(cmake)
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('ffc668a310e77607d393f3c18b32715f223da1eac4c4d6e0579a11df8e6b59cf')

build() {
  cmake -B build -S ${pkgname/8}-${pkgver} \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DUTF8_TESTS=OFF
  make -C build
}

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