xbps-src: base-chroot-v2 (reduce artifacts/deps)

This patchset contains multiple changes to xbps-src and
its required package "base-chroot" for building packages
via chroot.

- moved xbps.d(5) conf files to `etc/xbps.d`.
- renamed xbps.d(5) repository files to `etc/xbps.d/repos-{local,remote}*`.
- do not set `--repository` to any xbps command that supports it,
  xbps-src now simply populates `rootdir/etc/xbps.d` with correct
  settings (taking care of CHROOT_READY/IN_CHROOT).
- Unless `-C` is set (to preserve builddir/destdir/autodeps), when
  entering to the chroot (if CHROOT_READY is set), xbps-src will
  clean up the masterdir and then perform a system update to always
  use a constant set of packages for that exact date.
- Improved some normal/error msgs.
- Includes support for `xbps>=0.58`.
- common/hooks: switch to bsdtar.
- base-chroot:
  - base-chroot-musl is gone, now unified for glibc/musl.
  - deps removed: gettext, mpfr, readline, texinfo, which, xz.
  - deps changed: tar -> bsdtar.

Effectively this reduces dependencies in `base-chroot`, makes
it unified for musl and glibc, switches xbps-src to use `bsdtar`
rather than GNU `tar` and `xz`, gets rid of useless host dependencies
like GNU gettext, texinfo, etc.

I've been testing these changes for 1 month or so already,
I was able to build from scratch `base-system` for both native
and multiple targets, i.e `./xbps-src -a target -Nt pkg base-system`
This commit is contained in:
Juan RP 2020-01-01 11:15:35 +01:00
parent b714ffe390
commit 75eca1b03e
26 changed files with 325 additions and 356 deletions

View file

@ -39,15 +39,27 @@ prepare_cross_sysroot() {
[ -z "$cross" -o "$cross" = "" -o -f $statefile ] && return 0
# Check if the cross pkg is installed in host.
check_installed_pkg cross-${XBPS_CROSS_TRIPLET}-0.1_1
[ $? -eq 0 ] && return 0
# Check if the cross compiler pkg is available in repos, otherwise build it.
pkg_available cross-${XBPS_CROSS_TRIPLET}
rval=$?
if [ $rval -eq 0 ]; then
$XBPS_LIBEXECDIR/build.sh cross-${XBPS_CROSS_TRIPLET} cross-${XBPS_CROSS_TRIPLET} pkg || return $?
fi
# Check if cross-vpkg-dummy is installed.
check_installed_pkg cross-vpkg-dummy-0.30_1 $cross
[ $? -eq 0 ] && return 0
# Check for cross-vpkg-dummy available for the target arch, otherwise build it.
pkg_available 'cross-vpkg-dummy>=0.33_1' $cross
if [ $? -eq 0 ]; then
$XBPS_LIBEXECDIR/build.sh cross-vpkg-dummy cross-vpkg-dummy pkg $cross init || return $?
$XBPS_LIBEXECDIR/build.sh cross-vpkg-dummy bootstrap pkg $cross init || return $?
fi
check_installed_pkg cross-vpkg-dummy-0.30_1 $cross
[ $? -eq 0 ] && return 0
msg_normal "Installing $cross cross pkg: cross-vpkg-dummy ...\n"
errlog=$(mktemp) || exit 1
$XBPS_INSTALL_XCMD -Syfd cross-vpkg-dummy &>$errlog
@ -75,6 +87,10 @@ install_cross_pkg() {
[ -z "$cross" -o "$cross" = "" ] && return 0
# Check if installed.
check_installed_pkg cross-${XBPS_CROSS_TRIPLET}-0.1_1
[ $? -eq 0 ] && return 0
# Check if the cross compiler pkg is available in repos, otherwise build it.
pkg_available cross-${XBPS_CROSS_TRIPLET}
rval=$?
@ -82,11 +98,8 @@ install_cross_pkg() {
$XBPS_LIBEXECDIR/build.sh cross-${XBPS_CROSS_TRIPLET} cross-${XBPS_CROSS_TRIPLET} pkg || return $?
fi
check_installed_pkg cross-${XBPS_CROSS_TRIPLET}-0.1_1
[ $? -eq 0 ] && return 0
errlog=$(mktemp) || exit 1
msg_normal "Installing $cross cross compiler: cross-${XBPS_CROSS_TRIPLET} ...\n"
msg_normal "xbps-src: installing cross compiler: cross-${XBPS_CROSS_TRIPLET} ...\n"
$XBPS_INSTALL_CMD -Syfd cross-${XBPS_CROSS_TRIPLET} &>$errlog
rval=$?
if [ $rval -ne 0 -a $rval -ne 17 ]; then