PKGBUILD 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Maintainer (Arch): Andrea Scarpino <andrea@archlinux.org>
  2. # Contributor (Arch): George Giorgidze <giorgidze (at) gmail.com>
  3. # Contributor (Arch): Stefan Husmann <stefan-husmann@t-online.de>
  4. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  5. # Contributor: Luke Shumaker <lukeshu@parabola.nu>
  6. pkgbase=antlr2
  7. pkgname=('antlr2' antlr2-{java,python2,cxx})
  8. pkgver=2.7.7
  9. pkgrel=9
  10. pkgrel+=.par1
  11. pkgdesc="Language recognition tool providing a framework to build grammatical parsers"
  12. arch=('x86_64')
  13. arch+=('i686' 'armv7h')
  14. url="http://www.antlr2.org/"
  15. license=('custom:Public Domain')
  16. makedepends=('java-environment' 'python2' 'bash' 'jh')
  17. options=('staticlibs')
  18. source=("http://www.antlr2.org/download/antlr-${pkgver}.tar.gz"
  19. "https://repo.maven.apache.org/maven2/antlr/antlr/$pkgver/antlr-$pkgver.pom"
  20. 'runantlr2.sh'
  21. 'gcc4.4.patch')
  22. sha256sums=('853aeb021aef7586bda29e74a6b03006bcb565a755c86b66032d8ec31b67dbb9'
  23. '100f793ba27f8b4e4204edb46171ebf36e54e0f94cfc02527fea07a0bb1fceb7'
  24. '04c5b1e4d1fef6fe31852ecba2c18313dfa9d9971ee317274ea964b6f658c255'
  25. 'b37444f9867544b8c7ad498b0bface51de0b34af8ef88eb7e2b298f102a10b1b')
  26. prepare() {
  27. cd "${srcdir}/antlr-${pkgver}"
  28. patch -Np1 -i "${srcdir}"/gcc4.4.patch
  29. }
  30. build() {
  31. cd "${srcdir}/antlr-${pkgver}"
  32. ./configure --prefix=/usr \
  33. --disable-examples \
  34. --disable-csharp
  35. make
  36. }
  37. _install_license() {
  38. install -Dm644 "$srcdir"/antlr-${pkgver}/LICENSE.txt \
  39. "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  40. }
  41. package_antlr2() {
  42. depends=('bash' 'antlr2-java')
  43. install -Dm755 "$srcdir"/runantlr2.sh "$pkgdir"/usr/bin/runantlr2
  44. _install_license
  45. }
  46. package_antlr2-java() {
  47. pkgdesc+=" (Java version)"
  48. depends=('java-runtime')
  49. provides=("java-antlr2=$pkgver")
  50. conflicts=("java-antlr2")
  51. replaces=("java-antlr2")
  52. DESTDIR="$pkgdir" jh mvn-install antlr antlr $pkgver \
  53. "$srcdir"/antlr-${pkgver}.pom \
  54. "$srcdir"/antlr-${pkgver}/antlr/antlr.jar \
  55. antlr2.jar
  56. ln -s "/usr/share/java/antlr2.jar" \
  57. "${pkgdir}/usr/share/java/antlr2-${pkgver}.jar"
  58. _install_license
  59. }
  60. package_antlr2-python2() {
  61. pkgdesc+=" (Python version)"
  62. depends=('python2')
  63. provides=("python2-antlr2=$pkgver")
  64. conflicts=("python2-antlr2")
  65. replaces=("python2-antlr2")
  66. cd "$srcdir"/antlr-${pkgver}/lib/python
  67. python2 setup.py install --root="${pkgdir}" --optimize=1
  68. _install_license
  69. }
  70. package_antlr2-cxx() {
  71. pkgdesc+=" (C++ version)"
  72. cd "$srcdir"/antlr-${pkgver}/lib/cpp
  73. make prefix="${pkgdir}/usr" install
  74. _install_license
  75. }