# Template file for 'python-jupyter_widgetsnbextension'
pkgname=python-jupyter_widgetsnbextension
version=3.4.2
revision=1
noarch=yes
wrksrc="widgetsnbextension-${version}"
build_style=python-module
pycompile_module="widgetsnbextension"
hostmakedepends="python-setuptools python3-setuptools"
depends="python-jupyter_widgetsnbextension-data>=${version}_${revision}
 python-jupyter_notebook"
short_desc="Interactive HTML widgets for Jupyter notebooks (Python2)"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://pypi.org/project/widgetsnbextension/"
license="BSD-3-Clause"
distfiles="${PYPI_SITE}/w/widgetsnbextension/widgetsnbextension-${version}.tar.gz"
checksum=fa618be8435447a017fd1bf2c7ae922d0428056cfc7449f7a8641edf76b48265

pre_build() {
	sed -i '/widgetsnbextension.json/d' setup.py
}
post_install() {
	vlicense LICENSE
}

python-jupyter_widgetsnbextension-data_package() {
	noarch=yes
	short_desc+=" - data files"
	conf_files="/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json"
	pkg_install() {
		vmkdir etc/jupyter/nbconfig/notebook.d
		vinstall widgetsnbextension.json 644 etc/jupyter/nbconfig/notebook.d
		vmove usr/share/jupyter
	}
}

python3-jupyter_widgetsnbextension_package() {
	noarch=yes
	pycompile_module="widgetsnbextension"
	depends="python-jupyter_widgetsnbextension-data>=${version}_${revision}
	 python3-jupyter_notebook"
	short_desc="${short_desc/Python2/Python3}"
	pkg_install() {
		vmove usr/lib/python3*
		vlicense LICENSE
	}
}
