Created attachment 481122 [details] portmidi-217-r1-build.log The part of CMake scripts in the current (and at the moment only) ebuild of media-libs/portmidi that is responsible for the building of Java bindings is incompatible with Ninja; please see the attached build log for details. The bindings do build fine when CMAKE_MAKEFILE_GENERATOR="emake", and with USE="-java" Ninja works fine. I haven't reported this upstream yet because at a glance, it seems the problem has been introduced by Gentoo patches.
Current ebuild works around this by forcing the use of emake.
I'd consider that a workaround, not a fix, but hey. The cmake patch to that package is indeed rather huge, contains no header and was probably never attempted to be sent upstream?