in EAPI=5 you can simply do the patching in src_prepare().