git: 60817c50b4c8 - main - Mk/Uses: Add certs.mk to handle dependency on security/ca_root_nss
- Reply: Gleb Popov : "Re: git: 60817c50b4c8 - main - Mk/Uses: Add certs.mk to handle dependency on security/ca_root_nss"
- Reply: Dag-Erling_Smørgrav : "Re: git: 60817c50b4c8 - main - Mk/Uses: Add certs.mk to handle dependency on security/ca_root_nss"
- Reply: Mathieu Arnold : "Re: git: 60817c50b4c8 - main - Mk/Uses: Add certs.mk to handle dependency on security/ca_root_nss"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 Mar 2026 16:13:28 UTC
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=60817c50b4c82bfcdf25e66bd4833629a6137614
commit 60817c50b4c82bfcdf25e66bd4833629a6137614
Author: Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-03-09 15:16:48 +0000
Commit: Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-03-09 16:13:25 +0000
Mk/Uses: Add certs.mk to handle dependency on security/ca_root_nss
... as USES=certs:{phase} instead of reciting the whole dependency.
Around one hundred ports depend on security/ca_root_nss.
---
Mk/Uses/certs.mk | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/Mk/Uses/certs.mk b/Mk/Uses/certs.mk
new file mode 100644
index 000000000000..4541d253578f
--- /dev/null
+++ b/Mk/Uses/certs.mk
@@ -0,0 +1,54 @@
+# Handle dependency on the ca_root_nss certificate bundle
+#
+# Feature: certs
+# Usage: USES=certs:args
+# Valid ARGS: fetch, build, run
+#
+# At least one argument is required.
+#
+# fetch ca_root_nss is added as FETCH_DEPENDS
+# build ca_root_nss is added as BUILD_DEPENDS
+# run ca_root_nss is added as RUN_DEPENDS
+# test ca_root_nss is added as TEST_DEPENDS
+#
+# Examples:
+# USES=certs:fetch,run # Use certificates for fetch and runtime
+# USES=certs:build # Use certificates at build time
+#
+# MAINTAINER: yuri@FreeBSD.org
+
+.if !defined(_INCLUDE_USES_CERTS_MK)
+_INCLUDE_USES_CERTS_MK= yes
+
+# certificate bundle location and port
+_CERTS_DEP= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
+
+# all valid arguments
+_CERTS_ALL_ARGS= fetch build run test
+
+. if empty(certs_ARGS)
+IGNORE= USES=certs requires at least one argument (${_CERTS_ALL_ARGS})
+. endif
+
+. if !empty(certs_ARGS:Nfetch:Nbuild:Nrun:Ntest)
+IGNORE= USES=certs has invalid arguments: ${certs_ARGS}. Valid arguments are: ${_CERTS_ALL_ARGS}
+. endif
+
+# Set dependencies based on arguments
+. if ${certs_ARGS:Mfetch}
+FETCH_DEPENDS+= ${_CERTS_DEP}
+. endif
+
+. if ${certs_ARGS:Mbuild}
+BUILD_DEPENDS+= ${_CERTS_DEP}
+. endif
+
+. if ${certs_ARGS:Mrun}
+RUN_DEPENDS+= ${_CERTS_DEP}
+. endif
+
+. if ${certs_ARGS:Mtest}
+TEST_DEPENDS+= ${_CERTS_DEP}
+. endif
+
+.endif # _INCLUDE_USES_CERTS_MK