[arch-commits] Commit in lrcalc/trunk (PKGBUILD)
Antonio Rojas
arojas at archlinux.org
Tue Feb 16 19:23:33 UTC 2021
Date: Tuesday, February 16, 2021 @ 19:23:33
Author: arojas
Revision: 862330
Add python bindings
Modified:
lrcalc/trunk/PKGBUILD
----------+
PKGBUILD | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-02-16 18:50:11 UTC (rev 862329)
+++ PKGBUILD 2021-02-16 19:23:33 UTC (rev 862330)
@@ -2,22 +2,40 @@
pkgname=lrcalc
pkgver=2.0
-pkgrel=1
+pkgrel=2
pkgdesc="Littlewood-Richardson calculator"
arch=(x86_64)
url="https://math.rutgers.edu/~asbuch/lrcalc/"
license=(GPL3)
depends=(glibc)
-source=("https://math.rutgers.edu/~asbuch/lrcalc/$pkgname-$pkgver.tar.gz")
-sha256sums=('f05f16e51c45a35c1c24ef5f70fc3e822515b8de5d929b391801f68c493d5f43')
+makedepends=(python-setuptools cython)
+source=("https://math.rutgers.edu/~asbuch/lrcalc/$pkgname-$pkgver.tar.gz"
+ lrcalc-python-bindings.patch::"https://bitbucket.org/asbuch/lrcalc/commits/08bd8dd5/raw")
+sha256sums=('f05f16e51c45a35c1c24ef5f70fc3e822515b8de5d929b391801f68c493d5f43'
+ '7b115f47f5953f348f991e3aeed7e6d18ff306dee573d34f565fb0d5a9c0e43a')
+prepare() {
+ patch -d $pkgname-$pkgver -p1 < lrcalc-python-bindings.patch # Add python bindings
+ sed -e "s|setup(|setup(name='lrcalc', version=$pkgver,|" -i $pkgname-$pkgver/python/setup.py # Fix metadata
+}
+
build() {
cd $pkgname-$pkgver
./configure --prefix=/usr
make
+
+# install to a temp dir to build python bindings
+ make DESTDIR="$PWD"/tmp-install install
+
+ cd python
+ export CFLAGS+=" -I${srcdir}/$pkgname-$pkgver/tmp-install/usr/include" LDFLAGS+=" -L${srcdir}/$pkgname-$pkgver/tmp-install/usr/lib"
+ python setup.py build
}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
+
+ cd python
+ python setup.py install --skip-build --root="$pkgdir" --optimize=1
}
More information about the arch-commits
mailing list