git: a70c5c3fd44b - main - security/sudo-rs: Add NLS support
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 21 Jul 2026 02:34:44 UTC
The branch main has been updated by meta:
URL: https://cgit.FreeBSD.org/ports/commit/?id=a70c5c3fd44b49eb692a4703fe91a62b37c58ce7
commit a70c5c3fd44b49eb692a4703fe91a62b37c58ce7
Author: Koichiro Iwao <meta@FreeBSD.org>
AuthorDate: 2026-07-21 01:55:25 +0000
Commit: Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2026-07-21 02:29:03 +0000
security/sudo-rs: Add NLS support
PR: 296629
---
security/sudo-rs/Makefile | 18 +++++++++++++++++-
security/sudo-rs/pkg-plist | 5 +++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/security/sudo-rs/Makefile b/security/sudo-rs/Makefile
index 1f180ba453b5..72c4126901eb 100644
--- a/security/sudo-rs/Makefile
+++ b/security/sudo-rs/Makefile
@@ -1,6 +1,7 @@
PORTNAME= sudo-rs
DISTVERSIONPREFIX= v
DISTVERSION= 0.2.14
+PORTREVISION= 1
CATEGORIES= security
MAINTAINER= marc@trifectatech.org
@@ -40,7 +41,16 @@ SUB_FILES= sudoers
PLIST_SUB+= RS_SUFFIX=${RS_SUFFIX}
PORTDOCS= CHANGELOG.md CONTRIBUTING.md COPYRIGHT LICENSE-* README.md SECURITY.md
-OPTIONS_DEFINE= DOCS
+OPTIONS_DEFINE= DOCS NLS
+OPTIONS_SUB= yes
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MNLS}
+USES+= gettext
+CARGO_FEATURES+= gettext
+RUSTFLAGS+= -L ${LOCALBASE}/lib
+.endif
post-install:
${MV} ${STAGEDIR}${PREFIX}/bin/visudo ${STAGEDIR}${PREFIX}/sbin/visudo${RS_SUFFIX}
@@ -66,4 +76,10 @@ post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
+post-install-NLS-on:
+.for lang in de es nl pl zh_CN
+ cd ${WRKSRC}/po && msgfmt ${lang}.po -o sudo-rs.mo
+ ${INSTALL_DATA} ${WRKSRC}/po/sudo-rs.mo ${STAGEDIR}${PREFIX}/share/locale/${lang}/LC_MESSAGES/
+.endfor
+
.include <bsd.port.mk>
diff --git a/security/sudo-rs/pkg-plist b/security/sudo-rs/pkg-plist
index 389d20676dd9..25df8299404f 100644
--- a/security/sudo-rs/pkg-plist
+++ b/security/sudo-rs/pkg-plist
@@ -10,3 +10,8 @@ share/man/man8/visudo%%RS_SUFFIX%%.8.gz
@dir etc/sudoers.d
@dir /var/db/sudo
@dir /var/run/sudo
+%%NLS%%share/locale/de/LC_MESSAGES/sudo-rs.mo
+%%NLS%%share/locale/es/LC_MESSAGES/sudo-rs.mo
+%%NLS%%share/locale/nl/LC_MESSAGES/sudo-rs.mo
+%%NLS%%share/locale/pl/LC_MESSAGES/sudo-rs.mo
+%%NLS%%share/locale/zh_CN/LC_MESSAGES/sudo-rs.mo