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