mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-23 09:22:12 +08:00
antlr2: moved from core to desktop, FS#1865
This commit is contained in:
parent
a44f2147a1
commit
2e1510534d
55
antlr2/PKGBUILD
Normal file
55
antlr2/PKGBUILD
Normal file
@ -0,0 +1,55 @@
|
||||
pkgbase=antlr2
|
||||
pkgname=('antlr2' 'python2-antlr2')
|
||||
pkgver=2.7.7
|
||||
pkgrel=5
|
||||
arch=('x86_64')
|
||||
url="http://www.antlr2.org/"
|
||||
license=('custom')
|
||||
makedepends=('java-environment' 'python2' 'sh')
|
||||
source=("http://www.antlr2.org/download/antlr-${pkgver}.tar.gz"
|
||||
'runantlr2.sh'
|
||||
'gcc4.4.patch')
|
||||
sha512sums=('faa72d2ddcba434ef1233e70c1549e63eba67c00793966322e821cf7f015cccb804448cb92d8fbef0429f59928fad65ec954f8ffbda0acbb8e983de0806d349d'
|
||||
'703c2c0ba3c14fc3268d068d039dc55dbb8191ac1a1786be9c733f95cedc42cdab9dd1052ba6f63f9f629331e65785dda3e5feda4063081471501edcb4efa34c'
|
||||
'f44fd917142260756033bd7a1bcf5049df7914f4c0ab934b63974fd05491bce883f8b11f55c2864174495ff5de0e1ab3956d52dd4d68980fd592490d7a681d6a')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/antlr-${pkgver}"
|
||||
patch -Np0 -i ${srcdir}/gcc4.4.patch
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--disable-examples \
|
||||
--disable-csharp
|
||||
make
|
||||
}
|
||||
|
||||
package_antlr2() {
|
||||
pkgdesc="ANother Tool for Language Recognition, (formerly PCCTS) is a language tool that provides a framework for constructing recognizers, compilers, and translators from grammatical descriptions containing C++ or Java actions"
|
||||
depends=('java-runtime' 'sh')
|
||||
replaces=('antlr')
|
||||
conflicts=('antlr')
|
||||
provides=("antlr=${pkgver}")
|
||||
|
||||
cd ${srcdir}/antlr-${pkgver}/lib/cpp
|
||||
make prefix="${pkgdir}/usr" install
|
||||
|
||||
install -Dm644 ${srcdir}/antlr-${pkgver}/antlr/antlr.jar \
|
||||
"${pkgdir}/usr/share/java/antlr2.jar"
|
||||
install -Dm755 ${srcdir}/runantlr2.sh ${pkgdir}/usr/bin/runantlr2
|
||||
install -Dm644 ${srcdir}/antlr-${pkgver}/LICENSE.txt \
|
||||
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||
}
|
||||
|
||||
package_python2-antlr2() {
|
||||
pkgdesc="ANother Tool for Language Recognition, (formerly PCCTS) is a language tool that provides a framework for constructing recognizers, compilers, and translators from grammatical descriptions containing C++ or Java actions (Python version)"
|
||||
depends=('antlr2' 'python2')
|
||||
replaces=('python-antlr' 'python-antlr2')
|
||||
conflicts=('python-antlr' 'python-antlr2')
|
||||
provides=("python-antlr=${pkgver}")
|
||||
|
||||
cd ${srcdir}/antlr-${pkgver}/lib/python
|
||||
python2 setup.py install --root="${pkgdir}" --optimize=1
|
||||
|
||||
install -d ${pkgdir}/usr/share/licenses
|
||||
ln -s /usr/share/licenses/antlr2 ${pkgdir}/usr/share/licenses/${pkgname}
|
||||
}
|
21
antlr2/gcc4.4.patch
Normal file
21
antlr2/gcc4.4.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff -Naur antlr-2.7.7.orig/lib/cpp/antlr/CharScanner.hpp antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp
|
||||
--- lib/cpp/antlr/CharScanner.hpp 2006-11-01 22:37:17.000000000 +0100
|
||||
+++ lib/cpp/antlr/CharScanner.hpp 2008-03-19 20:09:21.000000000 +0100
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <antlr/config.hpp>
|
||||
|
||||
+#include <cstring>
|
||||
#include <map>
|
||||
|
||||
#ifdef HAS_NOT_CCTYPE_H
|
||||
--- lib/cpp/antlr/CharScanner.hpp~ 2008-11-11 21:24:02.000000000 +0000
|
||||
+++ lib/cpp/antlr/CharScanner.hpp 2008-11-11 21:24:33.000000000 +0000
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <antlr/config.hpp>
|
||||
|
||||
+#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
|
5
antlr2/runantlr2.sh
Normal file
5
antlr2/runantlr2.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
echo Running 'java antlr.Tool $*' with /usr/share/java/antlr2.jar appended to the CLASSPATH variable
|
||||
export CLASSPATH
|
||||
CLASSPATH=$CLASSPATH:/usr/share/java/antlr2.jar
|
||||
java antlr.Tool $*
|
Loading…
Reference in New Issue
Block a user