logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

yacc-2.ebuild (1173B)


  1. # Copyright 2022-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. ALTERNATIVES=(
  5. "bison:>=sys-devel/bison-3.8.2-r1"
  6. byacc:dev-util/byacc
  7. oyacc:dev-util/oyacc
  8. "reference:>=dev-util/yacc-1.9.1-r7"
  9. )
  10. inherit app-alternatives
  11. DESCRIPTION="yacc symlinks"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
  13. RDEPEND="
  14. !<dev-util/yacc-1.9.1-r7
  15. !<sys-devel/bison-3.8.2-r1
  16. "
  17. src_install() {
  18. local alt=$(get_alternative)
  19. case ${alt} in
  20. # bison installs its own small wrapper script 'yacc-bison'
  21. # around bison(1).
  22. bison) alt=yacc.bison;;
  23. reference) alt=yacc-reference;;
  24. esac
  25. dosym "${alt}" /usr/bin/yacc
  26. newman - yacc.1 <<<".so ${alt}.1"
  27. # Leaving this for now to be safe, as it's closer to pre-alternatives
  28. # status quo to leave it unset and let autoconf probe for Bison by itself
  29. # as it prefers it anyway, and might be a CPP-like situation wrt
  30. # calling bison or bison -y if YACC is set.
  31. if [[ ${alt} != yacc.bison ]]; then
  32. newenvd - 90yacc <<-EOF
  33. YACC=${alt}
  34. EOF
  35. fi
  36. }