git: fb87f0818011 - main - devel/bear: Update to 3.1.4; install links for wrapper interception

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Tue, 20 Aug 2024 18:25:01 UTC
The branch main has been updated by jrm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fb87f081801114619bfd5b569a891c2da6f05947

commit fb87f081801114619bfd5b569a891c2da6f05947
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2024-08-20 12:51:37 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2024-08-20 18:24:55 +0000

    devel/bear: Update to 3.1.4; install links for wrapper interception
    
    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.  To simplify using this method, install links for common build
    tools under lib/bear/wrapper.d/.
    
    PR:             280844
    Sponsored by:   The FreeBSD Foundation
---
 devel/bear/Makefile             |  23 +++++-
 devel/bear/distinfo             |   6 +-
 devel/bear/files/patch-protobuf |  24 ------
 devel/bear/files/pkg-message.in |  20 +++++
 devel/bear/pkg-plist            | 163 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 207 insertions(+), 29 deletions(-)

diff --git a/devel/bear/Makefile b/devel/bear/Makefile
index 0dabf69465ed..36faaf347409 100644
--- a/devel/bear/Makefile
+++ b/devel/bear/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	bear
-DISTVERSION=	3.1.3
-PORTREVISION=	10
+DISTVERSION=	3.1.4
 CATEGORIES=	devel
 
 MAINTAINER=	jrm@FreeBSD.org
@@ -8,6 +7,7 @@ COMMENT=	Tool that generates a compilation database for clang tooling
 WWW=		https://github.com/rizsotto/Bear
 
 LICENSE=	GPLv3+
+LICENSE_FILE=	${WRKSRC}/COPYING
 
 BUILD_DEPENDS=	nlohmann-json>0:devel/nlohmann-json
 LIB_DEPENDS=	libabsl_hash.so:devel/abseil \
@@ -25,8 +25,23 @@ CMAKE_ARGS=	-DCMAKE_INSTALL_DOCDIR=${DOCSDIR} \
 		-DENABLE_FUNC_TESTS=OFF \
 		-DENABLE_UNIT_TESTS=OFF
 
+SUB_FILES=	pkg-message
+
 OPTIONS_DEFINE=	DOCS
 
+CLANG_COMPILERS=	33 34 35 36 37 38 39 40 50 60 70 80 90 10 11 12 13 14 \
+			15 16 17 18 19 20
+GNU_COMPILERS=		34 42 43 44 45 46 47 48 49 5 6 7 8 9 10 11 12 13 14 15
+COMPILERS=		cc c++ CC clang clang++ ${CLANG_COMPILERS:S|^|clang|} \
+			${CLANG_COMPILERS:S|^|clang++|} \
+			${CLANG_COMPILERS:S|^|cpp|} gcc g++ \
+			${GNU_COMPILERS:S|^|gcc|} ${GNU_COMPILERS:S|^|g++|} \
+			${GNU_COMPILERS:S|^|cpp|} icc icpc llvm-gcc llvm-c++ \
+			llvm-g++
+WRAPPERS=		${COMPILERS} R ar as bison ctangle cweave f77 flex \
+			gfortran ld lex lint m2c makeinfo nm objcopy objdump pc \
+			ranlib readelf strip tangle tex tex2dvi weave yacc
+
 pre-install:
 	${MV} ${STAGEDIR}/${CONFIGURE_WRKSRC}/stage ${CONFIGURE_WRKSRC}/
 	${RM} -r ${STAGEDIR}/wrkdirs
@@ -35,5 +50,9 @@ post-install:
 .for l in bin/bear lib/bear/libexec.so lib/bear/wrapper
 	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/${l}
 .endfor
+.for w in ${WRAPPERS}
+	${RLN} ${STAGEDIR}${PREFIX}/lib/bear/wrapper \
+		${STAGEDIR}${PREFIX}/lib/bear/wrapper.d/${w}
+.endfor
 
 .include <bsd.port.mk>
diff --git a/devel/bear/distinfo b/devel/bear/distinfo
index 57d5fc1d7d10..d9d94c3ce7d6 100644
--- a/devel/bear/distinfo
+++ b/devel/bear/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1693499687
-SHA256 (rizsotto-Bear-3.1.3_GH0.tar.gz) = 8314438428069ffeca15e2644eaa51284f884b7a1b2ddfdafe12152581b13398
-SIZE (rizsotto-Bear-3.1.3_GH0.tar.gz) = 127766
+TIMESTAMP = 1723773120
+SHA256 (rizsotto-Bear-3.1.4_GH0.tar.gz) = a1105023795b3e1b9abc29c088cdec5464cc9f3b640b5078dc90a505498da5ff
+SIZE (rizsotto-Bear-3.1.4_GH0.tar.gz) = 127672
diff --git a/devel/bear/files/patch-protobuf b/devel/bear/files/patch-protobuf
deleted file mode 100644
index 4f7ea7ae961b..000000000000
--- a/devel/bear/files/patch-protobuf
+++ /dev/null
@@ -1,24 +0,0 @@
-Obtained from:	https://github.com/rizsotto/Bear/commit/3ba056a6cdebd1608279e89b021e7c28bcee3ea3
-
---- source/intercept/source/collect/db/EventsDatabaseWriter.cc.orig	2023-08-28 08:46:17 UTC
-+++ source/intercept/source/collect/db/EventsDatabaseWriter.cc
-@@ -21,6 +21,8 @@
- #include "libsys/Errors.h"
- 
- #include <google/protobuf/util/json_util.h>
-+#include <google/protobuf/stubs/common.h>
-+
- #include <fmt/format.h>
- 
- #include <sys/types.h>
-@@ -36,7 +38,9 @@ namespace {
-     JsonPrintOptions create_print_options() {
-         JsonPrintOptions print_options;
-         print_options.add_whitespace = false;
--        print_options.always_print_primitive_fields = true;
-+#if GOOGLE_PROTOBUF_VERSION < 5026000
-+            print_options.always_print_primitive_fields = true;
-+#endif
-         print_options.preserve_proto_field_names = true;
-         print_options.always_print_enums_as_ints = false;
-         return print_options;
diff --git a/devel/bear/files/pkg-message.in b/devel/bear/files/pkg-message.in
new file mode 100644
index 000000000000..50b7d1aa64ec
--- /dev/null
+++ b/devel/bear/files/pkg-message.in
@@ -0,0 +1,20 @@
+[
+{type: [install, upgrade], message: <<EOM
+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 %%PREFIX%%/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
+EOM
+}
+]
diff --git a/devel/bear/pkg-plist b/devel/bear/pkg-plist
index 2c90fde305a2..3950fee42d87 100644
--- a/devel/bear/pkg-plist
+++ b/devel/bear/pkg-plist
@@ -1,6 +1,169 @@
 bin/bear
 lib/bear/libexec.so
 lib/bear/wrapper
+lib/bear/wrapper.d/CC
+lib/bear/wrapper.d/R
+lib/bear/wrapper.d/ar
+lib/bear/wrapper.d/as
+lib/bear/wrapper.d/bison
+lib/bear/wrapper.d/c++
+lib/bear/wrapper.d/cc
+lib/bear/wrapper.d/clang
+lib/bear/wrapper.d/clang++
+lib/bear/wrapper.d/clang++10
+lib/bear/wrapper.d/clang++11
+lib/bear/wrapper.d/clang++12
+lib/bear/wrapper.d/clang++13
+lib/bear/wrapper.d/clang++14
+lib/bear/wrapper.d/clang++15
+lib/bear/wrapper.d/clang++16
+lib/bear/wrapper.d/clang++17
+lib/bear/wrapper.d/clang++18
+lib/bear/wrapper.d/clang++19
+lib/bear/wrapper.d/clang++20
+lib/bear/wrapper.d/clang++33
+lib/bear/wrapper.d/clang++34
+lib/bear/wrapper.d/clang++35
+lib/bear/wrapper.d/clang++36
+lib/bear/wrapper.d/clang++37
+lib/bear/wrapper.d/clang++38
+lib/bear/wrapper.d/clang++39
+lib/bear/wrapper.d/clang++40
+lib/bear/wrapper.d/clang++50
+lib/bear/wrapper.d/clang++60
+lib/bear/wrapper.d/clang++70
+lib/bear/wrapper.d/clang++80
+lib/bear/wrapper.d/clang++90
+lib/bear/wrapper.d/clang10
+lib/bear/wrapper.d/clang11
+lib/bear/wrapper.d/clang12
+lib/bear/wrapper.d/clang13
+lib/bear/wrapper.d/clang14
+lib/bear/wrapper.d/clang15
+lib/bear/wrapper.d/clang16
+lib/bear/wrapper.d/clang17
+lib/bear/wrapper.d/clang18
+lib/bear/wrapper.d/clang19
+lib/bear/wrapper.d/clang20
+lib/bear/wrapper.d/clang33
+lib/bear/wrapper.d/clang34
+lib/bear/wrapper.d/clang35
+lib/bear/wrapper.d/clang36
+lib/bear/wrapper.d/clang37
+lib/bear/wrapper.d/clang38
+lib/bear/wrapper.d/clang39
+lib/bear/wrapper.d/clang40
+lib/bear/wrapper.d/clang50
+lib/bear/wrapper.d/clang60
+lib/bear/wrapper.d/clang70
+lib/bear/wrapper.d/clang80
+lib/bear/wrapper.d/clang90
+lib/bear/wrapper.d/cpp10
+lib/bear/wrapper.d/cpp11
+lib/bear/wrapper.d/cpp12
+lib/bear/wrapper.d/cpp13
+lib/bear/wrapper.d/cpp14
+lib/bear/wrapper.d/cpp15
+lib/bear/wrapper.d/cpp16
+lib/bear/wrapper.d/cpp17
+lib/bear/wrapper.d/cpp18
+lib/bear/wrapper.d/cpp19
+lib/bear/wrapper.d/cpp20
+lib/bear/wrapper.d/cpp33
+lib/bear/wrapper.d/cpp34
+lib/bear/wrapper.d/cpp35
+lib/bear/wrapper.d/cpp36
+lib/bear/wrapper.d/cpp37
+lib/bear/wrapper.d/cpp38
+lib/bear/wrapper.d/cpp39
+lib/bear/wrapper.d/cpp40
+lib/bear/wrapper.d/cpp42
+lib/bear/wrapper.d/cpp43
+lib/bear/wrapper.d/cpp44
+lib/bear/wrapper.d/cpp45
+lib/bear/wrapper.d/cpp46
+lib/bear/wrapper.d/cpp47
+lib/bear/wrapper.d/cpp48
+lib/bear/wrapper.d/cpp49
+lib/bear/wrapper.d/cpp5
+lib/bear/wrapper.d/cpp50
+lib/bear/wrapper.d/cpp6
+lib/bear/wrapper.d/cpp60
+lib/bear/wrapper.d/cpp7
+lib/bear/wrapper.d/cpp70
+lib/bear/wrapper.d/cpp8
+lib/bear/wrapper.d/cpp80
+lib/bear/wrapper.d/cpp9
+lib/bear/wrapper.d/cpp90
+lib/bear/wrapper.d/ctangle
+lib/bear/wrapper.d/cweave
+lib/bear/wrapper.d/f77
+lib/bear/wrapper.d/flex
+lib/bear/wrapper.d/g++
+lib/bear/wrapper.d/g++10
+lib/bear/wrapper.d/g++11
+lib/bear/wrapper.d/g++12
+lib/bear/wrapper.d/g++13
+lib/bear/wrapper.d/g++14
+lib/bear/wrapper.d/g++15
+lib/bear/wrapper.d/g++34
+lib/bear/wrapper.d/g++42
+lib/bear/wrapper.d/g++43
+lib/bear/wrapper.d/g++44
+lib/bear/wrapper.d/g++45
+lib/bear/wrapper.d/g++46
+lib/bear/wrapper.d/g++47
+lib/bear/wrapper.d/g++48
+lib/bear/wrapper.d/g++49
+lib/bear/wrapper.d/g++5
+lib/bear/wrapper.d/g++6
+lib/bear/wrapper.d/g++7
+lib/bear/wrapper.d/g++8
+lib/bear/wrapper.d/g++9
+lib/bear/wrapper.d/gcc
+lib/bear/wrapper.d/gcc10
+lib/bear/wrapper.d/gcc11
+lib/bear/wrapper.d/gcc12
+lib/bear/wrapper.d/gcc13
+lib/bear/wrapper.d/gcc14
+lib/bear/wrapper.d/gcc15
+lib/bear/wrapper.d/gcc34
+lib/bear/wrapper.d/gcc42
+lib/bear/wrapper.d/gcc43
+lib/bear/wrapper.d/gcc44
+lib/bear/wrapper.d/gcc45
+lib/bear/wrapper.d/gcc46
+lib/bear/wrapper.d/gcc47
+lib/bear/wrapper.d/gcc48
+lib/bear/wrapper.d/gcc49
+lib/bear/wrapper.d/gcc5
+lib/bear/wrapper.d/gcc6
+lib/bear/wrapper.d/gcc7
+lib/bear/wrapper.d/gcc8
+lib/bear/wrapper.d/gcc9
+lib/bear/wrapper.d/gfortran
+lib/bear/wrapper.d/icc
+lib/bear/wrapper.d/icpc
+lib/bear/wrapper.d/ld
+lib/bear/wrapper.d/lex
+lib/bear/wrapper.d/lint
+lib/bear/wrapper.d/llvm-c++
+lib/bear/wrapper.d/llvm-g++
+lib/bear/wrapper.d/llvm-gcc
+lib/bear/wrapper.d/m2c
+lib/bear/wrapper.d/makeinfo
+lib/bear/wrapper.d/nm
+lib/bear/wrapper.d/objcopy
+lib/bear/wrapper.d/objdump
+lib/bear/wrapper.d/pc
+lib/bear/wrapper.d/ranlib
+lib/bear/wrapper.d/readelf
+lib/bear/wrapper.d/strip
+lib/bear/wrapper.d/tangle
+lib/bear/wrapper.d/tex
+lib/bear/wrapper.d/tex2dvi
+lib/bear/wrapper.d/weave
+lib/bear/wrapper.d/yacc
 share/man/man1/bear.1.gz
 share/man/man1/bear-citnames.1.gz
 share/man/man1/bear-intercept.1.gz