trying to emulate build phase script from pre_install hook