app-arch/brotli-1.0.3: arm64 stable (bug #645698)
[gentoo.git] / app-arch / brotli / brotli-1.0.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy )
7 DISTUTILS_OPTIONAL="1"
8
9 inherit cmake-utils distutils-r1
10
11 DESCRIPTION="Generic-purpose lossless compression algorithm"
12 HOMEPAGE="https://github.com/google/brotli"
13
14 SLOT="0/${PV}"
15
16 RDEPEND="python? ( ${PYTHON_DEPS} )"
17 DEPEND="${RDEPEND}"
18
19 IUSE="python test"
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21
22 LICENSE="MIT python? ( Apache-2.0 )"
23
24 DOCS=( README.md CONTRIBUTING.md )
25
26 if [[ ${PV} == "9999" ]] ; then
27         SRC_URI=""
28         EGIT_REPO_URI="https://github.com/google/${PN}.git"
29         inherit git-r3
30 else
31         PATCHES=( "${FILESDIR}"/${P}-no-rpath.patch )
32         KEYWORDS="alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
33         SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
34 fi
35
36 src_prepare() {
37         cmake-utils_src_prepare
38         use python && distutils-r1_src_prepare
39 }
40
41 src_configure() {
42         local mycmakeargs=(
43                 -DBUILD_SHARED_LIBS=ON
44                 -DBUILD_TESTING="$(usex test)"
45         )
46         cmake-utils_src_configure
47         use python && distutils-r1_src_configure
48 }
49
50 src_compile() {
51         cmake-utils_src_compile
52         use python && distutils-r1_src_compile
53 }
54
55 python_test(){
56         esetup.py test || die
57 }
58
59 src_test() {
60         cmake-utils_src_test
61         use python && distutils-r1_src_test
62 }
63
64 src_install() {
65         cmake-utils_src_install
66         use python && distutils-r1_src_install
67 }