dev-libs/utfcpp: keyworded 3.1 for sparc, bug #693040
[gentoo.git] / dev-libs / utfcpp / utfcpp-3.1.ebuild
1 # Copyright 2015-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit cmake-utils
7
8 if [[ "${PV}" == "9999" ]]; then
9         inherit git-r3
10
11         EGIT_REPO_URI="https://github.com/nemtrif/utfcpp"
12         EGIT_SUBMODULES=()
13 fi
14
15 DESCRIPTION="UTF-8 C++ library"
16 HOMEPAGE="https://github.com/nemtrif/utfcpp"
17 if [[ "${PV}" == "9999" ]]; then
18         SRC_URI=""
19 else
20         SRC_URI="https://github.com/nemtrif/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
21 fi
22
23 LICENSE="Boost-1.0"
24 SLOT="0"
25 KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~sparc ~x86"
26 IUSE="test"
27 RESTRICT="!test? ( test )"
28
29 BDEPEND=""
30 DEPEND="test? ( dev-cpp/gtest )"
31 RDEPEND=""
32
33 src_prepare() {
34         sed -e "/add_subdirectory(extern\/gtest)/d" -i CMakeLists.txt || die
35         sed -e "s/gtest_main/gtest &/" -i tests/CMakeLists.txt || die
36
37         cmake-utils_src_prepare
38 }
39
40 src_configure() {
41         local mycmakeargs=(
42                 -DUTF8_SAMPLES=OFF
43                 -DUTF8_TESTS=$(usex test ON OFF)
44         )
45
46         cmake-utils_src_configure
47 }