Okay, it turns out my previous patch was very wrong. I tried to start a build and it broke pretty significantly. I've attached a new patch that at least starts building. My computer takes too long to actually build anything, but I'm slightly more confident that my change won't break everything.