Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2018 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=7 |
5 |
|
6 |
inherit toolchain-funcs |
7 |
|
8 |
MY_P=${P/./-} |
9 |
DESCRIPTION="Backtracking YACC - modified from Berkeley YACC" |
10 |
HOMEPAGE="http://www.siber.com/btyacc" |
11 |
SRC_URI="http://www.siber.com/btyacc/${MY_P}.tar.gz" |
12 |
|
13 |
LICENSE="freedist" |
14 |
SLOT="0" |
15 |
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-fbsd ~x86-linux ~ppc-macos ~x86-macos" |
16 |
|
17 |
S="${WORKDIR}" |
18 |
|
19 |
PATCHES=( |
20 |
"${FILESDIR}/${P}-includes.patch" |
21 |
"${FILESDIR}/${P}-makefile.patch" |
22 |
) |
23 |
DOCS=( README README.BYACC ) |
24 |
|
25 |
src_prepare() { |
26 |
cp -av Makefile{,.orig} || die |
27 |
default |
28 |
# fix memory issue/glibc corruption |
29 |
sed -i -e "s|len + 13|len + 14|" main.c || die "Could not fix main.c" |
30 |
# Darwin doesn't do static binaries |
31 |
if [[ ${CHOST} == *-darwin* ]]; then |
32 |
sed -i -e 's/-static//' Makefile || die |
33 |
fi |
34 |
} |
35 |
|
36 |
src_compile() { |
37 |
tc-export CC |
38 |
emake CC=$(tc-getCC) |
39 |
} |
40 |
|
41 |
src_install() { |
42 |
dobin btyacc |
43 |
einstalldocs |
44 |
newman manpage btyacc.1 |
45 |
} |