meson doesn't have support for doing this, so use Python and just the stdlib to find files under XDG_DATA_DIRS and XDG_DATA_HOME.