summaryrefslogtreecommitdiff
blob: 93aeee4fe225259982287b1cbd48800cef08fd46 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cmake

DESCRIPTION="A C++ toolkit"
HOMEPAGE="https://github.com/puppetlabs/leatherman"
SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
IUSE="debug static-libs test"
#RESTRICT="!test? ( test )"
RESTRICT="test"  # restricted til we don't need the shared_nowide patch
KEYWORDS="amd64 ~arm ~hppa ppc ppc64 sparc x86"
SLOT="0/${PV}"

RDEPEND="net-misc/curl"
DEPEND=">=dev-libs/boost-1.73:=[nls]
	net-misc/curl
	>=sys-devel/gcc-4.8:*"

PATCHES=( "${FILESDIR}"/portage-sandbox-test-fix.patch )
PATCHES+=( "${FILESDIR}"/1.12.2-shared_nowide.patch )

src_prepare() {
	sed -i 's/\-Werror\ //g' "cmake/cflags.cmake" || die
	# vendored boost lib conflicts with boost 1.73 and above
	cmake_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DCMAKE_VERBOSE_MAKEFILE=ON
		-DCMAKE_BUILD_TYPE=None
	)
	if ! use static-libs; then
		mycmakeargs+=(
			-DLEATHERMAN_SHARED=ON
		)
	else
		mycmakeargs+=(
			-DLEATHERMAN_SHARED=OFF
		)
	fi
	if use debug; then
		mycmakeargs+=(
		  -DCMAKE_BUILD_TYPE=Debug
		)
	fi
	cmake_src_configure
}

src_test() {
	"${WORKDIR}/${P}"_build/bin/leatherman_test
}

src_install() {
	cmake_src_install
}