# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=python-faust-cchardet
pkgver=2.1.19
pkgrel=4
pkgdesc="Fork of the original cChardet"
url="https://github.com/faust-streaming/cChardet"
arch=(x86_64 aarch64)
license=('GPL-2.0-only OR LGPL-2.1-only OR MPL-1.1')
depends=(
  gcc-libs
  glibc
  python
)
makedepends=(
  cython
  git
  python-build
  python-installer
  python-pkgconfig
  python-setuptools
  python-wheel
)
provides=("python-cchardet=$pkgver")
conflicts=(python-cchardet)
source=(
  "faust-cchardet::git+$url#tag=v$pkgver"
  "pyyoshi-uchardet::git+https://github.com/PyYoshi/uchardet"
)
b2sums=('e4dcee1147eaa0247db5d3d75b805337819bb372c10e7e1b6d93195fe73f8a88a0db73c8fc5769b7ddbc4deff5eba424c07835c49bd7ebb5ff6cfafb551f15e4'
        'SKIP')

prepare() {
  cd faust-cchardet

  git submodule init
  git submodule set-url src/ext/uchardet "$srcdir/pyyoshi-uchardet"
  git -c protocol.file.allow=always -c protocol.allow=never submodule update
}

build() {
  python -m build --wheel --no-isolation faust-cchardet
}

package() {
  python -m installer --destdir="$pkgdir" faust-cchardet/dist/*.whl
}

# vim:set sw=2 sts=-1 et:
