Project data files

I’m working to create a flatpak manifest for dosbox-x, but am running into a problem with some additional data files that the application needs.
The data files are in the tar.gz archive and I am trying to copy them to the right location in post-install using the install command.

My understanding is that the correct location for $XDG_DATA_HOME when running is /var/data which in this case is the same as ~/.var/app/com.dosbox_x.DOSBox-X/data

post-install:
  - install -Dm644 contrib/fonts/FREEC98.BMP /var/data
  - mkdir -p /var/data/glshaders
  - install -Dm644 contrib/glshaders/*.glsl /var/data/glshaders

But the first install in the above example will already fail with a
install: target '/var/data' is not a directory: No such file or directory

But if I open a shell inside the flatpak, I can see that /var/data does exist, and I can create files there.

Likewise if I comment out the first install, the mkdir does not return any error, but afterwards the directory does not exist and the next install command will likewise fail.