void-packages/srcpkgs/python-ipython/template

136 lines
4.2 KiB
Bash
Raw Normal View History

2015-02-19 13:31:00 +01:00
# Template file for 'python-ipython'
pkgname=python-ipython
2015-04-04 23:31:00 +02:00
version=3.1.0
revision=3
2015-02-19 13:31:00 +01:00
noarch=yes
wrksrc="ipython-${version}"
build_style=python-module
python_versions="2.7 3.4"
hostmakedepends="
python-setuptools python3.4-setuptools python-Sphinx python3.4-Sphinx
python-Pygments python3.4-Pygments python-tornado python3.4-tornado
python-Jinja2 python3.4-Jinja2 python-pyzmq python3.4-pyzmq python-pexpect
python3.4-pexpect"
makedepends="${hostmakedepends}"
2015-03-15 17:00:00 +01:00
depends="python-decorator python-path python-pexpect python-simplegeneric"
2015-02-19 13:31:00 +01:00
pycompile_module="IPython"
short_desc="Enhanced interactive Python2 shell"
_short_desc="${short_desc/Python2/Python3.4}"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://ipython.org/"
license="3-clause-BSD"
distfiles="${PYPI_SITE}/i/ipython/ipython-${version}.tar.gz"
2015-04-04 23:31:00 +02:00
checksum=532092d3f06f82b1d8d1e5c37097eae19fcf025f8f6a4b670dd49c3c338d5624
2015-02-19 13:31:00 +01:00
# explicit order, do not change
subpackages="python-ipython-notebook python3.4-ipython-notebook python3.4-ipython"
if [ -z "$CROSS_BUILD" ]; then
subpackages+=" python-ipython-qtconsole python3.4-ipython-qtconsole"
fi
pre_build() {
# remove shebangs
find IPython -type f -name '*.py' -exec sed -i '/^#!.*python$/d' {} +
# rename man pages
for f in docs/man/*; do
cp ${f} ${f/%.1/3.1}
done
}
post_install() {
# remove bundled libraries
2015-03-15 17:00:00 +01:00
for f in decorator{,s} path pexpect simplegeneric; do
2015-02-19 13:31:00 +01:00
find ${DESTDIR} -type f -name _${f}.py -delete
done
# remove qtconsole
rm -rf ${DESTDIR}/usr/lib/python*/site-packages/IPython/qt
2015-03-15 17:00:00 +01:00
# use system mathjax
for pyver in $python_versions; do
ln -sf /usr/share/mathjax \
${DESTDIR}/usr/lib/python${pyver}/site-packages/IPython/html/static/mathjax
done
2015-02-19 13:31:00 +01:00
# drop '2' suffix from bin names
for f in ${DESTDIR}/usr/bin/*2; do
mv ${f} ${f/%2/}
done
# install qtconsole.desktop files
if [ -z "$CROSS_BUILD" ]; then
install -Dm644 "${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop" \
${DESTDIR}/usr/share/applications/ipython-qtconsole.desktop
2015-03-15 17:00:00 +01:00
sed -i 's/ipython/&3/g;s/IPython/&3/g' \
"${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop"
2015-02-19 13:31:00 +01:00
install -Dm644 "${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop" \
${DESTDIR}/usr/share/applications/ipython3-qtconsole.desktop
fi
# install license
vlicense COPYING.rst LICENSE
}
python-ipython-notebook_package() {
noarch=yes
2015-03-15 17:00:00 +01:00
depends="${sourcepkg}-${version}_${revision} python-pyzmq python-Jinja2
python-tornado python-jsonschema python-Pygments python-mistune
python-terminado mathjax"
2015-02-19 13:31:00 +01:00
short_desc+=" - HTML notebook"
pycompile_module="IPython"
pkg_install() {
vmove usr/lib/python2.7/site-packages/IPython/html
}
}
python-ipython-qtconsole_package() {
noarch=yes
2015-03-15 17:00:00 +01:00
depends="${sourcepkg}-${version}_${revision} python-pyzmq python-Pygments
2015-02-19 13:31:00 +01:00
python-PyQt4 desktop-file-utils"
short_desc+=" - Qt console"
pycompile_module="IPython"
pkg_install() {
vmkdir usr/lib/python2.7/site-packages/IPython
vcopy ${wrksrc}/IPython/qt usr/lib/python2.7/site-packages/IPython
vmove usr/share/applications/ipython-qtconsole.desktop
}
}
python3.4-ipython_package() {
noarch=yes
2015-03-15 17:00:00 +01:00
depends="python3.4-decorator python3.4-path python3.4-pexpect
python3.4-simplegeneric"
2015-02-19 13:31:00 +01:00
short_desc="${_short_desc}"
pycompile_version="3.4"
pycompile_module="IPython"
pkg_install() {
vmove usr/bin/*3
vmove usr/lib/python3.4
vmove usr/share/man/man1/*3.1
2015-03-15 17:00:00 +01:00
vlicense COPYING.rst LICENSE
2015-02-19 13:31:00 +01:00
}
}
python3.4-ipython-notebook_package() {
noarch=yes
2015-03-15 17:00:00 +01:00
depends="python3.4-ipython-${version}_${revision} python3.4-pyzmq
python3.4-Jinja2 python3.4-tornado python3.4-jsonschema python3.4-Pygments
python3.4-mistune python3.4-terminado mathjax"
2015-02-19 13:31:00 +01:00
short_desc="${_short_desc} - HTML notebook"
pycompile_version="3.4"
2015-02-19 13:31:00 +01:00
pycompile_module="IPython"
pkg_install() {
vmove usr/lib/python3.4/site-packages/IPython/html
}
}
python3.4-ipython-qtconsole_package() {
noarch=yes
2015-03-15 17:00:00 +01:00
depends="python3.4-ipython-${version}_${revision} python3.4-pyzmq
2015-02-19 13:31:00 +01:00
python3.4-Pygments python3.4-PyQt4 desktop-file-utils"
short_desc="${_short_desc} - Qt console"
pycompile_version="3.4"
pycompile_module="IPython"
pkg_install() {
vmkdir usr/lib/python3.4/site-packages/IPython
vcopy ${wrksrc}/IPython/qt usr/lib/python3.4/site-packages/IPython
vmove usr/share/applications/ipython3-qtconsole.desktop
}
}