Added support for applying patches to new build system