recipe 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Build recipe for bison.
  2. #
  3. # Copyright (c) 2015-2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=bison
  19. version=3.8.2
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=devel
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch=https://ftp.gnu.org/gnu/bison/$tarname
  26. description="
  27. GNU parser generator.
  28. Bison is a general-purpose parser generator that converts an annotated
  29. context-free grammar into a deterministic LR or generalized LR (GLR)
  30. parser employing LALR(1) parser tables. As an experimental feature,
  31. bison can also generate IELR(1) or canonical LR(1) parser tables.
  32. Once you are proficient with Bison, you can use it to develop a wide
  33. range of language parsers, from those used in simple desk calculators
  34. to complex programming languages.
  35. "
  36. homepage=https://www.gnu.org/software/bison
  37. license=GPLv3+
  38. # Source documentation
  39. #
  40. # The documentation files are installed by Bison.
  41. #
  42. #docs="AUTHORS COPYING ChangeLog NEWS README* THANKS TODO"
  43. docsdir="${docdir}/${program}-${version}"
  44. build()
  45. {
  46. unpack "${tardir}/$tarname"
  47. cd "$srcdir"
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
  51. LDFLAGS="$QILDFLAGS -static" \
  52. $configure_args \
  53. --libdir=/usr/lib${libSuffix} \
  54. --infodir=$infodir \
  55. --docdir=$docsdir \
  56. --enable-threads=posix \
  57. --enable-nls \
  58. --build="$(gcc -dumpmachine)"
  59. make -j${jobs} V=1
  60. make -j1 install DESTDIR="$destdir"
  61. # Delete generated charset.alias
  62. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  63. # Compress info documents deleting index file for the package
  64. if test -d "${destdir}/$infodir"
  65. then
  66. rm -f "${destdir}/${infodir}/dir"
  67. lzip -9 "${destdir}/${infodir}"/*
  68. fi
  69. # Compress man pages
  70. if test -d "${destdir}/$mandir"
  71. then
  72. lzip -9 "${destdir}/${mandir}"/man?/*
  73. fi
  74. }