metadata: fix handling of multiple build dependencies with different conditions