git: 7f73d07ff13f - main - devel/capslock: New port: Capability analysis CLI for Go packages

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 17 Sep 2023 08:46:52 UTC
The branch main has been updated by yuri:

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

commit 7f73d07ff13f271d0e80bdc9fbf09de92414d721
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-09-17 08:46:19 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-09-17 08:46:19 +0000

    devel/capslock: New port: Capability analysis CLI for Go packages
---
 devel/Makefile           |  1 +
 devel/capslock/Makefile  | 27 +++++++++++++++++++++++++++
 devel/capslock/distinfo  |  5 +++++
 devel/capslock/pkg-descr |  4 ++++
 4 files changed, 37 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 3e229e197e45..12866a42429e 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -332,6 +332,7 @@
     SUBDIR += caliper
     SUBDIR += capnproto
     SUBDIR += capnproto080
+    SUBDIR += capslock
     SUBDIR += capstone
     SUBDIR += capstone3
     SUBDIR += capstone4
diff --git a/devel/capslock/Makefile b/devel/capslock/Makefile
new file mode 100644
index 000000000000..fdbde22b24ed
--- /dev/null
+++ b/devel/capslock/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	capslock
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.1.1
+CATEGORIES=	devel net
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Capability analysis CLI for Go packages
+WWW=		https://github.com/google/capslock
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		go:modules
+
+GO_MODULE=	github.com/google/capslock
+GO_TARGET=	./cmd/capslock
+
+PLIST_FILES=	bin/capslock
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|"go"|"go${GO_SUFFIX}"|g' \
+		${WRKSRC}/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go \
+		${WRKSRC}/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go \
+		${WRKSRC}/vendor/golang.org/x/tools/internal/gocommand/invoke.go \
+		${WRKSRC}/vendor/golang.org/x/tools/internal/goroot/importcfg.go
+
+.include <bsd.port.mk>
diff --git a/devel/capslock/distinfo b/devel/capslock/distinfo
new file mode 100644
index 000000000000..3332e7ecb0e9
--- /dev/null
+++ b/devel/capslock/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1694939669
+SHA256 (go/devel_capslock/capslock-v0.1.1/v0.1.1.mod) = fdc6dd88889e2f4d33c522a8eae43bf07814243503ebe36247da4b414c2cd886
+SIZE (go/devel_capslock/capslock-v0.1.1/v0.1.1.mod) = 242
+SHA256 (go/devel_capslock/capslock-v0.1.1/v0.1.1.zip) = e919d6cd12ca9847dfc90226d8d6a2cc704c98c4179eccd55c81b1926b0c0f9f
+SIZE (go/devel_capslock/capslock-v0.1.1/v0.1.1.zip) = 127088
diff --git a/devel/capslock/pkg-descr b/devel/capslock/pkg-descr
new file mode 100644
index 000000000000..cf288450e23d
--- /dev/null
+++ b/devel/capslock/pkg-descr
@@ -0,0 +1,4 @@
+Capslock is a capability analysis CLI for Go packages that informs users of
+which privileged operations a given package can access. This works by
+classifying the capabilities of Go packages by following transitive calls to
+privileged standard library operations.