1 |
commit: 097ae2bc2410e259bc95344bfb8bacfb0c20720d |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 1 21:18:33 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 1 21:22:39 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=097ae2bc |
7 |
|
8 |
dev-util/bear: new package, compile_commands.json generator |
9 |
|
10 |
used to feed clangd/lsp and other tools. |
11 |
|
12 |
Package-Manager: Portage-2.3.103, Repoman-2.3.23 |
13 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
14 |
|
15 |
dev-util/bear/Manifest | 1 + |
16 |
dev-util/bear/bear-2.4.3.ebuild | 61 +++++++++++++++++++++++++++++++++++++++++ |
17 |
dev-util/bear/metadata.xml | 19 +++++++++++++ |
18 |
3 files changed, 81 insertions(+) |
19 |
|
20 |
diff --git a/dev-util/bear/Manifest b/dev-util/bear/Manifest |
21 |
new file mode 100644 |
22 |
index 00000000000..bbfa7c76de5 |
23 |
--- /dev/null |
24 |
+++ b/dev-util/bear/Manifest |
25 |
@@ -0,0 +1 @@ |
26 |
+DIST bear-2.4.3.tar.gz 49933 BLAKE2B 2a91c30d81f9d0e58a25458579f6b0c867c07d2e532bd2ed29305645e152bd564156f708c4a07a683577412b3fdab1f106685ecf1ad88eaad2f33f0bc43a5baa SHA512 a4690cfc9938d8752ca5c8322ca4c5039746ade059e4459e7f3f91b2bf3d36ea691a5d855cab7a4e7ad8ff76478c48c4394593e069a1cf8396ead41017421753 |
27 |
|
28 |
diff --git a/dev-util/bear/bear-2.4.3.ebuild b/dev-util/bear/bear-2.4.3.ebuild |
29 |
new file mode 100644 |
30 |
index 00000000000..83600bfdb38 |
31 |
--- /dev/null |
32 |
+++ b/dev-util/bear/bear-2.4.3.ebuild |
33 |
@@ -0,0 +1,61 @@ |
34 |
+# Copyright 2020 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=7 |
38 |
+ |
39 |
+PYTHON_COMPAT=( python3_{7,8} ) |
40 |
+ |
41 |
+inherit cmake python-single-r1 |
42 |
+ |
43 |
+DESCRIPTION="Build EAR generates a compilation database for clang tooling" |
44 |
+HOMEPAGE="https://github.com/rizsotto/Bear" |
45 |
+SRC_URI="https://github.com/rizsotto/Bear/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
46 |
+ |
47 |
+LICENSE="GPL-3+" |
48 |
+SLOT="0" |
49 |
+KEYWORDS="~amd64 ~ppc64" |
50 |
+IUSE="test" |
51 |
+ |
52 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
53 |
+ |
54 |
+DEPEND="test? ( |
55 |
+ app-shells/bash |
56 |
+ $(python_gen_cond_dep ' |
57 |
+ dev-python/lit[${PYTHON_USEDEP}] |
58 |
+ ') |
59 |
+)" |
60 |
+ |
61 |
+RDEPEND="${PYTHON_DEPS}" |
62 |
+ |
63 |
+RESTRICT="!test? ( test )" |
64 |
+ |
65 |
+S="${WORKDIR}/${P^}" |
66 |
+ |
67 |
+src_compile() { |
68 |
+ cmake_src_compile |
69 |
+ # need to fix it now, before tests are run |
70 |
+ python_fix_shebang "${BUILD_DIR}"/bear/bear |
71 |
+ python_fix_shebang test/functional/tools/cdb_diff.py |
72 |
+} |
73 |
+ |
74 |
+src_test() { |
75 |
+ if has sandbox ${FEATURES}; then |
76 |
+ ewarn "\'FEATURES=sandbox\' detected" |
77 |
+ ewarn "Bear overrides LD_PRELOAD and conflicts with gentoo sandbox" |
78 |
+ ewarn "Skipping tests" |
79 |
+ elif |
80 |
+ has usersandbox ${FEATURES}; then |
81 |
+ ewarn "\'FEATURES=usersandbox\' detected" |
82 |
+ ewarn "Skipping tests" |
83 |
+ elif |
84 |
+ has_version -b 'sys-devel/gcc-config[-native-symlinks]'; then |
85 |
+ ewarn "\'sys-devel/gcc-config[-native-symlinks]\' detected, tests call /usr/bin/cc directly (hardcoded)" |
86 |
+ ewarn "and will fail without generic cc symlink" |
87 |
+ ewarn "Skipping tests" |
88 |
+ else |
89 |
+ einfo "removing unwanted/unsupported/xfail tests" |
90 |
+ rm -v test/functional/cases/{end-to-end/scons.ft,intercept/cuda/successful_build.fts,run_pep8.ft} || die |
91 |
+ einfo "test may use optional tools if found: qmake gfortran" |
92 |
+ cmake_build check |
93 |
+ fi |
94 |
+} |
95 |
|
96 |
diff --git a/dev-util/bear/metadata.xml b/dev-util/bear/metadata.xml |
97 |
new file mode 100644 |
98 |
index 00000000000..f8c8a305d1e |
99 |
--- /dev/null |
100 |
+++ b/dev-util/bear/metadata.xml |
101 |
@@ -0,0 +1,19 @@ |
102 |
+<?xml version="1.0" encoding="UTF-8"?> |
103 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
104 |
+<pkgmetadata> |
105 |
+ <maintainer type="person"> |
106 |
+ <email>gyakovlev@g.o</email> |
107 |
+ <name>Georgy Yakovlev</name> |
108 |
+ </maintainer> |
109 |
+ <longdescription lang="en"> |
110 |
+ Bear is a tool that generates a compilation database for clang tooling. |
111 |
+ The concept behind Bear is: to execute the original build command and intercept the exec calls issued by the build tool. |
112 |
+ To achieve that, Bear uses the LD_PRELOAD or DYLD_INSERT_LIBRARIES mechanisms provided by the dynamic linker. |
113 |
+ Bear has two components: the library and the binary. |
114 |
+ The library redefines the exec methods to be used by all child processes. |
115 |
+ The executable enables the use of the library for child processes and writes the output file. |
116 |
+ </longdescription> |
117 |
+ <upstream> |
118 |
+ <remote-id type="github">rizsotto/Bear</remote-id> |
119 |
+ </upstream> |
120 |
+</pkgmetadata> |