Date: Tuesday, June 30, 2020 @ 13:37:21 Author: kgizdov Revision: 657163
upgpkg: python-antlr4 4.8-1 Added: python-antlr4/trunk/fix-tests.patch Modified: python-antlr4/trunk/PKGBUILD -----------------+ PKGBUILD | 28 +++++++++++++++++++++------- fix-tests.patch | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 7 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2020-06-30 13:02:16 UTC (rev 657162) +++ PKGBUILD 2020-06-30 13:37:21 UTC (rev 657163) @@ -1,8 +1,9 @@ # Maintainer: Baptiste Jonglez <archlinux at bitsofnetworks dot org> -pkgname=python-antlr4 -pkgver=4.7.2 -pkgrel=2 +_pkgname=antlr4 +pkgname=python-${_pkgname} +pkgver=4.8 +pkgrel=1 pkgdesc="ANTLR4 runtime for Python" arch=('any') url="https://www.antlr.org/" @@ -9,15 +10,28 @@ license=('BSD') depends=('python') makedepends=('python-setuptools') -source=("https://pypi.io/packages/source/a/antlr4-python3-runtime/antlr4-python3-runtime-$pkgver.tar.gz") -sha256sums=('168cdcec8fb9152e84a87ca6fd261b3d54c8f6358f42ab3b813b14a7193bb50b') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/antlr/${_pkgname}/archive/${pkgver}.tar.gz" + 'fix-tests.patch') +sha256sums=('992d52444b81ed75e52ea62f9f38ecb7652d5ce2a2130af143912b3042a6d77e' + 'dd83a2cc00457123c8b52da018d05a7e80d251adba0f39bf287258f97892a698') +prepare() { + patch -Np1 -i "${srcdir}"/fix-tests.patch -d "${srcdir}/${_pkgname}-${pkgver}" +} + build() { - cd "$srcdir/antlr4-python3-runtime-$pkgver" + cd "${srcdir}/${_pkgname}-${pkgver}/runtime/Python3" python setup.py build } +check() { + cd "${srcdir}/${_pkgname}-${pkgver}/runtime/Python3" + python setup.py test +} + package() { - cd "$srcdir/antlr4-python3-runtime-$pkgver" + cd "${srcdir}/${_pkgname}-${pkgver}/runtime/Python3" python setup.py install --root="$pkgdir" --optimize=1 --skip-build + install -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm644 "${srcdir}/${_pkgname}-${pkgver}"/LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}"/LICENSE } Added: fix-tests.patch =================================================================== --- fix-tests.patch (rev 0) +++ fix-tests.patch 2020-06-30 13:37:21 UTC (rev 657163) @@ -0,0 +1,53 @@ +diff -aur antlr4-4.8-old/runtime/Python3/test/ctest.py antlr4-4.8-new/runtime/Python3/test/ctest.py +--- antlr4-4.8-old/runtime/Python3/test/ctest.py 2020-01-19 18:18:55.000000000 +0200 ++++ antlr4-4.8-new/runtime/Python3/test/ctest.py 2020-06-30 16:32:13.862026103 +0300 +@@ -7,8 +7,8 @@ + import sys + sys.setrecursionlimit(4000) + import antlr4 +-from parser.cparser import CParser +-from parser.clexer import CLexer ++from .parser.cparser import CParser ++from .parser.clexer import CLexer + from datetime import datetime + import cProfile + +diff -aur antlr4-4.8-old/runtime/Python3/test/run.py antlr4-4.8-new/runtime/Python3/test/run.py +--- antlr4-4.8-old/runtime/Python3/test/run.py 2020-01-19 18:18:55.000000000 +0200 ++++ antlr4-4.8-new/runtime/Python3/test/run.py 2020-06-30 16:32:26.675359328 +0300 +@@ -3,6 +3,6 @@ + src_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src') + sys.path.insert(0,src_path) + from TestTokenStreamRewriter import TestTokenStreamRewriter +-from xpathtest import XPathTest ++from .xpathtest import XPathTest + import unittest +-unittest.main() +\ No newline at end of file ++unittest.main() +diff -aur antlr4-4.8-old/runtime/Python3/test/TestTokenStreamRewriter.py antlr4-4.8-new/runtime/Python3/test/TestTokenStreamRewriter.py +--- antlr4-4.8-old/runtime/Python3/test/TestTokenStreamRewriter.py 2020-01-19 18:18:55.000000000 +0200 ++++ antlr4-4.8-new/runtime/Python3/test/TestTokenStreamRewriter.py 2020-06-30 16:32:36.462025917 +0300 +@@ -5,7 +5,7 @@ + import unittest + + +-from mocks.TestLexer import TestLexer, TestLexer2 ++from .mocks.TestLexer import TestLexer, TestLexer2 + from antlr4.TokenStreamRewriter import TokenStreamRewriter + from antlr4.InputStream import InputStream + from antlr4.CommonTokenStream import CommonTokenStream +diff -aur antlr4-4.8-old/runtime/Python3/test/xpathtest.py antlr4-4.8-new/runtime/Python3/test/xpathtest.py +--- antlr4-4.8-old/runtime/Python3/test/xpathtest.py 2020-01-19 18:18:55.000000000 +0200 ++++ antlr4-4.8-new/runtime/Python3/test/xpathtest.py 2020-06-30 16:32:44.398692519 +0300 +@@ -2,8 +2,8 @@ + from antlr4 import InputStream, CommonTokenStream, TerminalNode + from antlr4.xpath.XPath import XPath + import unittest +-from expr.ExprParser import ExprParser +-from expr.ExprLexer import ExprLexer ++from .expr.ExprParser import ExprParser ++from .expr.ExprLexer import ExprLexer + + def tokenToString(token, ruleNames): + if isinstance(token, TerminalNode):