Date: Tuesday, January 8, 2019 @ 09:16:48 Author: alad Revision: 421012
import pygraphviz Added: pygraphviz/ pygraphviz/repos/ pygraphviz/trunk/ pygraphviz/trunk/PKGBUILD ----------+ PKGBUILD | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) Added: pygraphviz/trunk/PKGBUILD =================================================================== --- pygraphviz/trunk/PKGBUILD (rev 0) +++ pygraphviz/trunk/PKGBUILD 2019-01-08 09:16:48 UTC (rev 421012) @@ -0,0 +1,51 @@ +# Maintainer: Alad Wenter <a...@mailbox.org> +# Contributor: Clément DEMOULINS <clem...@archivel.fr> +pkgbase=pygraphviz +pkgname=('python-pygraphviz' 'python2-pygraphviz') +pkgver=1.5 +pkgrel=1 +pkgdesc='Python interface to the Graphviz graph layout and visualization package' +makedepends=('python' 'python2' 'graphviz' 'python-setuptools' 'python2-setuptools') +arch=('x86_64') +license=('LGPL') +url='https://pygraphviz.github.io/' +source=("https://github.com/$pkgbase/$pkgbase/archive/$pkgbase-$pkgver.tar.gz") +sha256sums=('58c3122c7efb9a62275a915953818acd5b3e113b943075501d316ab2291dc21d') + +prepare() { + cp -a "$pkgbase-$pkgbase-$pkgver" "python2-$pkgbase-$pkgver" +} + +build() { + cd "$pkgbase-$pkgbase-$pkgver" + python setup.py build + + cd ../"python2-$pkgbase-$pkgver" + python2 setup.py build +} + +package_python-pygraphviz() { + depends=('python3' 'graphviz') + + cd "$pkgbase-$pkgbase-$pkgver" + python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \ + --include-path /usr/include/graphviz \ + --library-path /usr/lib/graphviz + mv "$pkgdir/usr/share/doc/$pkgbase-$pkgver" "$pkgdir/usr/share/doc/python-pygraphviz" +} + +package_python2-pygraphviz() { + depends=('python2' 'graphviz') + + cd "python2-$pkgbase-$pkgver" + python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \ + --include-path /usr/include/graphviz \ + --library-path /usr/lib/graphviz + mv "$pkgdir/usr/share/doc/$pkgbase-$pkgver" "$pkgdir/usr/share/doc/python2-pygraphviz" + + # Patch to use python2 + find "$pkgdir" -type f \( -name '*.py' -or -executable \) -exec \ + sed -i -e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \ + -e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' \ + {} \; +}