# Description: Simplified packaging of Python modules
# URL: https://github.com/takluyver/flit
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: python3

name=python3-flit-core
version=4.0.0
release=1
source=(https://github.com/takluyver/flit/archive/$version/flit-$version.tar.gz)

build() {
  cd flit-$version/flit_core

  _pyver=$(/usr/bin/python3 -c 'import sys; print("%s.%s" % sys.version_info[:2])')

  /usr/bin/python3 -m flit_core.wheel
  /usr/bin/python3 bootstrap_install.py --installdir $PKG/usr/lib/python${_pyver}/site-packages dist/flit_core-*.whl

  /usr/bin/python3 -m compileall -d $name-$version.src/utils/lit $PKG
  /usr/bin/python3 -O -m compileall -d $name-$version.src/utils/lit $PKG
}
