Netsurf and all of its dependencies run, source /usr/share/netsurf-buildsystem/gentoo-helpers.sh at build time. (That file is installed by dev-util/netsurf-buildsystem). This is a violation of https://projects.gentoo.org/qa/policy-guide/ebuild-format.html#pg0102 which says The ebuild code must be fully contained within .ebuild and .eclass files. It is forbidden to load additional ebuild code from other files via source, eval or any other possible method. The code from that file should be moved into an eclass.
Fixed after a major effort by Lukas Vacek. Thanks!