Since there's no upstream for this and we require changes made to it for portability reasons, let's make an upstream ourselves.