summaryrefslogtreecommitdiff
blob: 93d952d97c1d6f0e0ecf2e974d09060ea03d4e8d (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

# NOTE: cross compiling is probably broken

EAPI=6

inherit eutils multilib

DESCRIPTION="Creates bindings for lua on c++"
HOMEPAGE="http://www.rasterbar.com/products/luabind.html"
SRC_URI="mirror://sourceforge/luabind/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND="dev-lang/lua"
DEPEND="${RDEPEND}
	dev-libs/boost
	dev-util/boost-build"

PATCHES=(
	"${FILESDIR}"/${P}-boost.patch
)

src_prepare() {
	default

	# backwardscomapt with old boost-build-1.49.0
	if [[ -e $(which bjam-1_49 2>/dev/null) ]] ; then
		my_bjam_bin=bjam-1_49
	else
		my_bjam_bin=bjam
	fi
}

src_compile() {
	# linkflags get appended, so they actually do nothing
	${my_bjam_bin} release \
		-d+2 \
		--prefix="${D}/usr/" \
		--libdir="${D}/usr/$(get_libdir)" \
		cflags="${CFLAGS}" \
		linkflags="${LDFLAGS}" \
		link=shared || die "compile failed"
}

src_install() {
	${my_bjam_bin} release \
		-d+2 \
		--prefix="${D}/usr/" \
		--libdir="${D}/usr/$(get_libdir)" \
		cflags="${CFLAGS}" \
		linkflags="${LDFLAGS}" \
		link=shared \
		install || die "install failed"
}

# generally, this really sucks, patches welcome