app-arch/brotli-1.0.7-r0: alpha stable
[gentoo.git] / app-arch / brotli / brotli-1.0.4.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_{5,6} pypy )
7 DISTUTILS_OPTIONAL="1"
8
9 inherit cmake-utils distutils-r1 eapi7-ver
10
11 DESCRIPTION="Generic-purpose lossless compression algorithm"
12 HOMEPAGE="https://github.com/google/brotli"
13
14 SLOT="0/$(ver_cut 1)"
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         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
32         SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
33 fi
34
35 src_prepare() {
36         cmake-utils_src_prepare
37         use python && distutils-r1_src_prepare
38 }
39
40 src_configure() {
41         local mycmakeargs=(
42                 -DBUILD_SHARED_LIBS=ON
43                 -DBUILD_TESTING="$(usex test)"
44         )
45         cmake-utils_src_configure
46         use python && distutils-r1_src_configure
47 }
48
49 src_compile() {
50         cmake-utils_src_compile
51         use python && distutils-r1_src_compile
52 }
53
54 python_test(){
55         esetup.py test || die
56 }
57
58 src_test() {
59         cmake-utils_src_test
60         use python && distutils-r1_src_test
61 }
62
63 src_install() {
64         cmake-utils_src_install
65         use python && distutils-r1_src_install
66 }