It seems I've forgot some quotes in pre-inst-env.in on line 10.
Other than that, you'll also need the (sdl2 mixer) module, which in turn needs SDL2_mixer. Similarly (sdl2 ttf) needs SDL2_ttf. Not sure which Ubuntu packages this maps to, but make sure you have them.