I am at a complete loss on how makepkg passes through variables and functions into the fakeroot environment. I've looked at makepkg and the line that seems to show how it's done makes no sense to me:
fakeroot -- bash -$- "${BASH_SOURCE[0]}" -F "${ARGLIST[@]}" || exit $?