| Port details on branch 2025Q2 |
- bear Tool that generates a compilation database for clang tooling
- 3.1.5_10 devel
=0 3.1.5_10Version of this port present on the latest quarterly branch. - Maintainer: jrm@FreeBSD.org
 - Port Added: 2025-06-20 07:19:35
- Last Update: 2025-06-20 05:38:33
- Commit Hash: 58c796d
- License: GPLv3+
- WWW:
- https://github.com/rizsotto/Bear
- Description:
- Bear is a tool that generates a compilation database for clang
tooling. The JSON compilation database is used in the clang project
to provide information on how a single compilation unit is processed.
With this, it is easy to re-run the compilation with alternate
programs. One way to get a compilation database is to use cmake as
the build tool. Passing -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to cmake
generates the compile_commands.json file into the current directory.
For non-cmake projects, Bear generates the JSON file during the
build process.
The concept behind Bear is: to execute the original build command
and intercept the exec calls issued by the build tool. To achieve
that, Bear uses the LD_PRELOAD or DYLD_INSERT_LIBRARIES mechanisms
provided by the dynamic linker.
¦ ¦ ¦ ¦ 
- Manual pages:
-
- pkg-plist: as obtained via:
make generate-plist - USE_RC_SUBR (Service Scripts)
- no SUBR information found for this port
- Dependency lines:
-
- To install the port:
- cd /usr/ports/devel/bear/ && make install clean
- To add the package, run one of these commands:
- pkg install devel/bear
- pkg install bear
NOTE: If this package has multiple flavors (see below), then use one of them instead of the name specified above.- PKGNAME: bear
- Flavors: there is no flavor information for this port.
- distinfo:
- TIMESTAMP = 1728324084
SHA256 (rizsotto-Bear-3.1.5_GH0.tar.gz) = 4ac7b041222dcfc7231c6570d5bd76c39eaeda7a075ee2385b84256e7d659733
SIZE (rizsotto-Bear-3.1.5_GH0.tar.gz) = 152228
Packages (timestamps in pop-ups are UTC):
- Dependencies
- NOTE: FreshPorts displays only information on required and default dependencies. Optional dependencies are not covered.
- Build dependencies:
-
- nlohmann-json>0 : devel/nlohmann-json
- cmake : devel/cmake-core
- ninja : devel/ninja
- pkgconf>=1.3.0_1 : devel/pkgconf
- Library dependencies:
-
- libabsl_hash.so : devel/abseil
- libfmt.so : devel/libfmt
- libgrpc.so : devel/grpc
- libprotobuf.so : devel/protobuf
- libspdlog.so : devel/spdlog
- There are no ports dependent upon this port
Configuration Options:
- ===> The following configuration options are available for bear-3.1.5_10:
DOCS=on: Build and/or install documentation
===> Use 'make config' to modify these settings
- Options name:
- devel_bear
- USES:
- cmake compiler:c++17-lang pkgconfig
- pkg-message:
- For install or upgrade:
- After src commit 8ccd0b876e, bear can no longer intercept compile commands using
the dynamic linker preload method. See
https://github.com/rizsotto/Bear/issues/557 for details.
An alternative method for bear to intercept compile commands is via wrappers.
This method requires links under /usr/local/lib/bear/wrapper.d/ to any command
called to build your program. The bear package now installs links to common
tools such as compilers and linkers. If a link is missing, create it manually,
submit a bug report, or supply links in a custom directory passed as an argument
to bear's --wrapper-dir flag.
The --force-wrapper option must be supplied when using the wrapper method.
Example:
% bear --force-wrapper -- make
- Master Sites:
|