From 848063d7a531bcf11e7ee66cbddee77f6fb7c20a Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 17 Jan 2024 01:08:32 -0500 Subject: [PATCH 1/5] *: rename masterdir to buildroot --- .github/workflows/build.yaml | 4 +- .github/workflows/cycles.yml | 2 +- Manual.md | 12 +- README.md | 44 +++--- common/build-style/cmake.sh | 2 +- common/chroot-style/README | 2 +- common/chroot-style/bwrap.sh | 8 +- common/chroot-style/ethereal.sh | 32 ++--- common/chroot-style/uchroot.sh | 8 +- common/chroot-style/uunshare.sh | 8 +- common/environment/configure/bootstrap.sh | 4 +- common/environment/configure/pkg-config.sh | 2 +- common/travis/prepare.sh | 4 +- common/xbps-src/libexec/xbps-src-dopkg.sh | 4 +- common/xbps-src/shutils/chroot.sh | 96 ++++++------- common/xbps-src/shutils/common.sh | 4 +- common/xbps-src/shutils/cross.sh | 4 +- common/xbps-src/shutils/pkgtarget.sh | 2 +- srcpkgs/acl/template | 4 +- srcpkgs/chroot-git/template | 2 +- srcpkgs/chroot-util-linux/template | 4 +- srcpkgs/gcc/template | 4 +- srcpkgs/glibc/template | 2 +- .../patches/py-smbus_fix-destdir.patch | 2 +- srcpkgs/libgccjit/template | 2 +- srcpkgs/libmpc/template | 4 +- srcpkgs/man-db/template | 2 +- srcpkgs/pciutils/template | 4 +- srcpkgs/python3-adblock/template | 2 +- .../files/generating-distfiles.md | 22 +-- srcpkgs/sydbox/template | 2 +- xbps-src | 130 +++++++++--------- 32 files changed, 214 insertions(+), 214 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 03b5c270dbb44..0ce7685fd6211 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,7 @@ jobs: xbps-install -y grep curl git - name: Clone and checkout uses: classabbyamp/treeless-checkout-action@v1 - - name: Create hostrepo and prepare masterdir + - name: Create hostrepo and prepare buildroot run: | ln -s "$(pwd)" /hostrepo && common/travis/set_mirror.sh && @@ -95,7 +95,7 @@ jobs: - name: Clone and checkout uses: classabbyamp/treeless-checkout-action@v1 - - name: Create hostrepo and prepare masterdir + - name: Create hostrepo and prepare buildroot run: | ln -s "$(pwd)" /hostrepo && common/travis/set_mirror.sh && diff --git a/.github/workflows/cycles.yml b/.github/workflows/cycles.yml index 292282daa9842..7c7fab4848ed2 100644 --- a/.github/workflows/cycles.yml +++ b/.github/workflows/cycles.yml @@ -29,7 +29,7 @@ jobs: - name: Clone and checkout uses: classabbyamp/treeless-checkout-action@v1 - - name: Create hostrepo and prepare masterdir + - name: Create hostrepo and prepare buildroot run: | ln -s "$(pwd)" /hostrepo && common/travis/set_mirror.sh && diff --git a/Manual.md b/Manual.md index e6a98551eee30..6fcbb4d280865 100644 --- a/Manual.md +++ b/Manual.md @@ -149,7 +149,7 @@ If the default `do_check` function provided by the build style doesn't do anythi or can't run in all environments, `make_check` should be set to fitting value or `do_check` should be customized to limit testsuite unless `XBPS_CHECK_PKGS` is `full`. -- `install` This phase installs the `package files` into the package destdir `/destdir/-`, +- `install` This phase installs the `package files` into the package destdir `/destdir/-`, via `make install` or any other compatible method. - `pkg` This phase builds the `binary packages` with files stored in the @@ -347,7 +347,7 @@ The following variables are defined by `xbps-src` and can be used on any templat - `sourcepkg` Set to the to main package name, can be used to match the main package rather than additional binary package names. -- `CHROOT_READY` Set if the target chroot (masterdir) is ready for chroot builds. +- `CHROOT_READY` Set if the target chroot (buildroot) is ready for chroot builds. - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package. @@ -355,17 +355,17 @@ rather than additional binary package names. Longer testsuites should only be run in `do_check()` if it is set to `full`. - `DESTDIR` Full path to the fake destdir used by the source pkg, set to -`/destdir/${sourcepkg}-${version}`. +`/destdir/${sourcepkg}-${version}`. - `FILESDIR` Full path to the `files` package directory, i.e `srcpkgs/foo/files`. The `files` directory can be used to store additional files to be installed as part of the source package. - `PKGDESTDIR` Full path to the fake destdir used by the `pkg_install()` function in -`subpackages`, set to `/destdir/${pkgname}-${version}`. +`subpackages`, set to `/destdir/${pkgname}-${version}`. - `XBPS_BUILDDIR` Directory to store the `source code` of the source package being processed, -set to `/builddir`. The package `wrksrc` is always stored +set to `/builddir`. The package `wrksrc` is always stored in this directory such as `${XBPS_BUILDDIR}/${wrksrc}`. - `XBPS_MACHINE` The machine architecture as returned by `xbps-uhelper arch`. @@ -1166,7 +1166,7 @@ defined by a `build_style` script. Current working directory for functions is set as follows: -- For pre_fetch, pre_extract, do_clean: ``. +- For pre_fetch, pre_extract, do_clean: ``. - For do_fetch, post_fetch: `XBPS_BUILDDIR`. diff --git a/README.md b/README.md index 8710f20ae1916..3245d1adf6901 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ See [Contributing](./CONTRIBUTING.md) for a general overview of how to contribut - [Distfiles mirrors](#distfiles-mirrors) - [Cross compiling packages for a target architecture](#cross-compiling) - [Using xbps-src in a foreign Linux distribution](#foreign) -- [Remaking the masterdir](#remaking-masterdir) -- [Keeping your masterdir uptodate](#updating-masterdir) +- [Remaking the buildroot](#remaking-buildroot) +- [Keeping your buildroot uptodate](#updating-buildroot) - [Building 32bit packages on x86_64](#building-32bit) - [Building packages natively for the musl C library](#building-for-musl) - [Building void base-system from scratch](#building-base-system) @@ -47,7 +47,7 @@ For bootstrapping additionally: - objcopy(1), objdump(1), strip(1): binutils `xbps-src` requires [a utility to chroot](#chroot-methods) and bind mount existing directories -into a `masterdir` that is used as its main `chroot` directory. `xbps-src` supports +into a `buildroot` that is used as its main `chroot` directory. `xbps-src` supports multiple utilities to accomplish this task. > NOTE: `xbps-src` does not allow building as root anymore. Use one of the chroot @@ -154,7 +154,7 @@ Destroys host system it runs on. Only useful for one-shot containers, i.e docker ### Install the bootstrap packages There is a set of packages that makes up the initial build container, called the `bootstrap`. -These packages are installed into the `masterdir` in order to create the container. +These packages are installed into the `buildroot` in order to create the container. The primary and recommended way to set up this container is using the `binary-bootstrap` command. This will use pre-existing binary packages, either from remote `xbps` repositories @@ -217,7 +217,7 @@ The following directory hierarchy is used with a default configuration file: | |- repocache ... | |- sources ... | - |- masterdir + |- buildroot | |- builddir -> ... | |- destdir -> ... | |- host -> bind mounted from @@ -226,7 +226,7 @@ The following directory hierarchy is used with a default configuration file: The description of these directories is as follows: - - `masterdir`: master directory to be used as rootfs to build/install packages. + - `buildroot`: master directory to be used as rootfs to build/install packages. - `builddir`: to unpack package source tarballs and where packages are built. - `destdir`: to install packages, aka **fake destdir**. - `hostdir/ccache`: to store ccache data if the `XBPS_CCACHE` option is enabled. @@ -413,7 +413,7 @@ checksum verification, the original download location is used. If you use `uchroot` for your XBPS_CHROOT_CMD, you may also specify a local path using the `file://` prefix or simply an absolute path on your build host (e.g. /mnt/distfiles). Mirror locations specified this way are bind mounted inside the chroot environment -under $XBPS_MASTERDIR and searched for distfiles just the same as remote locations. +under $XBPS_BUILDROOT and searched for distfiles just the same as remote locations. ### Cross compiling packages for a target architecture @@ -450,18 +450,18 @@ and `xbps-src` should be fully functional; just start the `bootstrap` process, i $ ./xbps-src binary-bootstrap -The default masterdir is created in the current working directory, i.e `void-packages/masterdir`. +The default buildroot is created in the current working directory, i.e `void-packages/buildroot`. - -### Remaking the masterdir + +### Remaking the buildroot -If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact): +If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a buildroot with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact): $ ./xbps-src zap $ ./xbps-src binary-bootstrap - -### Keeping your masterdir uptodate + +### Keeping your buildroot uptodate Sometimes the bootstrap packages must be updated to the latest available version in repositories, this is accomplished with the `bootstrap-update` target: @@ -472,25 +472,25 @@ Sometimes the bootstrap packages must be updated to the latest available version Two ways are available to build 32bit packages on x86\_64: - - native mode with a 32bit masterdir (recommended, used in official repository) + - native mode with a 32bit buildroot (recommended, used in official repository) - cross compilation mode to i686 [target](#cross-compiling) -The canonical mode (native) needs a new x86 `masterdir`: +The canonical mode (native) needs a new x86 `buildroot`: - $ ./xbps-src -m masterdir-x86 binary-bootstrap i686 - $ ./xbps-src -m masterdir-x86 ... + $ ./xbps-src -m buildroot-x86 binary-bootstrap i686 + $ ./xbps-src -m buildroot-x86 ... ### Building packages natively for the musl C library -Canonical way of building packages for same architecture but different C library is through dedicated masterdir. -To build for x86_64-musl on glibc x86_64 system, prepare a new masterdir with the musl packages: +Canonical way of building packages for same architecture but different C library is through dedicated buildroot. +To build for x86_64-musl on glibc x86_64 system, prepare a new buildroot with the musl packages: - $ ./xbps-src -m masterdir-x86_64-musl binary-bootstrap x86_64-musl + $ ./xbps-src -m buildroot-x86_64-musl binary-bootstrap x86_64-musl -Your new masterdir is now ready to build packages natively for the musl C library: +Your new buildroot is now ready to build packages natively for the musl C library: - $ ./xbps-src -m masterdir-x86_64-musl pkg ... + $ ./xbps-src -m buildroot-x86_64-musl pkg ... ### Building void base-system from scratch diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh index 124ed354eff67..3349ddbc23420 100644 --- a/common/build-style/cmake.sh +++ b/common/build-style/cmake.sh @@ -14,7 +14,7 @@ SET(CMAKE_SYSTEM_VERSION 1) SET(CMAKE_C_COMPILER ${CC}) SET(CMAKE_CXX_COMPILER ${CXX}) -SET(CMAKE_FIND_ROOT_PATH "${XBPS_MASTERDIR}/usr;${XBPS_MASTERDIR}") +SET(CMAKE_FIND_ROOT_PATH "${XBPS_BUILDROOT}/usr;${XBPS_BUILDROOT}") SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/common/chroot-style/README b/common/chroot-style/README index a5d89d016cf15..9891b863da57a 100644 --- a/common/chroot-style/README +++ b/common/chroot-style/README @@ -4,7 +4,7 @@ CHROOT STYLES This directory contains scripts to perform the chroot operation with xbps-src. The scripts should accept at least 5 arguments: - - $1 (MASTERDIR) masterdir to chroot + - $1 (BUILDROOT) buildroot to chroot - $2 (DISTDIR) path to the void-packages directory - $3 (HOSTDIR) path to hostdir - $4 (EXTRA_ARGS) additional arguments to be passed diff --git a/common/chroot-style/bwrap.sh b/common/chroot-style/bwrap.sh index de4323506a3e0..b7ba4767c068a 100755 --- a/common/chroot-style/bwrap.sh +++ b/common/chroot-style/bwrap.sh @@ -3,7 +3,7 @@ # This chroot script uses bubblewrap (see https://github.com/containers/bubblewrap) # set -e -readonly MASTERDIR="$1" +readonly BUILDROOT="$1" readonly DISTDIR="$2" readonly HOSTDIR="$3" readonly EXTRA_ARGS="$4" @@ -13,11 +13,11 @@ if ! command -v bwrap >/dev/null 2>&1; then exit 1 fi -if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then - echo "$0 MASTERDIR/DISTDIR not set" +if [ -z "$BUILDROOT" -o -z "$DISTDIR" ]; then + echo "$0 BUILDROOT/DISTDIR not set" exit 1 fi -exec bwrap --bind "$MASTERDIR" / --ro-bind "$DISTDIR" /void-packages \ +exec bwrap --bind "$BUILDROOT" / --ro-bind "$DISTDIR" /void-packages \ --dev /dev --tmpfs /tmp --proc /proc \ ${HOSTDIR:+--bind "$HOSTDIR" /host} $EXTRA_ARGS "$@" diff --git a/common/chroot-style/ethereal.sh b/common/chroot-style/ethereal.sh index a226465cc82ff..90b70e371cdf9 100755 --- a/common/chroot-style/ethereal.sh +++ b/common/chroot-style/ethereal.sh @@ -1,13 +1,13 @@ #!/bin/sh # # This chroot script uses symlinks to emulate being in a chroot using -# the host system as the masterdir +# the host system as the buildroot # # It will damage your host system, only use it in disposable # containers. # # 2 extra steps required when using this chroot-style: -# 1. Symlink / to masterdir inside the void-packages repo +# 1. Symlink / to buildroot inside the void-packages repo # 2. write the arch of the host system, as dictated by xbps-uhelper arch # into /.xbps_chroot_init # @@ -20,24 +20,24 @@ # $ xbps-install -y -r /tmp/image \ # -R http://mirrors.servercentral.com/voidlinux/current \ # -S base-chroot -# $ tar -pC /tmp/image -c . | sudo docker import - voidlinux/masterdir +# $ tar -pC /tmp/image -c . | sudo docker import - voidlinux/buildroot # $ rm -rf /tmp/image # # docker run --rm -it \ # -e XBPS_CHROOT_CMD=ethereal \ # -e XBPS_ALLOW_CHROOT_BREAKOUT=yes \ -# -v $(pwd):/hostrepo voidlinux/masterdir \ -# /bin/bash -c 'ln -s / /hostrepo/masterdir && /hostrepo/xbps-src pkg ' +# -v $(pwd):/hostrepo voidlinux/buildroot \ +# /bin/bash -c 'ln -s / /hostrepo/buildroot && /hostrepo/xbps-src pkg ' # -readonly MASTERDIR="$1" +readonly BUILDROOT="$1" readonly DISTDIR="$2" readonly HOSTDIR="$3" readonly EXTRA_ARGS="$4" readonly CMD="$5" shift 5 -if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then - echo "$0 MASTERDIR/DISTDIR not set" +if [ -z "$BUILDROOT" -o -z "$DISTDIR" ]; then + echo "$0 BUILDROOT/DISTDIR not set" exit 1 fi @@ -72,16 +72,16 @@ if [ "${XBPS_ALLOW_CHROOT_BREAKOUT}" != "yes" ]; then exit 1 fi -if [ ! -L "$MASTERDIR" -o "$(readlink "$MASTERDIR")" != "/" ]; then - msg_red "$MASTERDIR isn't symlinked to /!\n" +if [ ! -L "$BUILDROOT" -o "$(readlink "$BUILDROOT")" != "/" ]; then + msg_red "$BUILDROOT isn't symlinked to /!\n" exit 1 fi -fake_mount "$DISTDIR" "$MASTERDIR"/void-packages +fake_mount "$DISTDIR" "$BUILDROOT"/void-packages # Do the same for hostdir if [ -n "$HOSTDIR" ]; then - fake_mount "$HOSTDIR" "$MASTERDIR"/host + fake_mount "$HOSTDIR" "$BUILDROOT"/host fi # xbps-src may send some other binds, parse them here @@ -118,8 +118,8 @@ cd "${OLDPWD}" # Remove the symlink and restore an empty dir to simulate # an umount operation. if [ -n "$HOSTDIR" ]; then - rm -f "$MASTERDIR"/host - mkdir -p "$MASTERDIR"/host + rm -f "$BUILDROOT"/host + mkdir -p "$BUILDROOT"/host fi # Same as the operation above, do it all for all mountpoints @@ -129,7 +129,7 @@ for m in $mounts; do mkdir -p "$m" done -rm -f "$MASTERDIR"/void-packages -mkdir -p "$MASTERDIR"/void-packages +rm -f "$BUILDROOT"/void-packages +mkdir -p "$BUILDROOT"/void-packages exit $ret diff --git a/common/chroot-style/uchroot.sh b/common/chroot-style/uchroot.sh index 5fe47eb9f8bcb..501c422f5b645 100755 --- a/common/chroot-style/uchroot.sh +++ b/common/chroot-style/uchroot.sh @@ -2,7 +2,7 @@ # # This chroot script uses xbps-uchroot(1). # -readonly MASTERDIR="$1" +readonly BUILDROOT="$1" readonly DISTDIR="$2" readonly HOSTDIR="$3" readonly EXTRA_ARGS="$4" @@ -13,9 +13,9 @@ if ! command -v xbps-uchroot >/dev/null 2>&1; then exit 1 fi -if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then - echo "$0 MASTERDIR/DISTDIR not set" +if [ -z "$BUILDROOT" -o -z "$DISTDIR" ]; then + echo "$0 BUILDROOT/DISTDIR not set" exit 1 fi -exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD $@ +exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $BUILDROOT $CMD $@ diff --git a/common/chroot-style/uunshare.sh b/common/chroot-style/uunshare.sh index 4d5146445fd2d..66a9a4eac66db 100755 --- a/common/chroot-style/uunshare.sh +++ b/common/chroot-style/uunshare.sh @@ -2,7 +2,7 @@ # # This chroot script uses xbps-uunshare(1) with user_namespaces(7). # -readonly MASTERDIR="$1" +readonly BUILDROOT="$1" readonly DISTDIR="$2" readonly HOSTDIR="$3" readonly EXTRA_ARGS="$4" @@ -13,9 +13,9 @@ if ! command -v xbps-uunshare >/dev/null 2>&1; then exit 1 fi -if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then - echo "$0 MASTERDIR/DISTDIR not set" +if [ -z "$BUILDROOT" -o -z "$DISTDIR" ]; then + echo "$0 BUILDROOT/DISTDIR not set" exit 1 fi -exec xbps-uunshare $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD $@ +exec xbps-uunshare $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $BUILDROOT $CMD $@ diff --git a/common/environment/configure/bootstrap.sh b/common/environment/configure/bootstrap.sh index f5ba5f442c7c0..558b64ecc2eb8 100644 --- a/common/environment/configure/bootstrap.sh +++ b/common/environment/configure/bootstrap.sh @@ -1,4 +1,4 @@ if [ -z "$CHROOT_READY" ]; then - CFLAGS+=" -isystem ${XBPS_MASTERDIR}/usr/include" - LDFLAGS+=" -L${XBPS_MASTERDIR}/usr/lib -Wl,-rpath-link=${XBPS_MASTERDIR}/usr/lib" + CFLAGS+=" -isystem ${XBPS_BUILDROOT}/usr/include" + LDFLAGS+=" -L${XBPS_BUILDROOT}/usr/lib -Wl,-rpath-link=${XBPS_BUILDROOT}/usr/lib" fi diff --git a/common/environment/configure/pkg-config.sh b/common/environment/configure/pkg-config.sh index bf81c5f9afa68..d43baeee1f1da 100644 --- a/common/environment/configure/pkg-config.sh +++ b/common/environment/configure/pkg-config.sh @@ -1,5 +1,5 @@ # This snippet setups pkg-config vars. if [ -z "$CHROOT_READY" ]; then - export PKG_CONFIG_PATH="${XBPS_MASTERDIR}/usr/lib/pkgconfig:${XBPS_MASTERDIR}/usr/share/pkgconfig" + export PKG_CONFIG_PATH="${XBPS_BUILDROOT}/usr/lib/pkgconfig:${XBPS_BUILDROOT}/usr/share/pkgconfig" fi diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh index 46072e9f81ea9..5086c8f0b2f3b 100755 --- a/common/travis/prepare.sh +++ b/common/travis/prepare.sh @@ -10,5 +10,5 @@ echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf echo XBPS_CHROOT_CMD=ethereal >> etc/conf echo XBPS_ALLOW_CHROOT_BREAKOUT=yes >> etc/conf -/bin/echo -e '\x1b[32mLinking / to /masterdir...\x1b[0m' -ln -s / masterdir +/bin/echo -e '\x1b[32mLinking / to /buildroot...\x1b[0m' +ln -s / buildroot diff --git a/common/xbps-src/libexec/xbps-src-dopkg.sh b/common/xbps-src/libexec/xbps-src-dopkg.sh index 5fec7b9d8d56c..ab1a322ec612f 100755 --- a/common/xbps-src/libexec/xbps-src-dopkg.sh +++ b/common/xbps-src/libexec/xbps-src-dopkg.sh @@ -36,8 +36,8 @@ if [ "$sourcepkg" != "$PKGNAME" ]; then pkgname=$PKGNAME fi -if [ -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then - export XBPS_ARCH=$(<$XBPS_MASTERDIR/.xbps_chroot_init) +if [ -s $XBPS_BUILDROOT/.xbps_chroot_init ]; then + export XBPS_ARCH=$(<$XBPS_BUILDROOT/.xbps_chroot_init) fi # Run do-pkg hooks. diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh index fc17dae4fdbe9..9db8910238f29 100644 --- a/common/xbps-src/shutils/chroot.sh +++ b/common/xbps-src/shutils/chroot.sh @@ -27,8 +27,8 @@ install_base_chroot() { msg_error "xbps-src: failed to install base-chroot!\n" fi # Reconfigure base-files to create dirs/symlinks. - if xbps-query -r $XBPS_MASTERDIR base-files &>/dev/null; then - XBPS_ARCH=$XBPS_TARGET_PKG xbps-reconfigure -r $XBPS_MASTERDIR -f base-files &>/dev/null + if xbps-query -r $XBPS_BUILDROOT base-files &>/dev/null; then + XBPS_ARCH=$XBPS_TARGET_PKG xbps-reconfigure -r $XBPS_BUILDROOT -f base-files &>/dev/null fi msg_normal "xbps-src: installed base-chroot successfully!\n" @@ -38,14 +38,14 @@ install_base_chroot() { } reconfigure_base_chroot() { - local statefile="$XBPS_MASTERDIR/.xbps_chroot_configured" + local statefile="$XBPS_BUILDROOT/.xbps_chroot_configured" local pkgs="glibc-locales ca-certificates" [ -z "$IN_CHROOT" -o -e $statefile ] && return 0 # Reconfigure ca-certificates. msg_normal "xbps-src: reconfiguring base-chroot...\n" for f in ${pkgs}; do - if xbps-query -r $XBPS_MASTERDIR $f &>/dev/null; then - xbps-reconfigure -r $XBPS_MASTERDIR -f $f + if xbps-query -r $XBPS_BUILDROOT $f &>/dev/null; then + xbps-reconfigure -r $XBPS_BUILDROOT -f $f fi done touch -f $statefile @@ -54,27 +54,27 @@ reconfigure_base_chroot() { update_base_chroot() { local keep_all_force=$1 [ -z "$CHROOT_READY" ] && return - msg_normal "xbps-src: updating software in $XBPS_MASTERDIR masterdir...\n" + msg_normal "xbps-src: updating software in $XBPS_BUILDROOT buildroot...\n" # no need to sync repodata, chroot_sync_repodata() does it for us. if $(${XBPS_INSTALL_CMD} ${XBPS_INSTALL_ARGS} -nu|grep -q xbps); then ${XBPS_INSTALL_CMD} ${XBPS_INSTALL_ARGS} -yu xbps || msg_error "xbps-src: failed to update xbps!\n" fi ${XBPS_INSTALL_CMD} ${XBPS_INSTALL_ARGS} -yu || msg_error "xbps-src: failed to update base-chroot!\n" - msg_normal "xbps-src: cleaning up $XBPS_MASTERDIR masterdir...\n" + msg_normal "xbps-src: cleaning up $XBPS_BUILDROOT buildroot...\n" [ -z "$XBPS_KEEP_ALL" -a -z "$XBPS_SKIP_DEPS" ] && remove_pkg_autodeps - [ -z "$XBPS_KEEP_ALL" -a -z "$keep_all_force" ] && rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir + [ -z "$XBPS_KEEP_ALL" -a -z "$keep_all_force" ] && rm -rf $XBPS_BUILDROOT/builddir $XBPS_BUILDROOT/destdir } # FIXME: $XBPS_FFLAGS is not set when chroot_init() is run # It is set in common/build-profiles/bootstrap.sh but lost somewhere? chroot_init() { - mkdir -p $XBPS_MASTERDIR/etc/xbps + mkdir -p $XBPS_BUILDROOT/etc/xbps : ${XBPS_CONFIG_FILE:=/dev/null} - cat > $XBPS_MASTERDIR/etc/xbps/xbps-src.conf <<_EOF + cat > $XBPS_BUILDROOT/etc/xbps/xbps-src.conf <<_EOF # Generated configuration file by xbps-src, DO NOT EDIT! $(grep -E '^XBPS_.*' "$XBPS_CONFIG_FILE") -XBPS_MASTERDIR=/ +XBPS_BUILDROOT=/ XBPS_CFLAGS="$XBPS_CFLAGS" XBPS_CXXFLAGS="$XBPS_CXXFLAGS" XBPS_FFLAGS="$XBPS_FFLAGS" @@ -85,7 +85,7 @@ XBPS_HOSTDIR=/host _EOF # Create custom script to start the chroot bash shell. - cat > $XBPS_MASTERDIR/bin/xbps-shell <<_EOF + cat > $XBPS_BUILDROOT/bin/xbps-shell <<_EOF #!/bin/sh XBPS_SRC_VERSION="$XBPS_SRC_VERSION" @@ -97,52 +97,52 @@ PATH=/void-packages:/usr/bin exec env -i -- SHELL=/bin/sh PATH="\$PATH" DISTCC_HOSTS="\$XBPS_DISTCC_HOSTS" DISTCC_DIR="/host/distcc" \ ${XBPS_ARCH+XBPS_ARCH=$XBPS_ARCH} ${XBPS_CHECK_PKGS+XBPS_CHECK_PKGS=$XBPS_CHECK_PKGS} \ CCACHE_DIR="/host/ccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 TERM=linux HOME="/tmp" \ - PS1="[\u@$XBPS_MASTERDIR \W]$ " /bin/bash +h "\$@" + PS1="[\u@$XBPS_BUILDROOT \W]$ " /bin/bash +h "\$@" _EOF - chmod 755 $XBPS_MASTERDIR/bin/xbps-shell - cp -f /etc/resolv.conf $XBPS_MASTERDIR/etc + chmod 755 $XBPS_BUILDROOT/bin/xbps-shell + cp -f /etc/resolv.conf $XBPS_BUILDROOT/etc return 0 } chroot_prepare() { local f= - if [ -f $XBPS_MASTERDIR/.xbps_chroot_init ]; then + if [ -f $XBPS_BUILDROOT/.xbps_chroot_init ]; then return 0 - elif [ ! -f $XBPS_MASTERDIR/bin/bash ]; then - msg_error "Bootstrap not installed in $XBPS_MASTERDIR, can't continue.\n" + elif [ ! -f $XBPS_BUILDROOT/bin/bash ]; then + msg_error "Bootstrap not installed in $XBPS_BUILDROOT, can't continue.\n" fi # Some software expects /etc/localtime to be a symbolic link it can read to # determine the name of the time zone, so set up the expected link # structure. - ln -sf ../usr/share/zoneinfo/UTC $XBPS_MASTERDIR/etc/localtime + ln -sf ../usr/share/zoneinfo/UTC $XBPS_BUILDROOT/etc/localtime for f in dev sys tmp proc host boot; do - [ ! -d $XBPS_MASTERDIR/$f ] && mkdir -p $XBPS_MASTERDIR/$f + [ ! -d $XBPS_BUILDROOT/$f ] && mkdir -p $XBPS_BUILDROOT/$f done # Copy /etc/passwd and /etc/group from base-files. - cp -f $XBPS_SRCPKGDIR/base-files/files/passwd $XBPS_MASTERDIR/etc + cp -f $XBPS_SRCPKGDIR/base-files/files/passwd $XBPS_BUILDROOT/etc echo "$(whoami):x:$(id -u):$(id -g):$(whoami) user:/tmp:/bin/xbps-shell" \ - >> $XBPS_MASTERDIR/etc/passwd - cp -f $XBPS_SRCPKGDIR/base-files/files/group $XBPS_MASTERDIR/etc - echo "$(whoami):x:$(id -g):" >> $XBPS_MASTERDIR/etc/group + >> $XBPS_BUILDROOT/etc/passwd + cp -f $XBPS_SRCPKGDIR/base-files/files/group $XBPS_BUILDROOT/etc + echo "$(whoami):x:$(id -g):" >> $XBPS_BUILDROOT/etc/group # Copy /etc/hosts from base-files. - cp -f $XBPS_SRCPKGDIR/base-files/files/hosts $XBPS_MASTERDIR/etc + cp -f $XBPS_SRCPKGDIR/base-files/files/hosts $XBPS_BUILDROOT/etc # Prepare default locale: en_US.UTF-8. - if [ -s ${XBPS_MASTERDIR}/etc/default/libc-locales ]; then + if [ -s ${XBPS_BUILDROOT}/etc/default/libc-locales ]; then printf '%s\n' \ 'C.UTF-8 UTF-8' \ 'en_US.UTF-8 UTF-8' \ - >> ${XBPS_MASTERDIR}/etc/default/libc-locales + >> ${XBPS_BUILDROOT}/etc/default/libc-locales fi - touch -f $XBPS_MASTERDIR/.xbps_chroot_init - [ -n "$1" ] && echo $1 >> $XBPS_MASTERDIR/.xbps_chroot_init + touch -f $XBPS_BUILDROOT/.xbps_chroot_init + [ -n "$1" ] && echo $1 >> $XBPS_BUILDROOT/.xbps_chroot_init return 0 } @@ -155,8 +155,8 @@ chroot_handler() { if [ -n "$IN_CHROOT" -o -z "$CHROOT_READY" ]; then return 0 fi - if [ ! -d $XBPS_MASTERDIR/void-packages ]; then - mkdir -p $XBPS_MASTERDIR/void-packages + if [ ! -d $XBPS_BUILDROOT/void-packages ]; then + mkdir -p $XBPS_BUILDROOT/void-packages fi case "$action" in @@ -168,7 +168,7 @@ chroot_handler() { if [ "$action" = "chroot" ]; then $XBPS_COMMONDIR/chroot-style/${XBPS_CHROOT_CMD:=uunshare}.sh \ - $XBPS_MASTERDIR $XBPS_DISTDIR "$XBPS_HOSTDIR" "$XBPS_CHROOT_CMD_ARGS" /bin/xbps-shell + $XBPS_BUILDROOT $XBPS_DISTDIR "$XBPS_HOSTDIR" "$XBPS_CHROOT_CMD_ARGS" /bin/xbps-shell rv=$? else env -i -- PATH="/usr/bin:$PATH" SHELL=/bin/sh \ @@ -190,7 +190,7 @@ chroot_handler() { XBPS_ALLOW_CHROOT_BREAKOUT="$XBPS_ALLOW_CHROOT_BREAKOUT" \ ${XBPS_ALT_REPOSITORY:+XBPS_ALT_REPOSITORY=$XBPS_ALT_REPOSITORY} \ $XBPS_COMMONDIR/chroot-style/${XBPS_CHROOT_CMD:=uunshare}.sh \ - $XBPS_MASTERDIR $XBPS_DISTDIR "$XBPS_HOSTDIR" "$XBPS_CHROOT_CMD_ARGS" \ + $XBPS_BUILDROOT $XBPS_DISTDIR "$XBPS_HOSTDIR" "$XBPS_CHROOT_CMD_ARGS" \ /void-packages/xbps-src $XBPS_OPTIONS $action $pkg rv=$? fi @@ -202,8 +202,8 @@ chroot_sync_repodata() { local f= hostdir= confdir= crossconfdir= # always start with an empty xbps.d - confdir=$XBPS_MASTERDIR/etc/xbps.d - crossconfdir=$XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d + confdir=$XBPS_BUILDROOT/etc/xbps.d + crossconfdir=$XBPS_BUILDROOT/$XBPS_CROSS_BASE/etc/xbps.d [ -d $confdir ] && rm -rf $confdir [ -d $crossconfdir ] && rm -rf $crossconfdir @@ -286,13 +286,13 @@ chroot_sync_repodata() { # Copy host repos to the cross root. if [ -n "$XBPS_CROSS_BUILD" ]; then - rm -rf $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d - mkdir -p $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d + rm -rf $XBPS_BUILDROOT/$XBPS_CROSS_BASE/etc/xbps.d + mkdir -p $XBPS_BUILDROOT/$XBPS_CROSS_BASE/etc/xbps.d # Disable 00-repository-main.conf from share/xbps.d (part of xbps) - ln -s /dev/null $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d/00-repository-main.conf + ln -s /dev/null $XBPS_BUILDROOT/$XBPS_CROSS_BASE/etc/xbps.d/00-repository-main.conf # copy xbps.d files from host for local repos - cp ${XBPS_MASTERDIR}/etc/xbps.d/*local*.conf \ - $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d + cp ${XBPS_BUILDROOT}/etc/xbps.d/*local*.conf \ + $XBPS_BUILDROOT/$XBPS_CROSS_BASE/etc/xbps.d if [ "$XBPS_SKIP_REMOTEREPOS" ]; then rm -f $crossconfdir/*remote* else @@ -314,11 +314,11 @@ chroot_sync_repodata() { fi - # Copy xbps repository keys to the masterdir. - mkdir -p $XBPS_MASTERDIR/var/db/xbps/keys - cp -f $XBPS_COMMONDIR/repo-keys/*.plist $XBPS_MASTERDIR/var/db/xbps/keys + # Copy xbps repository keys to the buildroot. + mkdir -p $XBPS_BUILDROOT/var/db/xbps/keys + cp -f $XBPS_COMMONDIR/repo-keys/*.plist $XBPS_BUILDROOT/var/db/xbps/keys if [ -n "$(shopt -s nullglob; echo "$XBPS_DISTDIR"/etc/repo-keys/*.plist)" ]; then - cp -f "$XBPS_DISTDIR"/etc/repo-keys/*.plist "$XBPS_MASTERDIR"/var/db/xbps/keys + cp -f "$XBPS_DISTDIR"/etc/repo-keys/*.plist "$XBPS_BUILDROOT"/var/db/xbps/keys fi # Make sure to sync index for remote repositories. @@ -329,14 +329,14 @@ chroot_sync_repodata() { if [ -n "$XBPS_CROSS_BUILD" ]; then # Copy host keys to the target rootdir. - mkdir -p $XBPS_MASTERDIR/$XBPS_CROSS_BASE/var/db/xbps/keys - cp $XBPS_MASTERDIR/var/db/xbps/keys/*.plist \ - $XBPS_MASTERDIR/$XBPS_CROSS_BASE/var/db/xbps/keys + mkdir -p $XBPS_BUILDROOT/$XBPS_CROSS_BASE/var/db/xbps/keys + cp $XBPS_BUILDROOT/var/db/xbps/keys/*.plist \ + $XBPS_BUILDROOT/$XBPS_CROSS_BASE/var/db/xbps/keys # Make sure to sync index for remote repositories. if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then msg_normal "xbps-src: updating repositories for target ($XBPS_TARGET_MACHINE)...\n" env -- XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE \ - $XBPS_INSTALL_CMD $XBPS_INSTALL_ARGS -r $XBPS_MASTERDIR/$XBPS_CROSS_BASE -S + $XBPS_INSTALL_CMD $XBPS_INSTALL_ARGS -r $XBPS_BUILDROOT/$XBPS_CROSS_BASE -S fi fi diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index 4083e08ee084f..f662bffff3b9d 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -137,8 +137,8 @@ error_func() { exit_and_cleanup() { local rval=$1 - if [ -n "$XBPS_TEMP_MASTERDIR" -a "$XBPS_TEMP_MASTERDIR" != "1" ]; then - rm -rf "$XBPS_TEMP_MASTERDIR" + if [ -n "$XBPS_TEMP_BUILDROOT" -a "$XBPS_TEMP_BUILDROOT" != "1" ]; then + rm -rf "$XBPS_TEMP_BUILDROOT" fi exit ${rval:=0} } diff --git a/common/xbps-src/shutils/cross.sh b/common/xbps-src/shutils/cross.sh index c21bab1747875..5c1b2b35cc4ec 100644 --- a/common/xbps-src/shutils/cross.sh +++ b/common/xbps-src/shutils/cross.sh @@ -4,7 +4,7 @@ remove_pkg_cross_deps() { local rval= tmplogf= prevs=0 [ -z "$XBPS_CROSS_BUILD" ] && return 0 - cd $XBPS_MASTERDIR || return 1 + cd $XBPS_BUILDROOT || return 1 msg_normal "${pkgver:-xbps-src}: removing autocrossdeps, please wait...\n" tmplogf=$(mktemp) || exit 1 @@ -35,7 +35,7 @@ remove_pkg_cross_deps() { prepare_cross_sysroot() { local cross="$1" - local statefile="$XBPS_MASTERDIR/.xbps-${cross}-done" + local statefile="$XBPS_BUILDROOT/.xbps-${cross}-done" [ -z "$cross" -o "$cross" = "" -o -f $statefile ] && return 0 diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh index 1e76a1b93b19e..3a5e3f4337cb8 100644 --- a/common/xbps-src/shutils/pkgtarget.sh +++ b/common/xbps-src/shutils/pkgtarget.sh @@ -58,7 +58,7 @@ pkg_available() { remove_pkg_autodeps() { local rval= tmplogf= errlogf= prevs= - cd $XBPS_MASTERDIR || return 1 + cd $XBPS_BUILDROOT || return 1 msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n" tmplogf=$(mktemp) || exit 1 errlogf=$(mktemp) || exit 1 diff --git a/srcpkgs/acl/template b/srcpkgs/acl/template index 9fa74946a2409..bccb3259c799a 100644 --- a/srcpkgs/acl/template +++ b/srcpkgs/acl/template @@ -15,8 +15,8 @@ distfiles="${NONGNU_SITE}/acl/acl-${version}.tar.gz" checksum=760c61c68901b37fdd5eefeeaf4c0c7a26bdfdd8ac747a1edff1ce0e243c11af if [ -z "$CHROOT_READY" ]; then - CFLAGS+=" -I${XBPS_MASTERDIR}/usr/include" - LDFLAGS+=" -L${XBPS_MASTERDIR}/usr/lib" + CFLAGS+=" -I${XBPS_BUILDROOT}/usr/include" + LDFLAGS+=" -L${XBPS_BUILDROOT}/usr/lib" fi acl-devel_package() { diff --git a/srcpkgs/chroot-git/template b/srcpkgs/chroot-git/template index 3e2d1847cde84..bfad07282eede 100644 --- a/srcpkgs/chroot-git/template +++ b/srcpkgs/chroot-git/template @@ -48,7 +48,7 @@ do_configure() { fi if ! [ "$CHROOT_READY" ]; then cat <<-EOF >>config.mak - ZLIB_PATH = ${XBPS_MASTERDIR}/usr + ZLIB_PATH = ${XBPS_BUILDROOT}/usr NO_CURL = Yes EOF fi diff --git a/srcpkgs/chroot-util-linux/template b/srcpkgs/chroot-util-linux/template index e2c3c5f49ed70..ee8ad13034552 100644 --- a/srcpkgs/chroot-util-linux/template +++ b/srcpkgs/chroot-util-linux/template @@ -23,8 +23,8 @@ provides="util-linux-${version}_${revision}" repository=bootstrap if [ -z "$CHROOT_READY" ]; then - CFLAGS+=" -I${XBPS_MASTERDIR}/usr/include" - LDFLAGS+=" -L${XBPS_MASTERDIR}/usr/lib" + CFLAGS+=" -I${XBPS_BUILDROOT}/usr/include" + LDFLAGS+=" -L${XBPS_BUILDROOT}/usr/lib" fi post_install() { diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template index a8f6096042247..6e1a9f65abdfd 100644 --- a/srcpkgs/gcc/template +++ b/srcpkgs/gcc/template @@ -237,7 +237,7 @@ do_configure() { _args+=" --with-build-sysroot=${XBPS_CROSS_BASE}" _langs+=",objc,obj-c++,fortran" elif [ -z "$CHROOT_READY" ]; then - export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib${XBPS_TARGET_WORDSIZE}" + export LD_LIBRARY_PATH="${XBPS_BUILDROOT}/usr/lib${XBPS_TARGET_WORDSIZE}" _args+=" --build=${_triplet}" else _langs="c,c++,objc,obj-c++,fortran,lto" @@ -318,7 +318,7 @@ do_configure() { } do_build() { if [ -z "$CHROOT_READY" ]; then - export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib${XBPS_TARGET_WORDSIZE}" + export LD_LIBRARY_PATH="${XBPS_BUILDROOT}/usr/lib${XBPS_TARGET_WORDSIZE}" fi cd build if [ "$build_option_gnatboot" ]; then diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template index 3272a1df265c1..13d3e2b88172c 100644 --- a/srcpkgs/glibc/template +++ b/srcpkgs/glibc/template @@ -88,7 +88,7 @@ do_configure() { configure_args+=" --with-sysroot=${XBPS_CROSS_BASE}" configure_args+=" --with-headers=${XBPS_CROSS_BASE}/usr/include" else - configure_args+=" --with-headers=${XBPS_MASTERDIR}/usr/include" + configure_args+=" --with-headers=${XBPS_BUILDROOT}/usr/include" fi # Disable SSP from CFLAGS (enabled below) diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch index f61e4122cd622..b23bf806bc5c7 100644 --- a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch +++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch @@ -1,4 +1,4 @@ -I had to add '--root' to the patch for it to not poison the masterdir. +I had to add '--root' to the patch for it to not poison the buildroot. That part will still be needed as a patch when the next version gets released. -- 0x5c original message below diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template index fde1affd54b7c..fe601a2c099c6 100644 --- a/srcpkgs/libgccjit/template +++ b/srcpkgs/libgccjit/template @@ -107,7 +107,7 @@ do_configure() { _args+=" --host=$XBPS_CROSS_TRIPLET" _args+=" --with-build-sysroot=${XBPS_CROSS_BASE}" elif [ -z "$CHROOT_READY" ]; then - export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib${XBPS_TARGET_WORDSIZE}" + export LD_LIBRARY_PATH="${XBPS_BUILDROOT}/usr/lib${XBPS_TARGET_WORDSIZE}" _args+=" --build=${_target_triplet}" else _args+=" --build=${_target_triplet}" diff --git a/srcpkgs/libmpc/template b/srcpkgs/libmpc/template index 0d5622143a584..388f425ff9af2 100644 --- a/srcpkgs/libmpc/template +++ b/srcpkgs/libmpc/template @@ -14,8 +14,8 @@ distfiles="${GNU_SITE}/mpc/mpc-${version}.tar.gz" checksum=ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8 if [ -z "$CHROOT_READY" ]; then - CFLAGS="-I${XBPS_MASTERDIR}/usr/include" - LDFLAGS="-L${XBPS_MASTERDIR}/usr/lib" + CFLAGS="-I${XBPS_BUILDROOT}/usr/include" + LDFLAGS="-L${XBPS_BUILDROOT}/usr/lib" fi post_install() { diff --git a/srcpkgs/man-db/template b/srcpkgs/man-db/template index cea1193c9d6e9..21fcfce74e438 100644 --- a/srcpkgs/man-db/template +++ b/srcpkgs/man-db/template @@ -27,7 +27,7 @@ system_accounts="_man" _man_homedir="/var/cache/man" make_dirs="/var/cache/man 0755 _man _man" -# among others, requires the _man user to be available in the masterdir +# among others, requires the _man user to be available in the buildroot make_check=no alternatives=" diff --git a/srcpkgs/pciutils/template b/srcpkgs/pciutils/template index b5c8eb6bea052..95f67cdd4aacc 100644 --- a/srcpkgs/pciutils/template +++ b/srcpkgs/pciutils/template @@ -18,7 +18,7 @@ do_build() { RANLIB=${RANLIB} PREFIX=/usr CC=${CC} \ HOST=${XBPS_TARGET_MACHINE%-musl}-linux ZLIB=yes \ SHAREDIR=/usr/share/hwdata MANDIR=/usr/share/man all - cp lib/libpci.a ${XBPS_MASTERDIR}/tmp + cp lib/libpci.a ${XBPS_BUILDROOT}/tmp make clean make OPT="${CFLAGS}" SHARED=yes AR=${AR} \ RANLIB=${RANLIB} PREFIX=/usr CC=${CC} \ @@ -30,7 +30,7 @@ do_install() { make SHARED=yes PREFIX=/usr SHAREDIR=/usr/share/hwdata STRIP= \ MANDIR=/usr/share/man SBINDIR=/usr/bin \ DESTDIR=${DESTDIR} install install-lib - vinstall ${XBPS_MASTERDIR}/tmp/libpci.a 644 usr/lib + vinstall ${XBPS_BUILDROOT}/tmp/libpci.a 644 usr/lib # Set corrects perms to shlib. chmod 755 ${DESTDIR}/usr/lib/libpci.so.${version} diff --git a/srcpkgs/python3-adblock/template b/srcpkgs/python3-adblock/template index 71aeb5c9a84c4..a8aa682724ff2 100644 --- a/srcpkgs/python3-adblock/template +++ b/srcpkgs/python3-adblock/template @@ -21,7 +21,7 @@ do_build() { maturin build -o . --release --target "${RUST_TARGET}" --manylinux off # Drop platform specifiers from the wheel; pip will refuse to install, - # e.g., an armv7l wheel on an aarch64 system even if the masterdir is + # e.g., an armv7l wheel on an aarch64 system even if the buildroot is # armv7l. The wheel is correct; no need for name compatibility checks. mkdir -p dist mv adblock-${version}-*.whl dist/adblock-${version}-py3-none-any.whl diff --git a/srcpkgs/rust-bootstrap/files/generating-distfiles.md b/srcpkgs/rust-bootstrap/files/generating-distfiles.md index 36ee0ad230f2e..572ed716ae35e 100644 --- a/srcpkgs/rust-bootstrap/files/generating-distfiles.md +++ b/srcpkgs/rust-bootstrap/files/generating-distfiles.md @@ -9,16 +9,16 @@ problems. Note: Void no longer officially supports PowerPC platforms, this guide is kept for historical reasons as well as for future reference. -### Set up appropriate masterdirs and remote-repositories +### Set up appropriate buildroots and remote-repositories This guide assumes you're on an x86\_64 machine. If you're not, please adapt the appropriate sections. -First, we bootstrap our masterdirs. We need both a glibc one and a musl one: +First, we bootstrap our buildroots. We need both a glibc one and a musl one: ``` -$ ./xbps-src -m masterdir-glibc binary-bootstrap x86_64 -$ ./xbps-src -m masterdir-musl binary-bootstrap x86_64-musl +$ ./xbps-src -m buildroot-glibc binary-bootstrap x86_64 +$ ./xbps-src -m buildroot-musl binary-bootstrap x86_64-musl ``` In addition to those, we need to set up binary remotes for the ppc repos. As @@ -36,11 +36,11 @@ repo, but you can include them locally by creating these three files: Assuming you've already adjusted the version and checksums for the distfiles provided by upstream, we can now start building rust for our native -architecture, with both glibc and musl. Run this for both masterdirs +architecture, with both glibc and musl. Run this for both buildroots bootstrapped above ``` -$ ./xbps-src -m pkg cargo +$ ./xbps-src -m pkg cargo ``` This builds `rust-bootstrap`, `cargo-bootstrap`, `rust` and `cargo` for your @@ -52,13 +52,13 @@ Now that we have the our native architecture covered, we cross build for the architectures we need to generate distfiles for: ``` -$ ./xbps-src -m -a pkg -o bindist rust -$ ./xbps-src -m -a pkg rust -$ ./xbps-src -m -a pkg -o bindist cargo +$ ./xbps-src -m -a pkg -o bindist rust +$ ./xbps-src -m -a pkg rust +$ ./xbps-src -m -a pkg -o bindist cargo ``` -Repeat these three steps for `masterdir-glibc` with `ppc`, `masterdir-musl` with -`ppc64le-musl` and `masterdir-glibc` with `ppc64`. In the case of `ppc`, you can +Repeat these three steps for `buildroot-glibc` with `ppc`, `buildroot-musl` with +`ppc64le-musl` and `buildroot-glibc` with `ppc64`. In the case of `ppc`, you can skip the `bindist` build for rust, as we are taking those from upstream. Now that we have run those commands, the generated distfiles are available in diff --git a/srcpkgs/sydbox/template b/srcpkgs/sydbox/template index 2ab945bef8bfb..868a8504a8427 100644 --- a/srcpkgs/sydbox/template +++ b/srcpkgs/sydbox/template @@ -11,7 +11,7 @@ license="MIT" homepage="https://sydbox.exherbolinux.org" distfiles="https://gitlab.exherbo.org/sydbox/sydbox-1/-/archive/v${version}/sydbox-1-v${version}.tar.gz" checksum=681e44816f2780f9b45a2ef601acc4174bc8336277ea6b9015aad8213b93e3c0 -# needs perlful grep which breaks masterdir +# needs perlful grep which breaks buildroot make_check=no nocross="unable to properly check if seccomp is supported" diff --git a/xbps-src b/xbps-src index 712a578c6f91a..33448ee1e84fe 100755 --- a/xbps-src +++ b/xbps-src @@ -15,13 +15,13 @@ $PROGNAME: [options] [arguments] Targets: (only one may be specified) binary-bootstrap [arch] - Install bootstrap packages from host repositories into . + Install bootstrap packages from host repositories into . If the optional 'arch' argument is set, it will install bootstrap packages - from this architecture, and its required xbps utilities. The + from this architecture, and its required xbps utilities. The will be initialized for chroot operations. bootstrap - Build and install from source the bootstrap packages into . + Build and install from source the bootstrap packages into . bootstrap-update Updates bootstrap packages with latest versions available from registered @@ -31,7 +31,7 @@ consistency-check Runs a consistency check on all packages chroot - Enter to the chroot in . + Enter to the chroot in . clean-repocache Removes obsolete packages from /repocache. @@ -41,7 +41,7 @@ fetch extract Extract package source distribution file(s) into the build directory. - By default set to /builddir. + By default set to /builddir. patch Patch the package sources and perform other operations required to @@ -64,12 +64,12 @@ pkg Build binary package for and all required dependencies. clean [pkgname] - Removes auto dependencies, cleans up /builddir and /destdir. - If argument is specified, package files from /destdir and its - build directory in /buiddir are removed. + Removes auto dependencies, cleans up /builddir and /destdir. + If argument is specified, package files from /destdir and its + build directory in /buiddir are removed. list - Lists installed packages in . + Lists installed packages in . remove Remove target package from . If - is not matched @@ -145,7 +145,7 @@ update-hash-cache Update the hash cache with existing source distfiles. zap - Removes a masterdir but preserving ccache, distcc and host directories. + Removes a buildroot but preserving ccache, distcc and host directories. Options: @@ -176,7 +176,7 @@ $(print_cross_targets) -g Enable building -dbg packages with debugging symbols. -H - Absolute path to a directory to be bind mounted at /host. + Absolute path to a directory to be bind mounted at /host. The host directory stores binary packages, sources and package dependencies downloaded from remote repositories. If unset defaults to void-packages/hostdir. @@ -191,10 +191,10 @@ $(print_cross_targets) -L Disable ASCII colors. --m - Absolute path to a directory to be used as masterdir. - The masterdir is the main directory to build/store/compile packages. - If unset defaults to void-packages/masterdir. +-m + Absolute path to a directory to be used as buildroot. + The buildroot is the main directory to build/store/compile packages. + If unset defaults to void-packages/buildroot. -N Disable use of remote repositories to resolve dependencies. @@ -226,9 +226,9 @@ $(print_cross_targets) -s Make vsed warnings errors. --t Create a temporary masterdir to not pollute the current one. Note that - the existing masterdir must be fully populated with binary-bootstrap first. - Once the target has finished, this temporary masterdir will be removed. +-t Create a temporary buildroot to not pollute the current one. Note that + the existing buildroot must be fully populated with binary-bootstrap first. + Once the target has finished, this temporary buildroot will be removed. This flag requires xbps-uchroot(1), and won't work on filesystems that don't support overlayfs. @@ -278,15 +278,15 @@ check_build_requirements() { } chroot_check() { - if [ -f $XBPS_MASTERDIR/.xbps_chroot_init -o "$XBPS_CHROOT_CMD" = "ethereal" ]; then + if [ -f $XBPS_BUILDROOT/.xbps_chroot_init -o "$XBPS_CHROOT_CMD" = "ethereal" ]; then export CHROOT_READY=1 fi } check_native_arch() { if [ "$CHROOT_READY" ]; then - if [ -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then - export XBPS_ARCH=$(<$XBPS_MASTERDIR/.xbps_chroot_init) + if [ -s $XBPS_BUILDROOT/.xbps_chroot_init ]; then + export XBPS_ARCH=$(<$XBPS_BUILDROOT/.xbps_chroot_init) else export XBPS_ARCH=$(xbps-uhelper arch) fi @@ -306,10 +306,10 @@ check_native_arch() { fi } -masterdir_zap() { - rm -rf "$XBPS_MASTERDIR" - mkdir -p "$XBPS_MASTERDIR" - msg_normal "xbps-src: $XBPS_MASTERDIR masterdir cleaned up.\n" +buildroot_zap() { + rm -rf "$XBPS_BUILDROOT" + mkdir -p "$XBPS_BUILDROOT" + msg_normal "xbps-src: $XBPS_BUILDROOT buildroot cleaned up.\n" } exit_func() { @@ -349,7 +349,7 @@ setup_distfiles_mirror() { msg_warn "xbps-src: Invalid path in XBPS_DISTFILES_MIRROR ($mirror)\n" continue fi - mkdir -p "$XBPS_MASTERDIR/$path" + mkdir -p "$XBPS_BUILDROOT/$path" XBPS_CHROOT_CMD_ARGS+=" -b $path:$path" else case "$XBPS_TARGET" in @@ -397,7 +397,7 @@ while getopts "$XBPS_OPTSTRING" opt; do I) XBPS_ARG_SKIP_DEPS=1; XBPS_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -I -N";; j) XBPS_ARG_MAKEJOBS="$OPTARG"; XBPS_OPTIONS+=" -j $OPTARG";; L) export NOCOLORS=1; XBPS_OPTIONS+=" -L";; - m) XBPS_ARG_MASTERDIR="$OPTARG"; XBPS_OPTIONS+=" -m $OPTARG";; + m) XBPS_ARG_BUILDROOT="$OPTARG"; XBPS_OPTIONS+=" -m $OPTARG";; N) XBPS_ARG_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -N";; o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";; p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";; @@ -406,7 +406,7 @@ while getopts "$XBPS_OPTSTRING" opt; do K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";; r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";; s) XBPS_ARG_STRICT=yes; XBPS_OPTIONS+=" -s";; - t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";; + t) XBPS_ARG_TEMP_BUILDROOT=1; XBPS_OPTIONS+=" -t -C";; V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;; --) shift; break;; esac @@ -439,13 +439,13 @@ readonly REQHOST_UTILS="xbps-install xbps-query xbps-rindex xbps-uhelper \ check_reqhost_utils # -# Set XBPS_CONFIG_FILE, XBPS_DISTDIR, XBPS_MASTERDIR +# Set XBPS_CONFIG_FILE, XBPS_DISTDIR, XBPS_BUILDROOT # and XBPS_HOSTDIR. # if [ "$IN_CHROOT" ]; then readonly XBPS_CONFIG_FILE=/etc/xbps/xbps-src.conf readonly XBPS_DISTDIR=/void-packages - readonly XBPS_MASTERDIR=/ + readonly XBPS_BUILDROOT=/ readonly XBPS_HOSTDIR=/host else _distdir="$(readlink -f ${0%/*})" @@ -483,7 +483,7 @@ fi [ -n "$XBPS_ARG_SKIP_REMOTEREPOS" ] && XBPS_SKIP_REMOTEREPOS=1 [ -n "$XBPS_ARG_BUILD_FORCEMODE" ] && XBPS_BUILD_FORCEMODE=1 [ -n "$XBPS_ARG_INFORMATIVE_RUN" ] && XBPS_INFORMATIVE_RUN=1 -[ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1 +[ -n "$XBPS_ARG_TEMP_BUILDROOT" ] && XBPS_TEMP_BUILDROOT=1 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1 @@ -505,18 +505,18 @@ else fi export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \ - XBPS_INFORMATIVE_RUN XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \ + XBPS_INFORMATIVE_RUN XBPS_TEMP_BUILDROOT XBPS_BINPKG_EXISTS \ XBPS_USE_GIT_REVS XBPS_CHECK_PKGS XBPS_DEBUG_PKGS XBPS_SKIP_DEPS \ XBPS_KEEP_ALL XBPS_QUIET XBPS_ALT_REPOSITORY XBPS_STRICT XBPS_CROSS_BUILD \ XBPS_MAKEJOBS XBPS_PRINT_VARIABLES XBPS_IGNORE_BROKENNESS -# The masterdir/hostdir variables are forced and readonly in chroot +# The buildroot/hostdir variables are forced and readonly in chroot if [ -z "$IN_CHROOT" ]; then - [ -n "$XBPS_ARG_MASTERDIR" ] && XBPS_MASTERDIR="$XBPS_ARG_MASTERDIR" + [ -n "$XBPS_ARG_BUILDROOT" ] && XBPS_BUILDROOT="$XBPS_ARG_BUILDROOT" [ -n "$XBPS_ARG_HOSTDIR" ] && XBPS_HOSTDIR="$XBPS_ARG_HOSTDIR" - # Sanitize masterdir/hostdir once set for real (resolve links) - export XBPS_MASTERDIR="$(readlink -f $XBPS_MASTERDIR 2>/dev/null)" + # Sanitize buildroot/hostdir once set for real (resolve links) + export XBPS_BUILDROOT="$(readlink -f $XBPS_BUILDROOT 2>/dev/null)" export XBPS_HOSTDIR="$(readlink -f $XBPS_HOSTDIR 2>/dev/null)" fi @@ -527,16 +527,16 @@ if [ -z "$IN_CHROOT" -a "$UID" -eq 0 -a -z "$XBPS_ALLOW_CHROOT_BREAKOUT" ]; then exit 1 fi -# if XBPS_MASTERDIR unset, defaults to $XBPS_DISTDIR/masterdir. -: ${XBPS_MASTERDIR:=$XBPS_DISTDIR/masterdir} -[ ! -d $XBPS_MASTERDIR ] && mkdir -p $XBPS_MASTERDIR +# if XBPS_BUILDROOT unset, defaults to $XBPS_DISTDIR/buildroot. +: ${XBPS_BUILDROOT:=$XBPS_DISTDIR/buildroot} +[ ! -d $XBPS_BUILDROOT ] && mkdir -p $XBPS_BUILDROOT # if XBPS_HOSTDIR unset, defaults to $XBPS_DISTDIR/hostdir. : ${XBPS_HOSTDIR:=$XBPS_DISTDIR/hostdir} [ ! -d $XBPS_HOSTDIR ] && mkdir -p $XBPS_HOSTDIR -if [ -d "$XBPS_MASTERDIR" -a ! -w "$XBPS_MASTERDIR" ]; then - echo "ERROR: can't write to masterdir $XBPS_MASTERDIR." 1>&2 +if [ -d "$XBPS_BUILDROOT" -a ! -w "$XBPS_BUILDROOT" ]; then + echo "ERROR: can't write to buildroot $XBPS_BUILDROOT." 1>&2 exit 1 fi @@ -554,8 +554,8 @@ if [ -n "$XBPS_HOSTDIR" ]; then export XBPS_REPOSITORY=$XBPS_HOSTDIR/binpkgs readonly XBPS_SRCDISTDIR=$XBPS_HOSTDIR/sources else - export XBPS_REPOSITORY=$XBPS_MASTERDIR/host/binpkgs - readonly XBPS_SRCDISTDIR=$XBPS_MASTERDIR/host/sources + export XBPS_REPOSITORY=$XBPS_BUILDROOT/host/binpkgs + readonly XBPS_SRCDISTDIR=$XBPS_BUILDROOT/host/sources fi # Set XBPS_REPOSITORY to our current branch. @@ -590,7 +590,7 @@ fi chroot_check check_native_arch -# test if to use linux32 for 32-bit masterdirs in 64-bit environments +# test if to use linux32 for 32-bit buildroots in 64-bit environments # x86_64, ppc64 (BE) and aarch64 are capable of this, others are not linux32_check() { local hostarch="$1" @@ -610,11 +610,11 @@ linux32_check() { } # Reconfigure pkgs for 32bit on 64-bit systems and reexec itself. -if [ -z "$XBPS_REINIT" -a -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then - export XBPS_ARCH=${XBPS_ARCH:-$(<$XBPS_MASTERDIR/.xbps_chroot_init)} +if [ -z "$XBPS_REINIT" -a -s $XBPS_BUILDROOT/.xbps_chroot_init ]; then + export XBPS_ARCH=${XBPS_ARCH:-$(<$XBPS_BUILDROOT/.xbps_chroot_init)} if linux32_check "$XBPS_MACHINE" "$XBPS_ARCH"; then # reconfigure pkgs via linux32 - linux32 xbps-reconfigure -r ${XBPS_MASTERDIR} -a &>/dev/null + linux32 xbps-reconfigure -r ${XBPS_BUILDROOT} -a &>/dev/null # reexec itself via linux32 export XBPS_REINIT=1 exec linux32 $0 ${XBPS_OPTIONS} $@ @@ -639,14 +639,14 @@ if [ "$IN_CHROOT" ]; then readonly XBPS_DESTDIR=/destdir readonly XBPS_BUILDDIR=/builddir else - readonly XBPS_UHELPER_CMD="xbps-uhelper -r $XBPS_MASTERDIR" - readonly XBPS_INSTALL_CMD="xbps-install -c $XBPS_HOSTDIR/repocache-$XBPS_MACHINE -r $XBPS_MASTERDIR -C etc/xbps.d" - readonly XBPS_QUERY_CMD="xbps-query -c $XBPS_HOSTDIR/repocache-$XBPS_MACHINE -r $XBPS_MASTERDIR -C etc/xbps.d" - readonly XBPS_RECONFIGURE_CMD="xbps-reconfigure -r $XBPS_MASTERDIR" - readonly XBPS_REMOVE_CMD="xbps-remove -r $XBPS_MASTERDIR" - readonly XBPS_CHECKVERS_CMD="xbps-checkvers -r $XBPS_MASTERDIR" - readonly XBPS_DESTDIR=$XBPS_MASTERDIR/destdir - readonly XBPS_BUILDDIR=$XBPS_MASTERDIR/builddir + readonly XBPS_UHELPER_CMD="xbps-uhelper -r $XBPS_BUILDROOT" + readonly XBPS_INSTALL_CMD="xbps-install -c $XBPS_HOSTDIR/repocache-$XBPS_MACHINE -r $XBPS_BUILDROOT -C etc/xbps.d" + readonly XBPS_QUERY_CMD="xbps-query -c $XBPS_HOSTDIR/repocache-$XBPS_MACHINE -r $XBPS_BUILDROOT -C etc/xbps.d" + readonly XBPS_RECONFIGURE_CMD="xbps-reconfigure -r $XBPS_BUILDROOT" + readonly XBPS_REMOVE_CMD="xbps-remove -r $XBPS_BUILDROOT" + readonly XBPS_CHECKVERS_CMD="xbps-checkvers -r $XBPS_BUILDROOT" + readonly XBPS_DESTDIR=$XBPS_BUILDROOT/destdir + readonly XBPS_BUILDDIR=$XBPS_BUILDROOT/builddir fi readonly XBPS_RINDEX_CMD="xbps-rindex" readonly XBPS_FETCH_CMD="xbps-fetch" @@ -663,8 +663,8 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \ XBPS_MAKEJOBS XBPS_BUILD_FORCEMODE XBPS_USE_GIT_REVS XBPS_DEBUG_PKGS \ XBPS_CHECK_PKGS XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \ XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_ARG_PKG_OPTIONS XBPS_CONFIG_FILE \ - XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR XBPS_SRC_VERSION \ - XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \ + XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_BUILDROOT XBPS_SRC_VERSION \ + XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_BUILDROOT XBPS_BINPKG_EXISTS \ XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \ XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \ XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \ @@ -678,9 +678,9 @@ for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do unset val done -# A temporary masterdir requires xbps-uchroot(1) and -O to use overlayfs +# A temporary buildroot requires xbps-uchroot(1) and -O to use overlayfs # on tmpfs (available with xbps-0.45). -if [ -z "$IN_CHROOT" -a -n "$XBPS_TEMP_MASTERDIR" ]; then +if [ -z "$IN_CHROOT" -a -n "$XBPS_TEMP_BUILDROOT" ]; then export XBPS_CHROOT_CMD="uchroot" export XBPS_CHROOT_CMD_ARGS+=" -O" fi @@ -689,7 +689,7 @@ fi # if [ -z "$IN_CHROOT" ]; then # In non chroot case always prefer host tools. - export PATH="$PATH:$XBPS_MASTERDIR/usr/bin" + export PATH="$PATH:$XBPS_BUILDROOT/usr/bin" fi # @@ -760,7 +760,7 @@ case "$XBPS_TARGET" in $XBPS_LIBEXECDIR/build.sh \ base-chroot base-chroot $XBPS_TARGET || exit 1 ) || exit 1 - [ -d $XBPS_MASTERDIR ] && rm -rf $XBPS_MASTERDIR + [ -d $XBPS_BUILDROOT ] && rm -rf $XBPS_BUILDROOT install_base_chroot ${XBPS_TARGET_PKG:=$XBPS_MACHINE} ;; bootstrap-update) @@ -782,14 +782,14 @@ case "$XBPS_TARGET" in else remove_pkg_autodeps fi - msg_normal "xbps-src: cleaning up masterdir...\n" + msg_normal "xbps-src: cleaning up buildroot...\n" # Needed to remove Go Modules [ -d "$XBPS_BUILDDIR" ] && chmod -R +wX $XBPS_BUILDDIR rm -rf \ $XBPS_BUILDDIR \ $XBPS_DESTDIR - rm -rf $XBPS_MASTERDIR/tmp - mkdir -p $XBPS_MASTERDIR/tmp + rm -rf $XBPS_BUILDROOT/tmp + mkdir -p $XBPS_BUILDROOT/tmp else read_pkg if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then @@ -1007,7 +1007,7 @@ case "$XBPS_TARGET" in update_hash_cache ;; zap) - masterdir_zap + buildroot_zap ;; *) msg_red "xbps-src: invalid target $XBPS_TARGET.\n" From 6cda8239d651809aff8b95e49772264696848990 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 26 Sep 2023 03:16:39 -0400 Subject: [PATCH 2/5] xbps-src: add -A flag for host arch, create buildroot per host arch --- xbps-src | 64 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/xbps-src b/xbps-src index 33448ee1e84fe..0cbf8467654a9 100755 --- a/xbps-src +++ b/xbps-src @@ -14,14 +14,17 @@ $PROGNAME: [options] [arguments] Targets: (only one may be specified) -binary-bootstrap [arch] +binary-bootstrap Install bootstrap packages from host repositories into . - If the optional 'arch' argument is set, it will install bootstrap packages - from this architecture, and its required xbps utilities. The - will be initialized for chroot operations. + If the optional '-A ' flag is set, it will install bootstrap packages + from this architecture, and its required xbps utilities. The will + be initialized for chroot operations. bootstrap Build and install from source the bootstrap packages into . + If the optional '-A ' flag is set, it will build and install bootstrap + packages from this architecture, and its required xbps utilities. The + will be initialized for chroot operations. bootstrap-update Updates bootstrap packages with latest versions available from registered @@ -151,6 +154,13 @@ Options: -1 If dependencies of target package are missing, fail instead of building them. +-A + Use this host machine. Automatically creates masterdir- if it doesn't + already exist. Some host machines may require qemu-user-static and + binfmt-support if not natively supported by the processor. Supported hosts: + +$(print_cross_targets) + -a Cross compile packages for this target machine. Supported targets: @@ -194,7 +204,7 @@ $(print_cross_targets) -m Absolute path to a directory to be used as buildroot. The buildroot is the main directory to build/store/compile packages. - If unset defaults to void-packages/buildroot. + If unset defaults to void-packages/buildroot-. -N Disable use of remote repositories to resolve dependencies. @@ -290,19 +300,8 @@ check_native_arch() { else export XBPS_ARCH=$(xbps-uhelper arch) fi - elif [ "$XBPS_TARGET" = 'binary-bootstrap' ] && [ "$XBPS_TARGET_PKG" ]; then - # ^ special case for binary-bootstrap for e.g: - # x86_64 -> x86_64-musl - # x86_64 -> i686 - export XBPS_ARCH=$XBPS_TARGET_PKG else - LDD=$(ldd --version 2>&1|head -1) - if [[ $LDD == *musl* ]]; then - export XBPS_ARCH=${XBPS_MACHINE%-musl}-musl - else - # XBPS_ARCH == $(uname -m) - export XBPS_ARCH=$(uname -m) - fi + export XBPS_ARCH="$XBPS_MACHINE" fi } @@ -372,7 +371,7 @@ readonly XBPS_SRC_VERSION="113" export XBPS_MACHINE=$(xbps-uhelper -C /dev/null arch) XBPS_OPTIONS= -XBPS_OPTSTRING="1a:bc:CEfgGhH:iIj:Lm:No:p:qsQKr:tV" +XBPS_OPTSTRING="1A:a:bc:CEfgGhH:iIj:Lm:No:p:qsQKr:tV" # Preprocess arguments in order to allow options before and after XBPS_TARGET. eval set -- $(getopt "$XBPS_OPTSTRING" "$@"); @@ -383,6 +382,7 @@ eval set -- $(getopt "$XBPS_OPTSTRING" "$@"); while getopts "$XBPS_OPTSTRING" opt; do case $opt in 1) XBPS_ARG_BUILD_ONLY_ONE_PKG=yes; XBPS_OPTIONS+=" -1";; + A) XBPS_ARG_MACHINE="$OPTARG"; XBPS_OPTIONS+=" -A $OPTARG";; a) XBPS_ARG_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+=" -a $OPTARG";; b) XBPS_ARG_IGNORE_BROKENNESS=yes; XBPS_OPTIONS+=" -b";; c) XBPS_ARG_CONFIG="$OPTARG"; XBPS_OPTIONS+=" -c $OPTARG";; @@ -493,6 +493,7 @@ fi [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES" [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY" [ -n "$XBPS_ARG_STRICT" ] && XBPS_STRICT="$XBPS_ARG_STRICT" +[ -n "$XBPS_ARG_MACHINE" ] && XBPS_MACHINE="$XBPS_ARG_MACHINE" [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD" [ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS" [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS" @@ -527,9 +528,14 @@ if [ -z "$IN_CHROOT" -a "$UID" -eq 0 -a -z "$XBPS_ALLOW_CHROOT_BREAKOUT" ]; then exit 1 fi -# if XBPS_BUILDROOT unset, defaults to $XBPS_DISTDIR/buildroot. -: ${XBPS_BUILDROOT:=$XBPS_DISTDIR/buildroot} -[ ! -d $XBPS_BUILDROOT ] && mkdir -p $XBPS_BUILDROOT +# if XBPS_BUILDROOT unset, defaults to $XBPS_DISTDIR/buildroot- +# unless in a container for simplicity of container/CI usage +if [ "$XBPS_CHROOT_CMD" = ethereal ]; then + : "${XBPS_BUILDROOT:=$XBPS_DISTDIR/buildroot}" +else + : "${XBPS_BUILDROOT:=$XBPS_DISTDIR/buildroot-$XBPS_MACHINE}" +fi +[ ! -d "$XBPS_BUILDROOT" ] && mkdir -p "$XBPS_BUILDROOT" # if XBPS_HOSTDIR unset, defaults to $XBPS_DISTDIR/hostdir. : ${XBPS_HOSTDIR:=$XBPS_DISTDIR/hostdir} @@ -617,10 +623,10 @@ if [ -z "$XBPS_REINIT" -a -s $XBPS_BUILDROOT/.xbps_chroot_init ]; then linux32 xbps-reconfigure -r ${XBPS_BUILDROOT} -a &>/dev/null # reexec itself via linux32 export XBPS_REINIT=1 - exec linux32 $0 ${XBPS_OPTIONS} $@ + exec linux32 $0 ${XBPS_OPTIONS} "$@" fi fi -if [ "$XBPS_ARCH" ]; then +if [ -n "$XBPS_ARCH" ]; then export XBPS_MACHINE=$XBPS_ARCH fi # At this point if XBPS_TARGET_MACHINE isn't defined we assume @@ -743,13 +749,21 @@ reconfigure_base_chroot # case "$XBPS_TARGET" in binary-bootstrap) - install_base_chroot ${XBPS_TARGET_PKG:=$XBPS_MACHINE} + if [ -n "$XBPS_TARGET_PKG" ]; then + msg_error "xbps-src: binary-bootstrap is no longer supported, use '-A ' instead\n" + exit 1 + fi + install_base_chroot "$XBPS_MACHINE" ;; bootstrap) if [ -n "$XBPS_CHECK_PKGS" ]; then msg_error "xbps-src: disable tests for bootstrap\n" exit 1 fi + if [ -n "$XBPS_TARGET_PKG" ]; then + msg_error "xbps-src: bootstrap is no longer supported, use '-A ' instead\n" + exit 1 + fi # base-chroot building on host # check for required host utils check_reqhost_utils bootstrap @@ -761,7 +775,7 @@ case "$XBPS_TARGET" in base-chroot base-chroot $XBPS_TARGET || exit 1 ) || exit 1 [ -d $XBPS_BUILDROOT ] && rm -rf $XBPS_BUILDROOT - install_base_chroot ${XBPS_TARGET_PKG:=$XBPS_MACHINE} + install_base_chroot "$XBPS_MACHINE" ;; bootstrap-update) if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then From be1b9d5a14ddbd67db8f3392f48added9c39050b Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 17 Jan 2024 01:31:50 -0500 Subject: [PATCH 3/5] README.md: update documentation for new buildroot creation also a file that references a bunch of old args --- README.md | 17 +++++++++-------- .../files/generating-distfiles.md | 16 ++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3245d1adf6901..7f52d7d0c7b7e 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ The following directory hierarchy is used with a default configuration file: | |- repocache ... | |- sources ... | - |- buildroot + |- buildroot- | |- builddir -> ... | |- destdir -> ... | |- host -> bind mounted from @@ -226,7 +226,7 @@ The following directory hierarchy is used with a default configuration file: The description of these directories is as follows: - - `buildroot`: master directory to be used as rootfs to build/install packages. + - `buildroot-`: directory to be used as rootfs to build/install packages. - `builddir`: to unpack package source tarballs and where packages are built. - `destdir`: to install packages, aka **fake destdir**. - `hostdir/ccache`: to store ccache data if the `XBPS_CCACHE` option is enabled. @@ -450,7 +450,7 @@ and `xbps-src` should be fully functional; just start the `bootstrap` process, i $ ./xbps-src binary-bootstrap -The default buildroot is created in the current working directory, i.e `void-packages/buildroot`. +The default buildroot is created in the current working directory, i.e. `void-packages/buildroot-`, where `` for the default buildroot is is the native xbps architecture. ### Remaking the buildroot @@ -477,20 +477,21 @@ Two ways are available to build 32bit packages on x86\_64: The canonical mode (native) needs a new x86 `buildroot`: - $ ./xbps-src -m buildroot-x86 binary-bootstrap i686 - $ ./xbps-src -m buildroot-x86 ... + $ ./xbps-src -A i686 binary-bootstrap + $ ./xbps-src -A i686 ... ### Building packages natively for the musl C library -Canonical way of building packages for same architecture but different C library is through dedicated buildroot. +The canonical way of building packages for same architecture but different C library is through a dedicated buildroot by using the host architecture flag `-A`. To build for x86_64-musl on glibc x86_64 system, prepare a new buildroot with the musl packages: - $ ./xbps-src -m buildroot-x86_64-musl binary-bootstrap x86_64-musl + $ ./xbps-src -A x86_64-musl binary-bootstrap +This will create and bootstrap a new buildroot called `buildroot-x86_64-musl` that will be used when `-A x86_64-musl` is specified. Your new buildroot is now ready to build packages natively for the musl C library: - $ ./xbps-src -m buildroot-x86_64-musl pkg ... + $ ./xbps-src -A x86_64-musl pkg ... ### Building void base-system from scratch diff --git a/srcpkgs/rust-bootstrap/files/generating-distfiles.md b/srcpkgs/rust-bootstrap/files/generating-distfiles.md index 572ed716ae35e..e97615d46bd86 100644 --- a/srcpkgs/rust-bootstrap/files/generating-distfiles.md +++ b/srcpkgs/rust-bootstrap/files/generating-distfiles.md @@ -17,8 +17,8 @@ appropriate sections. First, we bootstrap our buildroots. We need both a glibc one and a musl one: ``` -$ ./xbps-src -m buildroot-glibc binary-bootstrap x86_64 -$ ./xbps-src -m buildroot-musl binary-bootstrap x86_64-musl +$ ./xbps-src -A x86_64 binary-bootstrap +$ ./xbps-src -A x86_64-musl binary-bootstrap ``` In addition to those, we need to set up binary remotes for the ppc repos. As @@ -40,7 +40,7 @@ architecture, with both glibc and musl. Run this for both buildroots bootstrapped above ``` -$ ./xbps-src -m pkg cargo +$ ./xbps-src -A pkg cargo ``` This builds `rust-bootstrap`, `cargo-bootstrap`, `rust` and `cargo` for your @@ -52,13 +52,13 @@ Now that we have the our native architecture covered, we cross build for the architectures we need to generate distfiles for: ``` -$ ./xbps-src -m -a pkg -o bindist rust -$ ./xbps-src -m -a pkg rust -$ ./xbps-src -m -a pkg -o bindist cargo +$ ./xbps-src -A -a pkg -o bindist rust +$ ./xbps-src -A -a pkg rust +$ ./xbps-src -A -a pkg -o bindist cargo ``` -Repeat these three steps for `buildroot-glibc` with `ppc`, `buildroot-musl` with -`ppc64le-musl` and `buildroot-glibc` with `ppc64`. In the case of `ppc`, you can +Repeat these three steps for `-A x86_64` with `ppc` and `ppc64`, and for +`-A x86_64-musl` with `ppc64le-musl`. In the case of `ppc`, you can skip the `bindist` build for rust, as we are taking those from upstream. Now that we have run those commands, the generated distfiles are available in From a89cf835e57eb391d694fe6ec606963208e42ebb Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 17 Jan 2024 00:39:59 -0500 Subject: [PATCH 4/5] xbps-src: rename -m to -B, but leave it as an alias --- xbps-src | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xbps-src b/xbps-src index 0cbf8467654a9..6b42dcfe54e91 100755 --- a/xbps-src +++ b/xbps-src @@ -166,6 +166,11 @@ $(print_cross_targets) $(print_cross_targets) +-B + Absolute path to a directory to be used as buildroot. + The buildroot is the main directory to build/store/compile packages. + If unset defaults to void-packages/buildroot-. + -b Build packages even if marked as broken, nocross, or excluded with archs. -c @@ -201,10 +206,7 @@ $(print_cross_targets) -L Disable ASCII colors. --m - Absolute path to a directory to be used as buildroot. - The buildroot is the main directory to build/store/compile packages. - If unset defaults to void-packages/buildroot-. +-m Legacy alias for -B. -N Disable use of remote repositories to resolve dependencies. @@ -371,7 +373,7 @@ readonly XBPS_SRC_VERSION="113" export XBPS_MACHINE=$(xbps-uhelper -C /dev/null arch) XBPS_OPTIONS= -XBPS_OPTSTRING="1A:a:bc:CEfgGhH:iIj:Lm:No:p:qsQKr:tV" +XBPS_OPTSTRING="1A:a:B:bc:CEfgGhH:iIj:Lm:No:p:qsQKr:tV" # Preprocess arguments in order to allow options before and after XBPS_TARGET. eval set -- $(getopt "$XBPS_OPTSTRING" "$@"); @@ -384,6 +386,7 @@ while getopts "$XBPS_OPTSTRING" opt; do 1) XBPS_ARG_BUILD_ONLY_ONE_PKG=yes; XBPS_OPTIONS+=" -1";; A) XBPS_ARG_MACHINE="$OPTARG"; XBPS_OPTIONS+=" -A $OPTARG";; a) XBPS_ARG_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+=" -a $OPTARG";; + B) XBPS_ARG_BUILDROOT="$OPTARG"; XBPS_OPTIONS+=" -B $OPTARG";; b) XBPS_ARG_IGNORE_BROKENNESS=yes; XBPS_OPTIONS+=" -b";; c) XBPS_ARG_CONFIG="$OPTARG"; XBPS_OPTIONS+=" -c $OPTARG";; C) XBPS_ARG_KEEP_ALL=1; XBPS_OPTIONS+=" -C";; @@ -397,7 +400,7 @@ while getopts "$XBPS_OPTSTRING" opt; do I) XBPS_ARG_SKIP_DEPS=1; XBPS_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -I -N";; j) XBPS_ARG_MAKEJOBS="$OPTARG"; XBPS_OPTIONS+=" -j $OPTARG";; L) export NOCOLORS=1; XBPS_OPTIONS+=" -L";; - m) XBPS_ARG_BUILDROOT="$OPTARG"; XBPS_OPTIONS+=" -m $OPTARG";; + m) XBPS_ARG_BUILDROOT="$OPTARG"; XBPS_OPTIONS+=" -B $OPTARG";; # legacy alias for -B N) XBPS_ARG_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -N";; o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";; p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";; From 1a0ee3b785f1058966f8c047ee6afdbdbb642b42 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 26 Sep 2023 03:18:01 -0400 Subject: [PATCH 5/5] xbps: patch xbps-src completions for -A and -B --- srcpkgs/xbps/patches/xbps-src-comp.patch | 62 ++++++++++++++++++++++++ srcpkgs/xbps/template | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xbps/patches/xbps-src-comp.patch diff --git a/srcpkgs/xbps/patches/xbps-src-comp.patch b/srcpkgs/xbps/patches/xbps-src-comp.patch new file mode 100644 index 0000000000000..3c0009e922f70 --- /dev/null +++ b/srcpkgs/xbps/patches/xbps-src-comp.patch @@ -0,0 +1,62 @@ +diff --git a/data/_xbps_src b/data/_xbps_src +index 43b5f704..63fd2f31 100644 +--- a/data/_xbps_src ++++ b/data/_xbps_src +@@ -6,7 +6,7 @@ local ret=0 archs top + + archs=(aarch64-musl aarch64 armv5te-musl armv5te armv5tel-musl armv5tel armv6hf-musl armv6hf armv6l-musl armv6l armv7hf-musl armv7hf armv7l-musl armv7l i686-musl i686 mips-musl mipsel-musl mipselhf-musl mipshf-musl ppc-musl ppc ppc64-musl ppc64 ppc64le-musl ppc64le x86_64-musl) + +-# path to masterdir and srcpkgs. ++# path to buildroot and srcpkgs. + top=$~_comp_command1:h + + _xbps_src_all_packages() { +@@ -15,18 +15,21 @@ _xbps_src_all_packages() { + + _xbps_src_destdir_packages() { + local -a dirs +- dirs=( $top/masterdir/destdir/*~[^-]#-linux-[^-]#(N/) ) ++ dirs=( $top/buildroot/destdir/*~[^-]#-linux-[^-]#(N/) ) + compadd "$@" -- ${${dirs:t}%-*} + } + + _xbps_src_build_packages() { + local -a dirs +- dirs=( $top/masterdir/builddir/*~[^-]#-linux-[^-]#(N/) ) ++ dirs=( $top/buildroot/builddir/*~[^-]#-linux-[^-]#(N/) ) + compadd "$@" -- ${${dirs:t}%-*} + } + + _arguments -s : \ ++ '-A[Host architecture]:architecture:($archs)' \ + '-a[Cross compile packages]:architecture:($archs)' \ ++ '-B[Absolute path to buildroot]:buildroot:_files -/' \ ++ '-b[Build broken, nocross, or excluded packages]' \ + '-C[Do not remove build directory/autodeps/destdir]' \ + '-E[Exit immediately when binary package already exists]' \ + '-f[Force building and registering binary packages]' \ +@@ -38,12 +41,11 @@ _arguments -s : \ + '-I[Ignore required dependencies]' \ + '-j[Number of parallel build jobs]:number: ' \ + '-L[Disable ASCII colors]' \ +- '-m[Absolute path to masterdir]:masterdir:_files -/' \ + '-N[Disable use of remote repositories]' \ + '-o[Set package build options]:options: ' \ + '-q[Suppress output of xbps-src]' \ + '-r[Use alternative local repository]:repo:_files -/' \ +- '-t[Create a temporary masterdir]' \ ++ '-t[Create a temporary buildroot]' \ + '1:target:->target' \ + '*::args:->args' && ret=0 + +@@ -64,9 +66,7 @@ case $state in + case $words[1] in + build|check|configure|extract|fetch|install|patch|pkg|show|show-avail|show-build-deps|show-hostmakedepends|show-makedepends|show-options|update-check) + _arguments ':package:_xbps_src_all_packages' && ret=0;; +- binary-bootstrap) +- _arguments '::architecture:($archs)' && ret=0;; +- bootstrap|bootstrap-update|chroot|clean-repocache|consistency-check|list|purge-distfiles|remove-autodeps|show-repo-updates|show-sys-updates|update-bulk|update-sys|update-hash-cache) ++ binary-bootstrap|bootstrap|bootstrap-update|chroot|clean-repocache|consistency-check|list|purge-distfiles|remove-autodeps|show-repo-updates|show-sys-updates|update-bulk|update-sys|update-hash-cache) + # no further arguments + ret=0;; + clean) diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 5b34b331d58da..060a70563aeb7 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.59.2 -revision=1 +revision=2 bootstrap=yes build_style=configure short_desc="XBPS package system utilities"