pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools



Module Name:    pkgsrc
Committed By:   wiz
Date:           Fri Jan  9 14:40:02 UTC 2026

Modified Files:
        pkgsrc/pkgtools: Makefile
Added Files:
        pkgsrc/pkgtools/varcache: Makefile

Log Message:
varcache: add support package to speed up bulk builds

Usage:

        make show-varcache > varcache.mk

and include the resulting varcache.mk from your /etc/mk.conf file during
bulk builds to avoid having to find out relatively fixed values again for
every package in the scan and build phase.

Not hooked up to pkgtools/Makefile because it's not a package, just a
convenience target.

This package is from jperkin, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 pkgsrc/pkgtools/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/pkgtools/varcache/Makefile

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

Modified files:

Index: pkgsrc/pkgtools/Makefile
diff -u pkgsrc/pkgtools/Makefile:1.127 pkgsrc/pkgtools/Makefile:1.128
--- pkgsrc/pkgtools/Makefile:1.127      Thu Aug  8 10:42:34 2024
+++ pkgsrc/pkgtools/Makefile    Fri Jan  9 14:40:01 2026
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.127 2024/08/08 10:42:34 wiz Exp $
+# $NetBSD: Makefile,v 1.128 2026/01/09 14:40:01 wiz Exp $
 #
 
 COMMENT=       Tools for use in the packages collection
@@ -80,6 +80,7 @@ SUBDIR+=      rpm2pkg
 SUBDIR+=       shlock
 SUBDIR+=       texlive2pkg
 SUBDIR+=       url2pkg
+#SUBDIR+=      varcache # for speeding pkgsrc scans, not a real package
 SUBDIR+=       verifypc
 SUBDIR+=       x11-links
 

Added files:

Index: pkgsrc/pkgtools/varcache/Makefile
diff -u /dev/null pkgsrc/pkgtools/varcache/Makefile:1.1
--- /dev/null   Fri Jan  9 14:40:02 2026
+++ pkgsrc/pkgtools/varcache/Makefile   Fri Jan  9 14:40:02 2026
@@ -0,0 +1,67 @@
+# $NetBSD: Makefile,v 1.1 2026/01/09 14:40:02 wiz Exp $
+#
+# This is not a normal package, it is a standalone Makefile to help generate
+# varcache entries that speed up builds by precomputing expensive variables.
+#
+# Usage:
+#     make show-varcache > varcache.mk
+#
+# and include the resulting varcache.mk from your /etc/mk.conf file during
+# bulk builds to avoid having to find out relatively fixed values again for
+# every package.
+#
+
+BUILTINS!=     ls -1 ../../*/*/builtin.mk ../../mk/*.builtin.mk
+
+#
+# Be specific about which matches we want to include.  We would rather be
+# missing a few variables than include anything which could cause problems.
+#
+VC_MATCH:=     ^(BUILTIN_LIB_FOUND|BUILTIN_PKG|FIND_FILES)
+VC_MATCH:=     ${VC_MATCH}|^(H_|PC_|SH_|_BLTN_H_)
+VC_MATCH:=     ${VC_MATCH}|(DBM_H |_DRV |_PC )
+VC_MATCH:=     ${VC_MATCH}|^(BIN|BINUTILS)_FILE
+VC_MATCH:=     ${VC_MATCH}|^(XAUTH|XINIT)
+
+#
+# With X11_TYPE=modular we could end up with a situation where an X11 pkgsrc
+# package happens to be installed, and will then be detected as a builtin due
+# to X11BASE being set to LOCALBASE.  Include bsd.prefs.mk first to get the
+# default setting, and then override it.
+#
+.include "../../mk/bsd.prefs.mk"
+
+X11BASE:=      /nonexistent
+
+show-varcache:
+       @{ ${MAKEVARS:@t@ \
+               printf "%s %s\n" ${t:Q} ${${t:Q}:Q}; \
+               @} } | ${SORT} | uniq | ${EGREP} ${VC_MATCH:Q} \
+       | ${AWK} ' \
+       { \
+               if ("${OSX_SDK_PATH}") { \
+                       gsub(/${OSX_SDK_PATH:S,/,\\/,g}/, "$${OSX_SDK_PATH}"); \
+               } \
+       } \
+       /^BUILTIN_PKG/ && ! $$2 { \
+               next; \
+       } \
+       { \
+               if (length($$1) >= 31) { \
+                       print $$1 "=\t" $$2 \
+               } else if (length($$1) >= 23) { \
+                       print $$1 "=\t\t" $$2 \
+               } else if (length($$1) >= 15) { \
+                       print $$1 "=\t\t\t" $$2 \
+               } else if (length($$1) >= 7) { \
+                       print $$1 "=\t\t\t\t" $$2 \
+               } else { \
+                       print $$1 "=\t\t\t\t\t" $$2 \
+               } \
+       }'
+
+.for builtin in ${BUILTINS}
+.  include "${builtin:Q}"
+.endfor
+
+.include "../../mk/bsd.pkg.mk"



Home | Main Index | Thread Index | Old Index