tech-pkg archive

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

Re: RHEL/Centos 7 builtin vs pkgsrc zlib clash for Makefiles that include devel/zlib/buildlink3.mk



On 2020-08-16 19:16, Greg Troxel wrote:
Jason Bacon <outpaddling%yahoo.com@localhost> writes:

So if we're ready to tell users that we don't support changes to
PREFER_* after bootstrap, I think this issue is resolved. Otherwise,
we may have some difficult work ahead.
Definitely.  You just can't change these fundamental things and expect
reliable behavior.  (You can of course do what you want and often get
away with it, but that's different.)

Requesting final review of the patch below before commit:

Index: bootstrap
===================================================================
RCS file: /cvsroot/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.291
diff -u -r1.291 bootstrap
--- bootstrap   14 Aug 2020 08:45:30 -0000      1.291
+++ bootstrap   18 Aug 2020 13:10:10 -0000
@@ -70,6 +70,7 @@
     [ --pkginfodir <pkginfodir> ]
     [ --pkgmandir <pkgmandir> ]
     [ --prefer-pkgsrc <list|yes|no> ]
+    [ --prefer-native <list|yes|no> ]
     [ --prefix <prefix> ]
     [ --preserve-path ]
     [ --quiet ]
@@ -448,6 +449,10 @@
                        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,30 @@
 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}



Home | Main Index | Thread Index | Old Index