sudo pacman -Syu devtools
Create a directory in which the chroot will reside:
mkdir ~/chroot
Define the CHROOT environment variable:
echo "CHROOT=$HOME/chroot" >> ~/.bashrc
Create the chroot (the sub directory root is required because the $CHROOT directory will get other sub directories for clean working copies):
mkarchroot $CHROOT/root base-devel
Edit ~/.makepkg.conf to set the packager name and any makeflags:
Adjust the mirrorlist in $CHROOT/root/etc/pacman.d/mirrorlist:
WIP
Enable the testing repositories in $CHROOT/root/etc/pacman.conf:
WIP
Make sure the base chroot ($CHROOT/root) is up to date:
arch-nspawn $CHROOT/root pacman -Syu
Build the package by calling makechrootpkg in the directory containing its PKGBUILD:
makechrootpkg -c -r $CHROOT package_name