summaryrefslogtreecommitdiff
blob: 98b199d469486657c850750d3ed05837e232b1eb (plain)
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
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI="5"
# Hammer upstreams only supports python2.7
PYTHON_COMPAT=( python2_7 )
DISTUTILS_OPTIONAL="true"
DISTUTILS_SINGLE_IMPL="true"

inherit eutils toolchain-funcs scons-utils git-2 distutils-r1

DESCRIPTION="Hammer is a parsing library, which is bit-oriented and features several parsing backends"
HOMEPAGE="https://github.com/UpstandingHackers/hammer"
SRC_URI=""
EGIT_REPO_URI="git://github.com/UpstandingHackers/hammer.git"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE="debug perl php python test"

DEPEND="dev-util/scons
>=dev-libs/glib-2.29
python? ( ${PYTHON_DEPS}
dev-lang/swig )
perl? ( >=dev-lang/swig-2.0.8 )
php? ( dev-lang/swig )"
RDEPEND=""
src_prepare() {
	tc-export AR CC CXX RANLIB
}

src_configure() {
	myesconsargs="bindings=cpp"

	if use python; then
		myesconsargs+=",python"
	fi

	if use perl; then
		myesconsargs+=",perl"
	fi

	if use debug; then
		# Has to be before bindings parameter
		# or else it whines about bogus bindings
		myesconsarg+="--variant=debug ${myesconsarg}"
	fi
}

src_compile() {
	escons prefix="/usr"

	# Have to replace /usr/local in the Makefile for
	# the perl binding because it doesn't inherit/honor the
	# prefix set at scons commandline
	if use perl; then
		sed -i s:/usr/local:/usr: "${S}/build/opt/src/bindings/perl/Makefile"
	fi
}

src_test() {
	escons test
}

src_install() {
	escons prefix="${D}/usr" install
	dodoc -r README.md NOTES HACKING TODO examples/

}