The HaikuPorter tool is provided to ease the fetching, patching and building of source code. It can be compared to a slim version of Gentoo Portage. Each port contains the Haiku-specific patches to the original source code. It fetches the original source code, applies the Haiku-specific patches, builds the software, and packages it according to so-called 'recipes'.
See the wiki on the HaikuPorter website for more information on its usage and details on how to create those recipes.