summaryrefslogtreecommitdiff
path: root/bootstrap/bootstrap
diff options
context:
space:
mode:
authorbacon <bacon@pkgsrc.org>2020-08-20 13:04:01 +0000
committerbacon <bacon@pkgsrc.org>2020-08-20 13:04:01 +0000
commit150d865f9139309a3e11e7a0baccea4ae75d02f7 (patch)
tree8a0dae9111f78af86c72662b699e0f9d7b6758a7 /bootstrap/bootstrap
parent8a8b0080a02756a02990d774353bfbff9d924710 (diff)
downloadpkgsrc-150d865f9139309a3e11e7a0baccea4ae75d02f7.tar.gz
bootstrap: Default to PREFER_PKGSRC=yes on Linux
Avoids problems caused by linking against aging enterprise Linux libraries or libraries from Linux package managers that undergo ABI changes outside pkgsrc control. Add --prefer-native flag to bootstrap script so all PREFER_* values can be set during bootstrap. This resolves issues where bootstrap links packages against native libraries and pkgsrc equivalents are installed afterward due to changes to PREFER_NATIVE after bootstrap. Automatically document danger of changing PREFER_PKGSRC or PREFER_NATIVE after boostrap in mk.conf
Diffstat (limited to 'bootstrap/bootstrap')
-rwxr-xr-xbootstrap/bootstrap26
1 files changed, 25 insertions, 1 deletions
diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap
index 4d75fd90d71..464d4523130 100755
--- a/bootstrap/bootstrap
+++ b/bootstrap/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: bootstrap,v 1.291 2020/08/14 08:45:30 jperkin Exp $
+# $NetBSD: bootstrap,v 1.292 2020/08/20 13:04:01 bacon Exp $
#
# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org>
# All rights reserved.
@@ -70,6 +70,7 @@ usage="Usage: $0 "'
[ --pkginfodir <pkginfodir> ]
[ --pkgmandir <pkgmandir> ]
[ --prefer-pkgsrc <list|yes|no> ]
+ [ --prefer-native <list|yes|no> ]
[ --prefix <prefix> ]
[ --preserve-path ]
[ --quiet ]
@@ -448,6 +449,10 @@ while [ $# -gt 0 ]; do
prefer_pkgsrc=`get_optarg "$1"` ;;
--prefer-pkgsrc)
prefer_pkgsrc="$2"; shift ;;
+ --prefer-native=*)
+ prefer_native=`get_optarg "$1"` ;;
+ --prefer-native)
+ prefer_native="$2"; shift ;;
--preserve-path) preserve_path=yes ;;
--mk-fragment=*)
mk_fragment=`get_optarg "$1"` ;;
@@ -1064,10 +1069,29 @@ echo "PKGINFODIR= $pkginfodir" >> ${TARGET_MKCONF}
echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF}
echo "" >> ${TARGET_MKCONF}
+case $opsys in
+Linux)
+ # Default to PREFER_PKGSRC=yes unless user specifies --prefer-native=yes
+ # Linux systems likely have software from other packages managers
+ # like yum or apt that can leak into pkgsrc and cause issues as they
+ # age, undergo ABI changes, or get added/removed behind our backs.
+ # Let pkgsrc maintain all dependencies to avoid these problems.
+ if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ]; then
+ prefer_pkgsrc="yes"
+ fi
+ ;;
+esac
+
if [ -n "$prefer_pkgsrc" ]; then
+ echo "# WARNING: Changing PREFER_* after bootstrap will require rebuilding all" >> ${TARGET_MKCONF}
+ echo "# packages with a dependency that switched between native/pkgsrc." >> ${TARGET_MKCONF}
echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF}
echo "" >> ${TARGET_MKCONF}
fi
+if [ -n "$prefer_native" ]; then
+ echo "PREFER_NATIVE= $prefer_native" >> ${TARGET_MKCONF}
+ echo "" >> ${TARGET_MKCONF}
+fi
BOOTSTRAP_MKCONF=${wrkdir}/mk.conf
cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF}