Related to 'configflags' … has non-unique elements, trying out the qt58 part, the build complains:
ERROR: No value supplied to command line option 'prefix'.
And indeed, the arguments passed by snapcraft include -prefix=:
Command '[..., '--prefix=', ...]' returned non-zero exit status 3
This is using the autotools plugin, but I’ve also seen an empty -DCMAKE_INSTALL_PREFIX with the cmake plugin:
cmake .../src -DCMAKE_INSTALL_PREFIX=