Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (50 sloc) 2.42 KB
#pymol PKGBUILD
#Maintainter: Duca
#Contributors: yescalona, Carlos Ríos V. (aka crosvera)
pkgname=pymol-svn
pkgver=3937
pkgrel=1
pkgdesc="PyMOL is a molecular visualization system written in Python"
arch=('i686' 'x86_64')
url="http://pymol.sourceforge.net/"
license=('GPL')
_python="python2"
python_ver=`${_python} -c 'import sys; print(sys.version[:3])'`
depends=("${_python}" 'freeglut' 'libpng' 'python-numpy' 'python-pmw' 'freetype2')
makedepends=("subversion" "python")
source=()
md5sums=()
_svntrunk=https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol
_svnmod=pymol
build() {
cd ${srcdir}
if [ -d $_svnmod/.svn ]; then
msg "SVN tree found, reverting changes and updating to -r$pkgver"
(cd $_svnmod && svn revert -R . && make clean; svn up -r $pkgver) || return 1
else
msg "Checking out SVN tree of -r$pkgver"
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod || return 1
fi
cd ${_svnmod}
#fix for solve problem with new libpng 1.4
sed -e "s/ret = png_check_sig(buf, 8);/ret = !png_sig_cmp (buf,0,8);/" -i ${srcdir}/pymol/layer0/MyPNG.c || return 1
${_python} setup.py build || return 1
${_python} setup.py install --root=$pkgdir --prefix=/usr || return 1
#fix of setup2.py file
sed -e "s| site_packages =.*| site_packages = \"${pkgdir}/usr/lib/python${python_ver}/site-packages\"|g" -i setup2.py || return 1
sed -e "s| pymol_path =.*| pymol_path = \"${pkgdir}/usr/lib/python${python_ver}/site-packages/pymol/pymol_path\"|g" -i setup2.py || return 1
#for import pymol (i dont know if lib.linux-i686-${python_ver} is a common directory)
if [ "$CARCH" = "i686" ]; then
export PYTHONPATH=${srcdir}/pymol/build/lib.linux-i686-${python_ver}
fi
if [ "$CARCH" = "x86_64" ]; then
export PYTHONPATH=${srcdir}/pymol/build/lib.linux-x86_64-${python_ver}
fi
${_python} setup2.py install --root=$pkgdir --prefix=/usr || return 1
install -D -m755 ${startdir}/pymol.sh ${pkgdir}/usr/bin/pymol || return 1
install -D -m644 ${startdir}/pymol.desktop ${pkgdir}/usr/share/applications/pymol.desktop || return 1
install -D -m644 ${startdir}/pymol.jpg ${pkgdir}/usr/share/pixmaps/pymol.jpg || return 1
#fix of api.py ?
sed -e "s/as = show_as/#as = show_as/g" -i ${pkgdir}/usr/lib/python${python_ver}/site-packages/pymol/api.py || return 1
sed -e "s|python[0-9\.]*|${_python}|g" -i ${pkgdir}/usr/bin/pymol || return 1
}