don't use tar --xform - it's not in bsd
feature-detect for sed flags across gnu/bsd

specifically, `sed -r` vs. `sed -E` for extended regexps, and different
argument patterns for `sed -i`.
sort --version-sort is not supported in bsd.

We used custom keys and the . delimiter to achieve the same effect.
Merge branch 'build.cross-platform'