[gentoo-commits] repo/gentoo:master commit in: dev-util/bear/files/, dev-util/bear/

2024-07-09 Thread Sam James
commit: e204cb10f52f821ddaf924f90af17cacf735669b
Author: Paul Zander  gmail  com>
AuthorDate: Mon Jul  8 10:56:46 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Jul  9 12:51:26 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e204cb10

dev-util/bear: add 3.1.4-r1

- fixes cuda build
- Do not skip test based on FEATURES, per PMS Appendix B

Signed-off-by: Paul Zander  gmail.com>
Signed-off-by: Sam James  gentoo.org>

 dev-util/bear/bear-3.1.4-r1.ebuild | 112 +
 dev-util/bear/files/bear-3.1.4-tests.patch |  49 +
 2 files changed, 161 insertions(+)

diff --git a/dev-util/bear/bear-3.1.4-r1.ebuild 
b/dev-util/bear/bear-3.1.4-r1.ebuild
new file mode 100644
index ..d573a78f9b17
--- /dev/null
+++ b/dev-util/bear/bear-3.1.4-r1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 2020-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit cuda cmake multiprocessing 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="cuda test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+   >=dev-libs/libfmt-9.1.0:=
+   dev-libs/protobuf:=
+   >=dev-libs/spdlog-1.11.0:=
+   >=net-libs/grpc-1.49.2:=
+   cuda? ( dev-util/nvidia-cuda-toolkit )
+"
+
+DEPEND="
+   ${RDEPEND}
+   >=dev-cpp/nlohmann_json-3.11.2:=
+   test? (
+   >=dev-cpp/gtest-1.13
+   )
+"
+
+BDEPEND="
+   virtual/pkgconfig
+   test? (
+   dev-build/libtool
+   $(python_gen_any_dep '
+   dev-python/lit[${PYTHON_USEDEP}]
+   ')
+   )
+"
+
+PATCHES=(
+   "${FILESDIR}/${PN}-3.1.4-tests.patch"
+)
+
+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() {
+   # TODO: remove this when https://bugs.gentoo.org/928346 is fixed
+   export CMAKE_BUILD_PARALLEL_LEVEL=$(makeopts_jobs)
+
+   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 "tests will fail"
+   fi
+   if has usersandbox "${FEATURES}"; then
+   ewarn "FEATURES=usersandbox detected"
+   ewarn "tests will fail"
+   fi
+   if
+   has network-sandbox "${FEATURES}"; then
+   ewarn "FEATURES=network-sandbox detected"
+   ewarn "tests will fail"
+   fi
+   if
+   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"
+   fi
+
+   einfo "test may use optional tools if found: gfortran libtool nvcc 
valgrind"
+
+   # unit tests
+   BUILD_DIR="${BUILD_DIR}/subprojects/Build/BearSource" cmake_src_test
+
+   # functional tests
+   if use cuda; then
+   NVCC_CCBIN="$(cuda_gccdir)"
+   export NVCC_CCBIN
+   else
+   LIT_SKIP_TESTS+=( "cases/compilation/output/compile_cuda.sh" )
+   fi
+
+   mylitopts+=(-j "$(makeopts_jobs)" )
+   [[ -n "${LIT_SKIP_TESTS[*]}" ]] && mylitopts+=( --filter-out "($( 
IFS='|'; echo "${CMAKE_SKIP_TESTS[*]}"))" )
+
+   export LIT_OPTS="${mylitopts[*]}"
+
+   BUILD_DIR="${BUILD_DIR}/subprojects/Build/BearTest" cmake_src_test
+}

diff --git a/dev-util/bear/files/bear-3.1.4-tests.patch 
b/dev-util/bear/files/bear-3.1.4-tests.patch
new file mode 100644
index ..d6df55908cbc
--- /dev/null
+++ b/dev-util/bear/files/bear-3.1.4-tests.patch
@@ -0,0 +1,49 @@
+From: Paul Zander 
+Subject: [PATCH] Fix tests
+# https://github.com/rizsotto/Bear/issues/445
+diff --git a/test/lit.cfg b/test/lit.cfg
+index 2a3868a..cf0c9de 100644
+--- a/test/lit.cfg
 b/test/lit.cfg
+@@ -31,6 +31,7 @@ config.excludes = []
+ 
+ config.environment['LC_CTYPE'] = 'en_US.UTF-8'
+ config.environment['PATH'] = ":".join([os.path.join(this_dir, 'bin'), 
os.environ.get('PATH')])
++config.environment['PYTHONDONTWRITEBYTECODE'] = '1'
+ 
+ # add bear install directory in case if it's not in the path
+ if '_BEAR_BIN_DIR' in lit_config.params:
+@@ -161,6 +162,12 @@ 

[gentoo-commits] repo/gentoo:master commit in: dev-util/bear/files/, dev-util/bear/

2023-05-12 Thread Sam James
commit: 3fb39e3eb87994c558a17415713deb49dc3c0052
Author: jinqiang zhang  0x0  ee>
AuthorDate: Wed May 10 21:29:22 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat May 13 03:29:49 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fb39e3e

dev-util/bear: fix fails compile with libfmt-10.0.0

Closes: https://bugs.gentoo.org/906082
Signed-off-by: jinqiang zhang  0x0.ee>
Closes: https://github.com/gentoo/gentoo/pull/30982
Signed-off-by: Sam James  gentoo.org>

 dev-util/bear/bear-3.0.21.ebuild   |  1 +
 .../bear/files/bear-3.0.21-libfmt-10.0.0.patch | 26 ++
 2 files changed, 27 insertions(+)

diff --git a/dev-util/bear/bear-3.0.21.ebuild b/dev-util/bear/bear-3.0.21.ebuild
index 6a865c940fcb..814b202089e1 100644
--- a/dev-util/bear/bear-3.0.21.ebuild
+++ b/dev-util/bear/bear-3.0.21.ebuild
@@ -47,6 +47,7 @@ S="${WORKDIR}/${P^}"
 
 PATCHES=(
"${FILESDIR}"/${PN}-3.0.21-clang16-tests.patch
+   "${FILESDIR}"/${PN}-3.0.21-libfmt-10.0.0.patch
 )
 
 pkg_setup() {

diff --git a/dev-util/bear/files/bear-3.0.21-libfmt-10.0.0.patch 
b/dev-util/bear/files/bear-3.0.21-libfmt-10.0.0.patch
new file mode 100644
index ..7c8425e46ede
--- /dev/null
+++ b/dev-util/bear/files/bear-3.0.21-libfmt-10.0.0.patch
@@ -0,0 +1,26 @@
+BUG: https://bugs.gentoo.org/906082
+UPSTREAM: https://github.com/rizsotto/Bear/pull/526
+
+From 46a032fa0fc8131779ece13f26735ec84be891e8 Mon Sep 17 00:00:00 2001
+From: jinqiang zhang 
+Date: Thu, 11 May 2023 03:33:17 +0800
+Subject: [PATCH] dependency: fix fmt 10.0.0 incompatibilities (#526)
+
+Signed-off-by: jinqiang zhang 
+---
+ source/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
+index 6da1131f..fe6b710b 100644
+--- a/source/CMakeLists.txt
 b/source/CMakeLists.txt
+@@ -29,7 +29,7 @@ find_package(spdlog REQUIRED)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(gRPC REQUIRED IMPORTED_TARGET protobuf grpc++)
+ 
+-if (fmt_VERSION_MAJOR EQUAL 9)
++if (fmt_VERSION_MAJOR GREATER_EQUAL 9)
+ set(FMT_NEEDS_OSTREAM_FORMATTER 1)
+ set(HAVE_FMT_STD_H 1) # FIXME: this should be done with 
`check_include_file`
+ endif ()



[gentoo-commits] repo/gentoo:master commit in: dev-util/bear/files/, dev-util/bear/

2023-04-15 Thread Sam James
commit: 67dd4fbd591c399f461f63d61a6012d7bf7e6237
Author: Sam James  gentoo  org>
AuthorDate: Sun Apr 16 05:20:22 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Apr 16 05:26:01 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67dd4fbd

dev-util/bear: fix tests w/ clang 16

Signed-off-by: Sam James  gentoo.org>

 dev-util/bear/bear-3.0.21.ebuild   |  4 +++
 .../bear/files/bear-3.0.21-clang16-tests.patch | 32 ++
 2 files changed, 36 insertions(+)

diff --git a/dev-util/bear/bear-3.0.21.ebuild b/dev-util/bear/bear-3.0.21.ebuild
index 14481878c2f2..6b0aff0cffe9 100644
--- a/dev-util/bear/bear-3.0.21.ebuild
+++ b/dev-util/bear/bear-3.0.21.ebuild
@@ -45,6 +45,10 @@ RESTRICT="!test? ( test )"
 
 S="${WORKDIR}/${P^}"
 
+PATCHES=(
+   "${FILESDIR}"/${PN}-3.0.21-clang16-tests.patch
+)
+
 pkg_setup() {
use test && python-any-r1_pkg_setup
 }

diff --git a/dev-util/bear/files/bear-3.0.21-clang16-tests.patch 
b/dev-util/bear/files/bear-3.0.21-clang16-tests.patch
new file mode 100644
index ..19c63ba60849
--- /dev/null
+++ b/dev-util/bear/files/bear-3.0.21-clang16-tests.patch
@@ -0,0 +1,32 @@
+https://github.com/rizsotto/Bear/pull/521
+
+From 472cbed312444cdcef9102e924c79070ea1d3ab2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer 
+Date: Sat, 15 Apr 2023 19:37:41 +0200
+Subject: [PATCH] Avoid implicit function declarations in tests, for C99
+ compatibility
+
+Include  for printf and define _GNU_SOURCE for execvpe.
+
+Future compilers will not support implicit function declartions by
+default, causing these tests to fail to build.
+--- a/test/cases/intercept/preload/errno_reset.c
 b/test/cases/intercept/preload/errno_reset.c
+@@ -5,6 +5,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ 
+ int main()
+ {
+--- a/test/cases/intercept/preload/posix/execvpe/success.c
 b/test/cases/intercept/preload/posix/execvpe/success.c
+@@ -8,6 +8,7 @@
+ #include "config.h"
+ 
+ #if defined HAVE_UNISTD_H
++#define _GNU_SOURCE
+ #include 
+ #endif
+