git: 531a782b69f0 - main - devel/compdbgen: New port to generate compile_commands.json

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Fri, 12 Sep 2025 18:36:41 UTC
The branch main has been updated by jrm:

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

commit 531a782b69f0a2825ea73e5388e34392eedebd7d
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2025-09-12 18:14:40 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2025-09-12 18:33:36 +0000

    devel/compdbgen: New port to generate compile_commands.json
    
    compdbgen is a general-purpose tool for generating compile_commands.json
    files, used with clangd's lsp-server.  The tool uses ptrace to intercept
    system calls for the current task and all its child tasks, capture the
    arguments and environment variables of the execve system call, and
    generate compile_commands.json files.
    
    Sponsored by:   The FreeBSD Foundation
---
 devel/Makefile            |  1 +
 devel/compdbgen/Makefile  | 25 +++++++++++++++++++++++++
 devel/compdbgen/distinfo  |  5 +++++
 devel/compdbgen/pkg-descr |  5 +++++
 4 files changed, 36 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 521ae61264b3..65a261612f08 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -485,6 +485,7 @@
     SUBDIR += commit-patch
     SUBDIR += commitizen
     SUBDIR += commoncpp
+    SUBDIR += compdbgen
     SUBDIR += compiler-rt
     SUBDIR += compiz-bcop
     SUBDIR += concurrencpp
diff --git a/devel/compdbgen/Makefile b/devel/compdbgen/Makefile
new file mode 100644
index 000000000000..9d4717eedd7e
--- /dev/null
+++ b/devel/compdbgen/Makefile
@@ -0,0 +1,25 @@
+PORTNAME=	compdbgen
+DISTVERSION=	g20250911
+CATEGORIES=	devel
+
+MAINTAINER=	jrm@FreeBSD.org
+COMMENT=	General-purpose tool for generating compile_commands.json files
+WWW=		https://github.com/Virus-V/compdbgen
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	Virus-V
+GH_TAGNAME=	726a5c1d9b94650ced9dc13044e9459bc8780364
+GH_TUPLE=	DaveGamble:cJSON:c859b25da02955fef659d658b8f324b5cde87be3:cJSONS/cjson
+
+PLIST_FILES=	bin/${PORTNAME}
+
+do-build:
+		@cd ${WRKSRC}/ && ${SH} ./build.sh
+
+do-install:
+		${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/devel/compdbgen/distinfo b/devel/compdbgen/distinfo
new file mode 100644
index 000000000000..144a02dca51c
--- /dev/null
+++ b/devel/compdbgen/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1757696416
+SHA256 (Virus-V-compdbgen-g20250911-726a5c1d9b94650ced9dc13044e9459bc8780364_GH0.tar.gz) = 2075a2df4237ab78926c75936f4ccdd991ff196e27567219cc46ae3f9f02a251
+SIZE (Virus-V-compdbgen-g20250911-726a5c1d9b94650ced9dc13044e9459bc8780364_GH0.tar.gz) = 58854
+SHA256 (DaveGamble-cJSON-c859b25da02955fef659d658b8f324b5cde87be3_GH0.tar.gz) = 880a86445ad5cf38f877bac31198268d8fac5d2ce996ebf55d3066a4109ddd8d
+SIZE (DaveGamble-cJSON-c859b25da02955fef659d658b8f324b5cde87be3_GH0.tar.gz) = 356505
diff --git a/devel/compdbgen/pkg-descr b/devel/compdbgen/pkg-descr
new file mode 100644
index 000000000000..d6dcd5bf0850
--- /dev/null
+++ b/devel/compdbgen/pkg-descr
@@ -0,0 +1,5 @@
+compdbgen is a general-purpose tool for generating compile_commands.json
+files, used with clangd's lsp-server.  The tool uses ptrace to intercept
+system calls for the current task and all its child tasks, capture the
+arguments and environment variables of the execve system call, and
+generate compile_commands.json files.