tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: print-PLIST and options
>> With this approach:
>> 1) future package updates won't break this option
>> 2) packages will semi-automatically obtain "nls" option,
>> especially new one.
> I think it's too early for that and will break too much if committed
> as-is, since the package will need to have "PLIST_VARS+=nls" and
> configure logic that disables nls to make this work, and the nls
> option is not (yet?) well-supported in pkgsrc.
This is exactly my goal -- to persuade the developers to add "nls"
support. Step-by-step as soon as they updates packages (or create a new
one) with the help of ready for use PLIST (better than nothing).
Any way new patch is in attachment.
> I'd prefer if it you made the share/locale logic conditional on the
> existence of an 'nls' option,
Done.
>> Index: mk/plist/print-plist.mk
>> ===================================================================
>> RCS file: /cvsroot/pkgsrc/mk/plist/print-plist.mk,v
>> retrieving revision 1.36
>> diff -u -r1.36 print-plist.mk
>> --- mk/plist/print-plist.mk 10 Jun 2020 16:06:09 -0000 1.36
>> +++ mk/plist/print-plist.mk 6 May 2024 14:32:16 -0000
>> @@ -7,11 +7,18 @@
>> # - substitute for platform or package specifics substrings
>> #
>> # Usage:
>> -# - make install
>> +# - make build
>> +# - make do-install
> Why this change?
Real requirements for correct work of print-PLIST are "build" and
"do-install" targets. It is not necessary to "install" package to the
system. Installation to ".destdir" is enough.
Index: mk/plist/print-plist.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/plist/print-plist.mk,v
retrieving revision 1.36
diff -u -r1.36 print-plist.mk
--- mk/plist/print-plist.mk 10 Jun 2020 16:06:09 -0000 1.36
+++ mk/plist/print-plist.mk 6 May 2024 15:17:22 -0000
@@ -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 @@
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