More convenient than installing to
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX on device. This will work for
termux_step_post_make_install functions running
`install <program> $TERMUX_PREFIX/bin/`
or similar, but might not for functions running
`make something`
as the Makefile in this latter case might contain a hardcoded
/data/data/com.termux/files/usr/.
If `make something` is done, then it needs to be run as
`termux-build-chroot make something`
instead.
Do this using the termux-build-chroot script. Some tools are necessary
during `make install`. For an autoconf program these are typically
mkdir, sed, grep, install, and their paths are hardcoded into the
Makefil. Therefore symlink these into the new $PREFIX before running
`make install`, so that they can be found if necessary,
Makes it possible to `make` packages as normal and then `make install`
into an empty $PREFIX in $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX. The
installed files can then be packaged into a deb as when
cross-compiling.
`termux-build-chroot` so far has some drawbacks: packages that
override termux_step_make_install or termux_step_post_make_install
will not be possible to build on device unless the overriding function
is changed to add `termux-build-chroot` to the commands that install
files. This could be solved more conveniently by making it possible to
run a bash function from (like termux_step_make_install) from proot,
but this probably requires some changes to proot.