# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Evangelos Foutras <foutrelis@archlinux.org>
# Contributor: Blair Bonnett <blair dot bonnett at gmail dot com>

pkgname=python-sphinx-copybutton
pkgver=0.5.2
pkgrel=5
pkgdesc='Sphinx extension to add a \"copy\" button to code blocks'
arch=(any)
url='https://github.com/executablebooks/sphinx-copybutton'
license=(MIT)
depends=(python python-sphinx)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=(
  "$pkgname::git+$url#tag=v$pkgver"
  'github.com-zenorocha-clipboard.js::git+https://github.com/zenorocha/clipboard.js'
)
sha512sums=('f15549bafc2d7e94a4a887191606fd1656a4606be1f5af4c4459fbc08e94b4f380123a31222035e79b805d952bbf742d25651486787d2070bcbbfd39b84dde05'
            'SKIP')
b2sums=('4faa75f844a4829c141fada4a5523507b6e6cac3849dfcc30312a369dacd87c05bd8c43b9485a1177f08786bbd6792a5c5324b364151921003af9348097dd642'
        'SKIP')

prepare() {
  cd "$pkgname"

  
  git submodule init
  git config submodule.clipboard.js.url "$srcdir/github.com-zenorocha-clipboard.js"
  git -c protocol.file.allow=always submodule update
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # documentation
  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
# vim:set ts=2 sw=2 et:
