Move variable assignments into configure_package() if the assignments depend on variables initialised after the package is sourced, ie. $PKG_BUILD, $PKG_SOURCE_NAME etc.