summaryrefslogtreecommitdiff
blob: bf812e97c808b071392c160402d7dffe4bd4201c (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6
inherit toolchain-funcs multilib-minimal

DESCRIPTION="stateless, zlib-compatible, and very fast compression library"
HOMEPAGE="http://1wt.eu/projects/libslz"
SRC_URI="http://git.1wt.eu/web?p=${PN}.git;a=snapshot;h=v${PV};sf=tbz2 -> ${P}.tar.bz2"

LICENSE="MIT"
SLOT="0/1"
KEYWORDS="amd64 arm ppc x86"
IUSE="static-libs tools"

DEPEND=""
RDEPEND="${DEPEND}"

S="${WORKDIR}/${PN}"

src_prepare() {
	default

	multilib_copy_sources
}

multilib_src_compile() {
	local -a opts=(
		CC="$(tc-getCC)" \
		OPT_CFLAGS="${CFLAGS}" \
		USR_LFLAGS="${LDFLAGS}" \
		shared \
		$(usex static-libs static '')
	)

	if multilib_is_native_abi ; then
		opts+=(
			$(usex tools tools '')
		)
	fi

	emake "${opts[@]}"
}

multilib_src_install() {
	local -a opts=(
		STRIP=":" \
		DESTDIR="${ED}" \
		PREFIX="${EPREFIX}/usr" \
		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
		install-headers
		install-shared \
		$(usex static-libs install-static '')
	)

	if multilib_is_native_abi ; then
		einstalldocs

		opts+=(
			$(usex tools install-tools '')
		)
	fi

	emake "${opts[@]}"
}