diff options
author | Shining Xu | 2018-10-13 20:36:14 +0800 |
---|---|---|
committer | Shining Xu | 2018-10-13 20:36:14 +0800 |
commit | 2f2d2f90de02a6f310567e2532350a5ca2a7c4eb (patch) | |
tree | 75c3b09735b440e600613ded88dbc1cf50eae942 | |
download | aur-python-jcc.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rw-r--r-- | jdk.patch | 24 |
3 files changed, 81 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d2221b3704e5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = python-jcc + pkgdesc = A C++ code generator for calling Java from C++/Python + pkgver = 3.2 + pkgrel = 1 + url = https://lucene.apache.org/pylucene/jcc/index.html + arch = x86_64 + license = Apache + makedepends = python-setuptools + depends = java-environment + depends = python + source = https://files.pythonhosted.org/packages/source/J/JCC/JCC-3.2.tar.gz + source = jdk.patch + sha256sums = 9f7336c2ea742a8990b193d162a4d029276d0952704702de45d83798309497d4 + sha256sums = 77a55bd33d0204516492cd78cef41a2686f388df86108cbbae5b3ca67dab8281 + +pkgname = python-jcc + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..653e208ae9e6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: Shining Xu <skyfiretime at gmail dot com> + +pkgname=python-jcc +_name=JCC +pkgver=3.2 +pkgrel=1 +pkgdesc='A C++ code generator for calling Java from C++/Python' +arch=('x86_64') +url='https://lucene.apache.org/pylucene/jcc/index.html' +license=('Apache') +depends=('java-environment' 'python') +makedepends=('python-setuptools') +source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz" + 'jdk.patch') +sha256sums=('9f7336c2ea742a8990b193d162a4d029276d0952704702de45d83798309497d4' + '77a55bd33d0204516492cd78cef41a2686f388df86108cbbae5b3ca67dab8281') + +prepare() { + cd "$_name-$pkgver" + patch -p1 -i "$srcdir/jdk.patch" + + # Apply patches for OpenJDK 10 because library files are moved from + # /usr/lib/jvm/default/jre/lib/amd64/ to /usr/lib/jvm/default/lib/ + # and /usr/lib/jvm/default/jre/lib/amd64/server/ to + # /usr/lib/jvm/default/lib/server/ + if [ $(archlinux-java get) == 'java-10-openjdk' ]; then + # remove "/jre" and "/amd64" + sed -i '155,157s/\/jre\|\/amd64//g' setup.py + fi +} + +build() { + cd "$_name-$pkgver" + python setup.py build +} + +package() { + cd "$_name-$pkgver" + python setup.py install --skip-build -O1 --root="$pkgdir" +} diff --git a/jdk.patch b/jdk.patch new file mode 100644 index 000000000000..d2f9260ea2ad --- /dev/null +++ b/jdk.patch @@ -0,0 +1,24 @@ +--- old/setup.py 2018-08-29 01:48:46.000000000 +0800 ++++ new/setup.py 2018-10-13 19:38:44.597499786 +0800 +@@ -68,7 +68,7 @@ + JDK = { + 'darwin': JAVAHOME or JAVAFRAMEWORKS, + 'ipod': '/usr/include/gcc', +- 'linux': '/usr/lib/jvm/java-8-oracle', ++ 'linux': '/usr/lib/jvm/default', + 'sunos5': '/usr/jdk/instances/jdk1.6.0', + 'win32': JAVAHOME, + 'mingw32': JAVAHOME, +@@ -211,7 +211,11 @@ + from pkg_resources import SetuptoolsVersion + with_modern_setuptools = True + except ImportError: +- with_modern_setuptools = False ++ try: ++ from packaging.version import Version ++ with_modern_setuptools = True ++ except ImportError: ++ with_modern_setuptools = False + + enable_shared = False + |