This is lightly adapted from the implementation in Higan. For more information, see that PR in higan-emu/higan#118. The main difference is that we only compile one binary here, and packaging is similar to (but adapted from) packaging byuu.