Half cherry pick from master. Drop pkgconf requirement.