pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk/plist



Module Name:    pkgsrc
Committed By:   cheusov
Date:           Wed May  8 10:49:25 UTC 2024

Modified Files:
        pkgsrc/mk/plist: print-plist.mk

Log Message:
If option "nls" is supported, print-PLIST target automatically
adds ${PLIST.nls} prefix to appropriate .mo lines. This allows not to
add PRINT_PLIST_AWK to all packages with "nls" option.

In theory this mechanism can be extended to other use cases.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 pkgsrc/mk/plist/print-plist.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/plist/print-plist.mk
diff -u pkgsrc/mk/plist/print-plist.mk:1.36 pkgsrc/mk/plist/print-plist.mk:1.37
--- pkgsrc/mk/plist/print-plist.mk:1.36 Wed Jun 10 16:06:09 2020
+++ pkgsrc/mk/plist/print-plist.mk      Wed May  8 10:49:25 2024
@@ -1,4 +1,4 @@
-# $NetBSD: print-plist.mk,v 1.36 2020/06/10 16:06:09 leot Exp $
+# $NetBSD: print-plist.mk,v 1.37 2024/05/08 10:49:25 cheusov Exp $
 #
 # Automatic PLIST generation
 #  - files & symlinks first
@@ -7,11 +7,19 @@
 #  - substitute for platform or package specifics substrings
 #
 # Usage:
-#  - make install
+#  - make build
+#  - make do-install
 #  - make print-PLIST | brain >PLIST
 #
 # Keywords: plist print-plist
 
+# A list of pairs (regexp, option) for prefixing PLIST entry
+# with ${PLIST.<option>} if <regexp> matches it.
+.if !empty(PKG_OPTIONS:Mnls)
+_PRINT_PLIST_REGEXP_OPTION_LIST+= \
+       ^share\/locale\/.*[.]mo$$                       nls
+.endif
+
 _PRINT_PLIST_AWK_SUBST={
 _PRINT_PLIST_AWK_SUBST+=                                               \
        gsub(/${PKGNAME_NOREV}/, "$${PKGNAME}");                        \
@@ -21,6 +29,10 @@ _PRINT_PLIST_AWK_SUBST+=                                             \
        gsub("^${PKGINFODIR}/", "info/");                               \
        gsub("^${PKGMANDIR}/", "man/");
 
+.for regexp option in ${_PRINT_PLIST_REGEXP_OPTION_LIST}
+_PRINT_PLIST_AWK_SUBST+=       if (/${regexp}/) $$0 = "$${PLIST.${option}}" $$0;
+.endfor
+
 _PRINT_PLIST_AWK_SUBST+=}
 
 _PRINT_PLIST_AWK_IGNORE=       ($$0 ~ /^${PKG_DBDIR:S|^${PREFIX}/||:S|/|\\/|g}\//)



Home | Main Index | Thread Index | Old Index