2015-02-19 12:31:00 +00:00
|
|
|
# Template file for 'python-ipython'
|
|
|
|
pkgname=python-ipython
|
2015-03-15 16:00:00 +00:00
|
|
|
version=3.0.0
|
|
|
|
revision=1
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
depends="python-decorator python-path python-pexpect python-simplegeneric"
|
2015-02-19 12:31:00 +00: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-03-15 16:00:00 +00:00
|
|
|
checksum=86070141110101b6b55e6dc31a40461c437d391a5337a6e5e349357dc18bfbb4
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
for f in decorator{,s} path pexpect simplegeneric; do
|
2015-02-19 12:31:00 +00: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 16:00:00 +00: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 12:31:00 +00: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 16:00:00 +00:00
|
|
|
sed -i 's/ipython/&3/g;s/IPython/&3/g' \
|
|
|
|
"${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop"
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
depends="${sourcepkg}-${version}_${revision} python-pyzmq python-Jinja2
|
|
|
|
python-tornado python-jsonschema python-Pygments python-mistune
|
|
|
|
python-terminado mathjax"
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
depends="${sourcepkg}-${version}_${revision} python-pyzmq python-Pygments
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
depends="python3.4-decorator python3.4-path python3.4-pexpect
|
|
|
|
python3.4-simplegeneric"
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
vlicense COPYING.rst LICENSE
|
2015-02-19 12:31:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
python3.4-ipython-notebook_package() {
|
|
|
|
noarch=yes
|
2015-03-15 16:00:00 +00: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 12:31:00 +00:00
|
|
|
short_desc="${_short_desc} - HTML notebook"
|
2015-02-19 20:12:00 +00:00
|
|
|
pycompile_version="3.4"
|
2015-02-19 12:31:00 +00: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 16:00:00 +00:00
|
|
|
depends="python3.4-ipython-${version}_${revision} python3.4-pyzmq
|
2015-02-19 12:31:00 +00: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
|
|
|
|
}
|
|
|
|
}
|