pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/pkgformat/pkg



Module Name:    pkgsrc
Committed By:   riastradh
Date:           Fri Apr 12 19:56:23 UTC 2024

Modified Files:
        pkgsrc/mk/pkgformat/pkg: pkgformat-vars.mk

Log Message:
mk/pkgformat/pkg: Make default cross-built PKG_DBDIR nicer.

`bootstrap --prefix /home/user/pkg' will create an mk.conf with
PKG_DBDIR=/home/user/pkg/pkgdb, but if you are using that installation
to cross-build packages, you likely want the default cross-built
PKG_DBDIR to be /usr/pkg/pkgdb just like the default cross-built
LOCALBASE is /usr/pkg.  This change implements that.

You can still override the cross-built PKG_DBDIR by setting
CROSS_PKG_DBDIr in mk.conf.

No change to native builds because the new logic is conditional on
USE_CROSS_COMPILE = yes.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.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/pkgformat/pkg/pkgformat-vars.mk
diff -u pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.16 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.17
--- pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.16      Fri Jan 26 12:40:04 2024
+++ pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk   Fri Apr 12 19:56:23 2024
@@ -1,4 +1,4 @@
-# $NetBSD: pkgformat-vars.mk,v 1.16 2024/01/26 12:40:04 riastradh Exp $
+# $NetBSD: pkgformat-vars.mk,v 1.17 2024/04/12 19:56:23 riastradh Exp $
 #
 # This Makefile fragment is included indirectly by bsd.prefs.mk and
 # defines some variables which must be defined earlier than where
@@ -16,7 +16,21 @@ USE_TOOLS+=  date
 .endif
 
 # This is the package database directory for the default view.
+.if ${USE_CROSS_COMPILE:tl} != "yes"
 PKG_DBDIR?=            ${LOCALBASE}/pkgdb
+.else
+.  ifndef HOST_PKG_DBDIR
+# XXX This isn't quite right: if PKG_DBDIR is defined in terms of
+# LOCALBASE, we really want to resolve it (`HOST_PKG_DBDIR:=') in
+# bsd.prefs.mk before we switch LOCALBASE to CROSS_LOCALBASE.  But
+# there's no place there to put pkgformat-vars business.  Fortunately,
+# bootstrap just writes out the full path so this is only an issue if
+# you explicitly write out `PKG_DBDIR= ...${LOCALBASE}...' in your
+# mk.conf.
+HOST_PKG_DBDIR:=       ${PKG_DBDIR:U${TOOLBASE}/pkgdb}
+.  endif
+PKG_DBDIR=             ${CROSS_PKG_DBDIR:U${LOCALBASE}/pkgdb}
+.endif
 
 # _PKG_DBDIR is the actual packages database directory where we register
 # packages.



Home | Main Index | Thread Index | Old Index