diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-09-15 10:49:51 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-09-15 10:49:51 +0100 |
commit | ea3e1bbf643d1d8892f4df05e4f05c1b2a2125d8 (patch) | |
tree | 60dac1902fc2665fd22fc2e4e4a60186cc7e361b /dev-util/bear/bear-3.1.3.ebuild | |
parent | efca79f216bfeffd55e7731fbf24126d093e1084 (diff) |
gentoo auto-resync : 15:09:2023 - 10:49:51
Diffstat (limited to 'dev-util/bear/bear-3.1.3.ebuild')
-rw-r--r-- | dev-util/bear/bear-3.1.3.ebuild | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/dev-util/bear/bear-3.1.3.ebuild b/dev-util/bear/bear-3.1.3.ebuild new file mode 100644 index 000000000000..d07cd15e5151 --- /dev/null +++ b/dev-util/bear/bear-3.1.3.ebuild @@ -0,0 +1,90 @@ +# Copyright 2020-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +inherit cmake python-any-r1 + +DESCRIPTION="Build EAR generates a compilation database for clang tooling" +HOMEPAGE="https://github.com/rizsotto/Bear" +SRC_URI="https://github.com/rizsotto/Bear/archive/${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${P^}" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-cpp/nlohmann_json-3.11.2:= + >=dev-db/sqlite-3.14:= + >=dev-libs/libfmt-9.1.0:= + dev-libs/protobuf:= + >=dev-libs/spdlog-1.11.0:= + >=net-libs/grpc-1.49.2:= +" + +DEPEND=" + ${RDEPEND} + test? ( + >=dev-cpp/gtest-1.13 + ) +" + +BDEPEND=" + virtual/pkgconfig + test? ( + sys-devel/libtool + $(python_gen_any_dep ' + dev-python/lit[${PYTHON_USEDEP}] + ') + ) +" + +pkg_setup() { + use test && python-any-r1_pkg_setup +} + +src_prepare() { + cmake_src_prepare + # Turn off testing before installation + sed -i 's/TEST_BEFORE_INSTALL/TEST_EXCLUDE_FROM_MAIN/g' CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DENABLE_UNIT_TESTS="$(usex test)" + -DENABLE_FUNC_TESTS="$(usex test)" + ) + cmake_src_configure +} + +src_test() { + if has sandbox ${FEATURES}; then + ewarn "\'FEATURES=sandbox\' detected" + ewarn "Bear overrides LD_PRELOAD and conflicts with gentoo sandbox" + ewarn "Skipping tests" + elif + has usersandbox ${FEATURES}; then + ewarn "\'FEATURES=usersandbox\' detected" + ewarn "Skipping tests" + elif + has network-sandbox ${FEATURES}; then + ewarn "\'FEATURES=network-sandbox\' detected" + ewarn "Skipping tests" + elif + has_version -b 'sys-devel/gcc-config[-native-symlinks]'; then + ewarn "\'sys-devel/gcc-config[-native-symlinks]\' detected, tests call /usr/bin/cc directly (hardcoded)" + ewarn "and will fail without generic cc symlink" + ewarn "Skipping tests" + else + einfo "test may use optional tools if found: qmake gfortran valgrind" + # unit tests + cmake_run_in "${BUILD_DIR}/subprojects/Build/BearSource" ctest --verbose + # functional tests + cmake_run_in "${BUILD_DIR}/subprojects/Build/BearTest" ctest --verbose + fi +} |