Skip to content

Instantly share code, notes, and snippets.

@flying-sheep
Last active April 5, 2017 14:31
Show Gist options
  • Select an option

  • Save flying-sheep/1507555ea3b6c535838f2aa629c3f3fc to your computer and use it in GitHub Desktop.

Select an option

Save flying-sheep/1507555ea3b6c535838f2aa629c3f3fc to your computer and use it in GitHub Desktop.
pyjnius split package PKGBUILD
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