mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-23 18:14:51 +08:00
ipython: PKGBUILD now simpler to mantain and update
This commit is contained in:
parent
5385b686b2
commit
fcd2fb0a70
162
ipython/PKGBUILD
162
ipython/PKGBUILD
@ -1,62 +1,30 @@
|
||||
# Contributor : Arch Linux https://www.archlinux.org/packages/community/any/ipython/
|
||||
# https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/ipython
|
||||
|
||||
pkgbase=ipython
|
||||
pkgname=('ipython3' 'ipython2')
|
||||
pkgver=5.1.0
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="An enhanced Interactive Python shell."
|
||||
arch=('any')
|
||||
url="http://ipython.org"
|
||||
license=('BSD')
|
||||
makedepends=('python3' 'python2' 'python3-setuptools' 'python2-setuptools')
|
||||
makedepends=('python3' 'python2' 'python3-setuptools' 'python2-setuptools' 'python3-pip' 'python2-pip')
|
||||
optdepends=("python3-nose: for IPython's test suite")
|
||||
|
||||
# some of these will update rapidly, others never
|
||||
# so _vars will be phased in as new updates are released
|
||||
_traitv=4.2.0
|
||||
_psharev=0.7.3
|
||||
_backshutil=1.0.0
|
||||
_pathlib=1.0.1
|
||||
|
||||
source=("ipython-$pkgver.tgz::https://github.com/ipython/ipython/archive/$pkgver.tar.gz"
|
||||
"https://pypi.python.org/packages/source/t/traitlets/traitlets-$_traitv.tar.gz"
|
||||
"https://pypi.python.org/packages/source/i/ipython_genutils/ipython_genutils-0.1.0.tar.gz"
|
||||
"https://files.pythonhosted.org/packages/source/p/pickleshare/pickleshare-$_psharev.tar.gz"
|
||||
"https://pypi.python.org/packages/source/s/simplegeneric/simplegeneric-0.8.1.zip"
|
||||
#only ipython2
|
||||
"https://github.com/chrippa/backports.shutil_get_terminal_size/archive/v$_backshutil.tar.gz"
|
||||
"http://pypi.python.org/packages/source/p/pathlib/pathlib-$_pathlib.tar.gz"
|
||||
"ipython.png")
|
||||
"requirements_py3.txt"
|
||||
"requirements_py2.txt"
|
||||
"ipython.png"
|
||||
"ipython3.desktop"
|
||||
"ipython2.desktop")
|
||||
sha256sums=('82f733341c2b9b49fb51453dcd274cd4b3b7373c0e703a95ad796dfcd1fa2d92'
|
||||
'e4c39210f2f2ff7361b86043b6512adbcf6f024b44b501f7b42fd9a23402dea9'
|
||||
'3a0624a251a26463c9dfa0ffa635ec51c4265380980d9a50d65611c3c2bd82a6'
|
||||
'b9710d01f777b1bf3b69c8f889b1d05a5145668f79e980cbd0f849e059edd274'
|
||||
'dc972e06094b9af5b855b3df4a646395e43d1c9d0d39ed345b7393560d0b9173'
|
||||
'ebeddf414a973f6b1c08c35892a8c5330aa9368171d9f70d749909525d72c9f1'
|
||||
'6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f'
|
||||
'6dea629da7ed8ad8109029e27ec435b400e98fcd7f73a2cd00fc383f26250852')
|
||||
|
||||
# With 4.0 many previously bundled external libraries are no longer bundled
|
||||
# Since there are so many and they are so small, they get re-bundled here
|
||||
# Break them out if any non-ipython package ends up needing these
|
||||
|
||||
# traitlets (depends on python-decorator)
|
||||
# ipython_genutils
|
||||
# "Pretend this doesn’t exist. Nobody should use it."
|
||||
# "Vestigial IPython utilities: DO NOT USE"
|
||||
# (still required for now though, but drop at first chance)
|
||||
# pickleshare (depends on path.py)
|
||||
# simplegeneric (so old that it only comes in .zip and still refers to the cheeseshop)
|
||||
'9e4a7f35ccc98489042f16514b93a92f2f0ff2075a3e6f82ef2e84d864ee24b9'
|
||||
'69149ad9a2837462b75cd262fb705154a9c2e117c9cf0771e3c1be13950f6e8a'
|
||||
'6dea629da7ed8ad8109029e27ec435b400e98fcd7f73a2cd00fc383f26250852'
|
||||
'f849b54e68cf2f388cc36f6dbfc67f647b32dc387c24655ecd8fc38dbcffe90a'
|
||||
'ce98f0066bf6fd6dfe6df0559673cc56e099da1617e7a41e854ef95b89b61bb9')
|
||||
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir"
|
||||
cp -r ipython-$pkgver ipython2-$pkgver
|
||||
cp -r ipython_genutils-0.1.0 ipython2_genutils-0.1.0
|
||||
cp -r pickleshare-$_psharev python2-pickleshare-$_psharev
|
||||
cp -r traitlets-$_traitv python2-traitlets-$_traitv
|
||||
cp -r simplegeneric-0.8.1 python2-simplegeneric-0.8.1
|
||||
|
||||
# python 3.5 does not need a 3.3 backport hack
|
||||
cd "$srcdir/ipython-$pkgver"
|
||||
@ -64,71 +32,49 @@ prepare() {
|
||||
}
|
||||
|
||||
package_ipython3() {
|
||||
depends=('python3' 'python3-decorator' 'python3-pexpect' 'sqlite3' 'python3-setuptools' 'python3-path' 'python3-prompt_toolkit')
|
||||
# see https://github.com/ipython/ipython/issues/2057
|
||||
#export LC_ALL=en_US.UTF-8
|
||||
depends=('python3' 'python3-decorator' 'python3-pexpect' 'sqlite3' 'python3-setuptools')
|
||||
|
||||
# install deps
|
||||
pip3 install --target="${pkgdir}/usr/share/ipython3/modules/site-packages" -r $srcdir/requirements_py3.txt
|
||||
|
||||
# install ipython
|
||||
cd "$srcdir/ipython-$pkgver"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
# TEMPORARY!
|
||||
cd "$srcdir/ipython_genutils-0.1.0"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
# put wrapper on /usr/bin
|
||||
mkdir -p ${srcdir}/${pkgname}-bin
|
||||
for py in "$pkgdir/usr/bin/"*
|
||||
do
|
||||
py=${py##*/} # strip the file path and keep only the file name (e.g. /usr/bin/foo -> foo)
|
||||
echo "#!/bin/sh
|
||||
export PYTHONPATH=${PYTHONPATH}:/usr/share/${pkgname}/modules/site-packages
|
||||
/usr/share/${pkgname}/$py " '"${@}"' > "${srcdir}/${pkgname}-bin/$py"
|
||||
chmod 755 ${srcdir}/${pkgname}-bin/$py
|
||||
done
|
||||
mv ${pkgdir}/usr/bin/* ${pkgdir}/usr/share/${pkgname}
|
||||
mv ${srcdir}/${pkgname}-bin/* ${pkgdir}/usr/bin
|
||||
|
||||
cd "$srcdir/pickleshare-$_psharev"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/traitlets-$_traitv"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/simplegeneric-0.8.1"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/ipython-$pkgver"
|
||||
install -Dm644 docs/source/about/license_and_copyright.rst "$pkgdir/usr/share/licenses/ipython/LICENSE"
|
||||
|
||||
cd "$srcdir/ipython-$pkgver/examples/IPython Kernel/"
|
||||
# FS#45120
|
||||
sed -i 's/gnome-netstatus-idle/ipython/' *.desktop
|
||||
sed -i s!"IPython"!"IPython3"! *.desktop
|
||||
sed -i s!"Name[en_US]=ipython"!"Name[en_US]=ipython3"! *.desktop
|
||||
sed -i s!"Name=ipython"!"Name=ipython3"! *.desktop
|
||||
sed -i s!"Icon=ipython"!"Icon=ipython3"! *.desktop
|
||||
sed -i s!"Development;Utility;"!"Development;"! *.desktop
|
||||
install -Dm644 ipython.desktop "$pkgdir/usr/share/applications/ipython3.desktop"
|
||||
# .desktop and icon
|
||||
install -Dm644 $srcdir/ipython3.desktop "$pkgdir/usr/share/applications/ipython3.desktop"
|
||||
install -Dm644 "$srcdir/ipython.png" "$pkgdir/usr/share/pixmaps/ipython3.png"
|
||||
|
||||
# license
|
||||
cd "$srcdir/ipython-$pkgver"
|
||||
install -Dm644 docs/source/about/license_and_copyright.rst "$pkgdir/usr/share/licenses/ipython3/LICENSE"
|
||||
}
|
||||
|
||||
package_ipython2() {
|
||||
pkgdesc="An enhanced Interactive Python2 shell."
|
||||
depends=('python2' 'python2-decorator' 'python2-pexpect' 'sqlite3' 'python2-setuptools' 'python2-path' 'python2-prompt_toolkit')
|
||||
depends=('python2' 'python2-decorator' 'python2-pexpect' 'sqlite3' 'python2-setuptools')
|
||||
optdepends=("python2-nose: for IPython's test suite")
|
||||
|
||||
# install deps
|
||||
pip2 install --target="${pkgdir}/usr/share/ipython2/modules/site-packages" -r $srcdir/requirements_py2.txt
|
||||
|
||||
# install ipython
|
||||
cd "$srcdir/ipython2-$pkgver"
|
||||
|
||||
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
# TEMPORARY!
|
||||
cd "$srcdir/ipython2_genutils-0.1.0"
|
||||
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/python2-pickleshare-$_psharev"
|
||||
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/python2-traitlets-$_traitv"
|
||||
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/python2-simplegeneric-0.8.1"
|
||||
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/backports.shutil_get_terminal_size-$_backshutil"
|
||||
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
|
||||
|
||||
cd "$srcdir/pathlib-$_pathlib"
|
||||
python2 setup.py install --root="$pkgdir/" --optimize=1
|
||||
|
||||
cd "$srcdir/ipython2-$pkgver"
|
||||
install -Dm644 docs/source/about/license_and_copyright.rst "$pkgdir/usr/share/licenses/ipython2/LICENSE"
|
||||
|
||||
# hack to get around ipython collision
|
||||
cd "$pkgdir/usr/share/man/man1/"
|
||||
for i in *; do
|
||||
@ -136,10 +82,24 @@ package_ipython2() {
|
||||
done
|
||||
find "$pkgdir/usr/bin/" -type f -regex '.*[^2]$' -delete
|
||||
|
||||
cd "$srcdir/ipython2-$pkgver/examples/IPython Kernel/"
|
||||
sed -i 's/ython/ython2/g' *.desktop
|
||||
sed -i 's/gnome-netstatus-idle/ipython2/' *.desktop
|
||||
sed -i s!"Development;Utility;"!"Development;"! *.desktop
|
||||
install -Dm644 ipython.desktop "$pkgdir/usr/share/applications/ipython2.desktop"
|
||||
# put wrapper on /usr/bin
|
||||
mkdir -p ${srcdir}/${pkgname}-bin
|
||||
for py in "$pkgdir/usr/bin/"*
|
||||
do
|
||||
py=${py##*/} # strip the file path and keep only the file name (e.g. /usr/bin/foo -> foo)
|
||||
echo "#!/bin/sh
|
||||
export PYTHONPATH=${PYTHONPATH}:/usr/share/${pkgname}/modules/site-packages
|
||||
/usr/share/${pkgname}/$py " '"${@}"' > "${srcdir}/${pkgname}-bin/$py"
|
||||
chmod 755 ${srcdir}/${pkgname}-bin/$py
|
||||
done
|
||||
mv ${pkgdir}/usr/bin/* ${pkgdir}/usr/share/${pkgname}
|
||||
mv ${srcdir}/${pkgname}-bin/* ${pkgdir}/usr/bin
|
||||
|
||||
# .desktop and icon
|
||||
install -Dm644 $srcdir/ipython2.desktop "$pkgdir/usr/share/applications/ipython2.desktop"
|
||||
install -Dm644 "$srcdir/ipython.png" "$pkgdir/usr/share/pixmaps/ipython2.png"
|
||||
}
|
||||
|
||||
# license
|
||||
cd "$srcdir/ipython2-$pkgver"
|
||||
install -Dm644 docs/source/about/license_and_copyright.rst "$pkgdir/usr/share/licenses/ipython2/LICENSE"
|
||||
}
|
||||
|
12
ipython/ipython2.desktop
Normal file
12
ipython/ipython2.desktop
Normal file
@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Comment=Enhanced interactive Python2 shell
|
||||
Exec=ipython2
|
||||
GenericName[en_US]=IPython2
|
||||
GenericName=IPython2
|
||||
Icon=ipython2
|
||||
Name[en_US]=ipython2
|
||||
Name=ipython2
|
||||
Categories=Development;
|
||||
StartupNotify=false
|
||||
Terminal=true
|
||||
Type=Application
|
12
ipython/ipython3.desktop
Normal file
12
ipython/ipython3.desktop
Normal file
@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Comment=Enhanced interactive Python shell
|
||||
Exec=ipython
|
||||
GenericName[en_US]=IPython3
|
||||
GenericName=IPython3
|
||||
Icon=ipython3
|
||||
Name[en_US]=ipython3
|
||||
Name=ipython3
|
||||
Categories=Development;
|
||||
StartupNotify=false
|
||||
Terminal=true
|
||||
Type=Application
|
8
ipython/requirements_py2.txt
Normal file
8
ipython/requirements_py2.txt
Normal file
@ -0,0 +1,8 @@
|
||||
traitlets==4.2.0
|
||||
ipython_genutils==0.1.0
|
||||
pickleshare==0.7.3
|
||||
simplegeneric==0.8.1
|
||||
prompt_toolkit
|
||||
backports.shutil_get_terminal_size==1.0.0
|
||||
pathlib==1.0.1
|
||||
testpath
|
6
ipython/requirements_py3.txt
Normal file
6
ipython/requirements_py3.txt
Normal file
@ -0,0 +1,6 @@
|
||||
traitlets==4.2.0
|
||||
ipython_genutils==0.1.0
|
||||
pickleshare==0.7.3
|
||||
simplegeneric==0.8.1
|
||||
prompt_toolkit
|
||||
testpath
|
Loading…
Reference in New Issue
Block a user