reuse command for building libraries; warn on failed packages

put the build & install line, which had been mostly copied and pasted, into a function
add some vertical whitespace and an error when packages fail to build

we don't want to break on packages failing, because some (gitgist) are difficult
but neither do we want those messages completely buried (i had no idea gitgist was failing)