forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
antlr-cpp-2.7.7-r2.ebuild
82 lines (63 loc) · 1.83 KB
/
antlr-cpp-2.7.7-r2.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools multilib-minimal
MY_P="${PN%-cpp}-${PV}"
DESCRIPTION="The ANTLR 2 C++ Runtime"
HOMEPAGE="https://www.antlr2.org/"
SRC_URI="https://www.antlr2.org/download/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"
LICENSE="public-domain"
SLOT="2"
KEYWORDS="amd64 ~arm ppc x86"
IUSE="doc examples"
RESTRICT="test" # No tests but test target blows up!
BDEPEND="doc? ( app-text/doxygen[dot] )"
PATCHES=(
"${FILESDIR}"/${PV}-gcc.patch
# Upstream only installs a static library. The original antlr ebuild
# built a shared library manually, which isn't so great either. This
# ebuild applies libtool instead and therefore an autoreconf is
# required. A couple of errors concerning tr have been seen but the
# final result still looks good. This also sidesteps bug #554344 plus
# the need to call einstall.
"${FILESDIR}"/${PV}-autotools.patch
)
src_prepare() {
default
mv -v {aclocal,acinclude}.m4 || die
# Delete build files from examples
find examples -name Makefile.in -delete || die
eautoreconf
}
multilib_src_configure() {
CONFIG_SHELL="${BASH}" ECONF_SOURCE="${S}" econf \
--disable-csharp \
--disable-examples \
--disable-java \
--disable-python \
--enable-cxx \
--enable-verbose
}
multilib_src_compile() {
default
if multilib_native_use doc; then
cd "${S}"/lib/cpp || die
doxygen -u doxygen.cfg || die
doxygen doxygen.cfg || die
HTML_DOCS=( "${S}"/lib/cpp/gen_doc/html/. )
fi
}
multilib_src_install() {
# We only care about the C++ stuff
emake -C lib/cpp DESTDIR="${D}" install
}
multilib_src_install_all() {
einstalldocs
dodoc lib/cpp/AUTHORS lib/cpp/ChangeLog lib/cpp/README lib/cpp/TODO
if use examples; then
docinto examples
dodoc -r examples/cpp/.
fi
find "${ED}" -name '*.la' -delete || die
}