dev-libs/liborcus: Fix bashisms in configure.ac, --disable-static
[gentoo.git] / dev-libs / msgpack / msgpack-3.1.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit cmake-multilib
6
7 if [[ ${PV} == 9999 ]]; then
8         inherit git-r3
9         EGIT_REPO_URI="https://github.com/${PN}/${PN}-c.git"
10 else
11         SRC_URI="https://github.com/${PN}/${PN}-c/releases/download/cpp-${PV}/${P}.tar.gz"
12         KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
13 fi
14
15 DESCRIPTION="MessagePack is a binary-based efficient data interchange format"
16 HOMEPAGE="https://msgpack.org/ https://github.com/msgpack/msgpack-c/"
17
18 LICENSE="Boost-1.0"
19 SLOT="0/2"
20 IUSE="boost +cxx doc examples static-libs test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="boost? ( dev-libs/boost[context,${MULTILIB_USEDEP}] )"
24 DEPEND="${RDEPEND}
25         test? (
26                 >=dev-cpp/gtest-1.6.0-r2[${MULTILIB_USEDEP}]
27                 sys-libs/zlib[${MULTILIB_USEDEP}]
28         )
29         doc? ( app-doc/doxygen[dot] )
30 "
31
32 src_configure() {
33         local mycmakeargs=(
34                 -DMSGPACK_BOOST="$(usex boost)"
35                 -DMSGPACK_ENABLE_CXX="$(usex cxx)"
36                 -DMSGPACK_ENABLE_STATIC="$(usex static-libs)"
37                 -DMSGPACK_BUILD_TESTS="$(usex test)"
38                 # don't build the examples
39                 -DMSGPACK_BUILD_EXAMPLES=OFF
40                 # enable C++11 by default
41                 -DMSGPACK_CXX11=ON
42         )
43         cmake-multilib_src_configure
44 }
45
46 multilib_src_compile() {
47         cmake-utils_src_compile
48
49         if multilib_is_native_abi && use doc; then
50                 cmake-utils_src_make doxygen
51         fi
52 }
53
54 multilib_src_install() {
55         if multilib_is_native_abi; then
56                 if use doc; then
57                         local HTML_DOCS=( "${BUILD_DIR}"/docs/. )
58
59                         mkdir docs || die
60                         mv doc_c/html docs/c || die
61
62                         use cxx && mv doc_cpp/html docs/cpp || die
63                 fi
64
65                 if use examples; then
66                         docinto examples
67
68                         dodoc -r "${WORKDIR}/${P}/example/."
69
70                         docompress -x /usr/share/doc/${PF}/examples
71                 fi
72         fi
73
74         cmake-utils_src_install
75 }