1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 PATCHES="${PN}-3.3-patches-01.tar.xz"
10 DESCRIPTION="A general-purpose (yacc-compatible) parser generator"
11 HOMEPAGE="https://www.gnu.org/software/bison/"
12 SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
13 https://dev.gentoo.org/~whissi/dist/bison/${PATCHES}
14 https://dev.gentoo.org/~polynomial-c/dist/bison/${PATCHES}"
18 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
19 IUSE="examples nls static test"
20 RESTRICT="!test? ( test )"
22 RDEPEND=">=sys-devel/m4-1.4.16"
25 examples? ( dev-lang/perl )
26 nls? ( sys-devel/gettext )
27 test? ( dev-lang/perl )"
29 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) # ChangeLog-2012 ChangeLog-1998 PACKAGING README-alpha README-release
32 "${WORKDIR}"/patches/${PN}-3.1-optional-perl.patch #538300
33 "${WORKDIR}"/patches/${PN}-3.3-avoid_autoreconf.patch
37 # Record date to avoid 'config.status --recheck' & regen of 'tests/package.m4'
38 touch -r configure.ac old.configure.ac || die
39 touch -r configure old.configure || die
43 # Restore date after patching
44 touch -r old.configure.ac configure.ac || die
45 touch -r old.configure configure || die
47 # The makefiles make the man page depend on the configure script
48 # which we patched above. Touch it to prevent regeneration.
49 touch doc/bison.1 || die #548778 #538300#9
51 # Avoid regenerating the info page when the timezone is diff. #574492
52 sed -i '2iexport TZ=UTC' build-aux/mdate-sh || die
56 use static && append-ldflags -static
59 $(use_enable examples)
62 econf "${myeconfargs[@]}"
68 # This one is installed by dev-util/yacc
69 mv "${ED%/}"/usr/bin/yacc{,.bison} || die
70 mv "${ED%/}"/usr/share/man/man1/yacc{,.bison}.1 || die
72 # We do not need liby.a
73 rm -r "${ED%/}"/usr/lib* || die
75 # Move to documentation directory and leave compressing for EAPI>=4
76 mv "${ED%/}"/usr/share/${PN}/README "${ED%/}"/usr/share/doc/${PF}/README.data
80 local f="${EROOT%/}/usr/bin/yacc"
81 if [[ ! -e ${f} ]] ; then
82 ln -s yacc.bison "${f}"
87 # clean up the dead symlink when we get unmerged #377469
88 local f="${EROOT%/}/usr/bin/yacc"
89 if [[ -L ${f} && ! -e ${f} ]] ; then