2019-01-31 18:06:28 +01:00
|
|
|
# Copyright 1999-2019 Gentoo Authors
|
2018-05-08 06:50:18 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2019-04-19 07:36:06 +02:00
|
|
|
EAPI=7
|
2019-04-21 11:58:55 +02:00
|
|
|
inherit cmake-utils
|
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
|
|
|
inherit git-r3
|
|
|
|
fi
|
2018-05-08 06:50:18 +02:00
|
|
|
|
|
|
|
DESCRIPTION="mastodon-cpp is a C++ wrapper for the Mastodon API."
|
2018-06-04 21:09:02 +02:00
|
|
|
HOMEPAGE="https://schlomp.space/tastytea/mastodon-cpp"
|
2019-04-21 11:58:55 +02:00
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
|
|
|
EGIT_REPO_URI="https://schlomp.space/tastytea/mastodon-cpp.git"
|
|
|
|
else
|
|
|
|
SRC_URI="https://schlomp.space/tastytea/mastodon-cpp/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
|
|
|
fi
|
|
|
|
|
2018-05-08 06:50:18 +02:00
|
|
|
LICENSE="GPL-3"
|
|
|
|
SLOT="0"
|
2019-04-21 11:58:55 +02:00
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
|
|
|
KEYWORDS=""
|
|
|
|
else
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
fi
|
2019-04-20 02:03:06 +02:00
|
|
|
IUSE="doc examples minimal test"
|
2019-04-21 11:58:55 +02:00
|
|
|
|
2019-04-19 07:36:06 +02:00
|
|
|
RDEPEND="
|
|
|
|
dev-cpp/curlpp
|
|
|
|
!minimal? ( dev-libs/jsoncpp )
|
|
|
|
"
|
|
|
|
DEPEND="
|
|
|
|
dev-util/cmake
|
|
|
|
doc? ( app-doc/doxygen )
|
2019-04-20 02:03:06 +02:00
|
|
|
test? ( dev-cpp/catch )
|
2019-04-19 07:36:06 +02:00
|
|
|
${RDEPEND}
|
|
|
|
"
|
2018-05-08 06:50:18 +02:00
|
|
|
|
|
|
|
src_configure() {
|
2018-06-21 20:35:06 +02:00
|
|
|
local mycmakeargs=(
|
|
|
|
-DWITH_DOC=NO
|
|
|
|
-DWITH_EXAMPLES=NO
|
2019-04-21 04:52:33 +02:00
|
|
|
-DWITH_EASY="$(usex minimal NO YES)"
|
|
|
|
-DWITH_TESTS="$(usex test)"
|
2018-06-21 20:35:06 +02:00
|
|
|
)
|
2019-04-21 11:58:55 +02:00
|
|
|
if use test; then
|
|
|
|
# Don't run tests that need a network connection.
|
|
|
|
mycmakeargs+=(-DEXTRA_TEST_ARGS="~[api]")
|
|
|
|
fi
|
2019-04-19 07:36:06 +02:00
|
|
|
|
2018-06-21 20:35:06 +02:00
|
|
|
cmake-utils_src_configure
|
2018-05-08 06:50:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# We can not let cmake handle the documentation, because it would end up in
|
|
|
|
# doc/mastodon-cpp-${PROJECT_VERSION} instead of -9999
|
|
|
|
src_compile() {
|
2019-01-31 18:06:28 +01:00
|
|
|
cmake-utils_src_compile
|
2018-06-21 20:35:06 +02:00
|
|
|
|
|
|
|
if use doc; then
|
|
|
|
./build_doc.sh
|
|
|
|
fi
|
2018-05-08 06:50:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2018-06-21 20:35:06 +02:00
|
|
|
if use doc; then
|
|
|
|
HTML_DOCS="doc/html/*"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if use examples; then
|
|
|
|
docinto examples
|
|
|
|
for file in examples/*.cpp; do
|
|
|
|
dodoc ${file}
|
|
|
|
done
|
|
|
|
fi
|
2019-04-19 07:36:06 +02:00
|
|
|
|
|
|
|
cmake-utils_src_install
|
|
|
|
}
|
|
|
|
|
|
|
|
src_postinst() {
|
|
|
|
ewarn "This version of mastodon-cpp is considerably different from versions below 0.100.0."
|
|
|
|
ewarn "Upgrading will require extensive code changes."
|
2018-05-08 06:50:18 +02:00
|
|
|
}
|