1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 PATCHES="${PN}-3.5.1-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 mirror://gentoo/${PATCHES}
14 https://dev.gentoo.org/~whissi/dist/bison/${PATCHES}
15 https://dev.gentoo.org/~polynomial-c/dist/bison/${PATCHES}"
19 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~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"
20 IUSE="examples nls static test"
21 RESTRICT="!test? ( test )"
23 RDEPEND=">=sys-devel/m4-1.4.16"
27 examples? ( dev-lang/perl )
28 nls? ( sys-devel/gettext )
29 test? ( dev-lang/perl )
32 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) # ChangeLog-2012 ChangeLog-1998 PACKAGING README-alpha README-release
35 "${WORKDIR}"/patches/${PN}-3.5-optional-perl.patch #538300
36 "${WORKDIR}"/patches/${PN}-3.5.1-avoid_autoreconf.patch
40 # Record date to avoid 'config.status --recheck' & regen of 'tests/package.m4'
41 touch -r configure.ac old.configure.ac || die
42 touch -r configure old.configure || die
46 # Restore date after patching
47 touch -r old.configure.ac configure.ac || die
48 touch -r old.configure configure || die
50 # The makefiles make the man page depend on the configure script
51 # which we patched above. Touch it to prevent regeneration.
52 touch doc/bison.1 || die #548778 #538300#9
54 # Avoid regenerating the info page when the timezone is diff. #574492
55 sed -i '2iexport TZ=UTC' build-aux/mdate-sh || die
59 use static && append-ldflags -static
62 --docdir='$(datarootdir)'/doc/${PF}
63 $(use_enable examples)
66 econf "${myeconfargs[@]}"
72 # This one is installed by dev-util/yacc
73 mv "${ED}"/usr/bin/yacc{,.bison} || die
74 mv "${ED}"/usr/share/man/man1/yacc{,.bison}.1 || die
76 # We do not need liby.a
77 rm -r "${ED}"/usr/lib* || die
81 local f="${EROOT}/usr/bin/yacc"
82 if [[ ! -e ${f} ]] ; then
83 ln -s yacc.bison "${f}"
88 # clean up the dead symlink when we get unmerged #377469
89 local f="${EROOT}/usr/bin/yacc"
90 if [[ -L ${f} && ! -e ${f} ]] ; then