How do you "-cp" folders in a manifest file?

Maybe I’m asking the wrong question here, but the ares (emulator) flatpak: GitHub - flathub/dev.ares.ares currently does not copy over two folders from ares, a “Shaders” and a “Database” folder.

These are fairly important folders so I was trying to look into how to fix it but I wasn’t able to come up with anything conclusive.

The aur package for ares is able to solve this issue by using both a patch file and using two “-cp” lines:

Is something like what the aur package does possible for the manifest or any ideas on how to properly copy the “Shaders” and “Database” folders with the Flatpak?

Because it’s buildsystem: simple you can just add additional commands to build-commands of the module.

But the folders should already get copied by the build:

On Linux, running make install after compilation will copy these directories and binary into suitable locations (see desktop-ui/GNUmakefile for details). Alternatively, these directories can be copied from ares/Shaders/* and mia/Database/*.

1 Like

Thank you for the reply.

Yes, it’s odd, it does seem to copy the Shaders folder after install but it doesn’t seem to copy it to the correct place.

The below is from flatpak-builder.

mkdir -p /app/bin/
mkdir -p /app/share/applications/
mkdir -p /app/share/icons/hicolor/256x256/apps/
mkdir -p /app/share/ares/Shaders/
cp out/ares /app/bin/ares
cp -R …/ares/Shaders/* /app/share/ares/Shaders/
cp resource/ares.desktop /app/share/applications/ares.desktop
cp resource/ares.png /app/share/icons/hicolor/256x256/apps/ares.png

You can see a bit more info here on this GitHub issue: Ares missing shaders · Issue #18 · flathub/dev.ares.ares · GitHub

I’ll poke around with the build-commands though.

The folder is actually in the correct place, any files of a Flatpak application must be inside the /app-prefix.

You’ll have to use the ares-paths.patch from AUR to search in the data folder & update the application to look into /app/share/ instead /usr/share:

1 Like

Ah thank you, that makes sense!

I’ll have to see if I can figure out how to port over the ares-paths.patch file and see if I can make it work with the Flatpak, might be a bit above my skill level with this one :slight_smile: .

Try changing /usr/ in line 122 to /app/ and rebuild the flatpak

You’ll also need to register the patch in your yaml/json

  - type: patch
    path: name-of-patch.patch
1 Like

Is there any documentation or general step by step on how to create these patch files?

I’ve tried searching, but the flatpak builder documentation only mentions the purpose of patches and doesn’t go into much detail.

Patches can either be created with “diff” or “git diff”, if you don’t want to do that by hand.

So I would suggest to read the man page on that.

1 Like

Thank you everyone for being so helpful! I think I got it working now.

1 Like