Last active
April 5, 2017 14:31
-
-
Save flying-sheep/1507555ea3b6c535838f2aa629c3f3fc to your computer and use it in GitHub Desktop.
pyjnius split package PKGBUILD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pkgbase=pyjnius | |
| pkgname=(python2-$pkgbase python-$pkgbase) | |
| pkgver=1.1.1 | |
| pkgrel=1 | |
| pkgdesc='Python module to access Java class as Python class, using JNI.' | |
| arch=(any) | |
| url="https://github.com/kivy/$pkgbase" | |
| license=(LGPL3) | |
| source=("$pkgbase-$pkgver.tar.gz::https://github.com/kivy/$pkgbase/tarball/$pkgver") | |
| md5sums=(2d457e4761b27e6760cf54efb6201f17) | |
| prepare() { | |
| [[ ! -d "python-$pkgbase-$pkgver" ]] && mv "kivy-$pkgbase-"* "python-$pkgbase-$pkgver" || true | |
| [[ ! -d "python2-$pkgbase-$pkgver" ]] && cp -r python{,2}-"$pkgbase-$pkgver" || true | |
| } | |
| build() { | |
| local python=${pkgname%%-*} | |
| cd "$pkgname-$pkgver" | |
| $python setup.py build_ext --inplace -f | |
| $python setup.py build | |
| } | |
| package_python2-pyjnius() { | |
| depends=(java-environment python2) | |
| makedepends=(cython2) | |
| package_ python2 | |
| } | |
| package_python-pyjnius() { | |
| depends=(java-environment python) | |
| makedepends=(cython) | |
| package_ python | |
| } | |
| package_() { | |
| local python=$1 | |
| local pyver=$($python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') | |
| export PYTHONPATH="$pkgdir/usr/lib/python$pyver/site-packages" | |
| mkdir -p "$PYTHONPATH" | |
| cd "$srcdir/$pkgname-$pkgver" | |
| $python setup.py install --prefix="$pkgdir/usr" --optimize=1 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment