summaryrefslogtreecommitdiff
blob: 38e8bb8d0591b1cf71ce6b6737b45fb1b1346947 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit multilib toolchain-funcs versionator

MY_PV="$(get_version_component_range 1-2)"
DESCRIPTION="Library of C++ utilities with evil buildsystem"
HOMEPAGE="http://codesynthesis.com/projects/libcutl/"
SRC_URI="http://codesynthesis.com/download/${PN}/${MY_PV}/${P}.tar.bz2"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

# dev-zero's overlay has an old, incompatible version of build-0.3.3
DEPEND=">=dev-util/build-0.3.5:0.3"
RDEPEND=""

src_prepare() {
	mkdir -p build/cxx/gnu || die
	echo "cxx_id := gnu" >> build/cxx/configuration-dynamic.make || die

	echo "cxx_gnu := $(tc-getCXX)" >> build/cxx/gnu/configuration-dynamic.make || die
	echo "cxx_gnu_optimization_options := ${CXXFLAGS}" >> build/cxx/gnu/configuration-dynamic.make || die

	mkdir -p build/ld || die
	echo "ld_lib_type := shared" >> build/ld/configuration-lib-dynamic.make || die

	# remove documentation installation target because it's just dirty
	sed -i -e '/LICENSE)$/,/README)$/d' makefile || die "failed to fix bad documentation installation target"
}

src_install() {
	# install_lib_dir requires a terminating slash because of a bug in libcutl's makefiles
	emake verbose=1 install_prefix="${D}/usr" install_lib_dir="${D}/usr/$(get_libdir)/" \
		install || die

	dodoc README NEWS TODO || die
}

src_test() {
	# dev-util/build doesn't use libtool, so we have to specify the -rpath
	# for tests with LD_LIBRARY_PATH to avoid polluting the installed
	# libcutl.so with extraneous -rpaths (I think...)
	LD_LIBRARY_PATH="${S}/cutl:${LD_LIBRARY_PATH}" emake test || die
}