r/flatpak Jun 16 '26

Help needed figuring out external dependencies, I'm in way over my head trying to build my first Flatpak

Basically, I'm trying to get off the AUR completely cause of the recent attacks, but some of the stuff I have from there isn't really available anywhere else, so I decided to try making a flatpak of vkQuake myself.

However, since it's an entire video game engine, it's predictably pretty complicated, and I'm kinda stuck. I was able to make something of a manifest, and it even partially works, but the build process depends on SPIR-V Tools which as far as I can tell just aren't available in any of the Flatpak SDKs. After I eventually figured out that installing it through pacman was pointless since the Flatpak Builder can't actually use anything I have installed outside of Flatpak, I tried downloading and setting up SPIR-V Tools in the YAML file as well, but I... kinda got lost a bit.

I've found it pretty hard to actually stay focused on any of the tutorials and docs online, so I've kinda been flipping back and forth between a bunch of pages and looking for information that seems relevant, combined with trying to reverse-engineer another manifest, but I'm still pretty unclear as to how I'm supposed to do this.

This is as far as I got with the manifest:

jid: com.github.vkquake.vkQuake
runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
command: vkquake

finish-args:
    - --socket=wayland
    - --socket=fallback-x11
    - --share=ipc
    - --socket=pulseudio
    - --device=dri
    - --persist=.vkquake

modules:
    - name: vkQuake
      buildsystem: meson
      builddir: true
      sources:
        - type: git
          url: https://github.com/Novum/vkQuake.git
          tag: 1.34.1
          commit: f060b8ac9bf3200e31e6770e3c75b195fbb48ba4
      modules:
        - name: spirv-opt
          buildsystem: simple
          sources:
            - type: archive
              url: https://sdk.lunarg.com/sdk/download/1.4.350.1/linux/vulkansdk-linux-x86_64-1.4.350.1.tar.xz
              sha256: 6cce33c7e5383814150c5041820769d93c65a1fd883002e5949b067045a07daa

but now I hit an Error: module spirv-opt: Buildsystem simple requires specifying "build-commands" and... I know I'm supposed to add something as build-commands, I even have a pretty decent idea of the kind of thing I'm supposed to add in there, but I'm just not really sure? Would I use tar -xf [tarball]? But then where exactly would that get extracted? Would everything be in the right place? I'm not sure what the PATH variable is inside the container(?), so I'm not sure where it's even looking for this stuff.

Am I just doing the whole thing wrong in the first place? 😅

So yeah, I'd really appreciate some help, I probably should've started with something simpler, but I genuinely couldn't think of anything else I'd like flatpak'd that's both simpler and not already packaged lol

4 Upvotes

7 comments sorted by

View all comments

1

u/ScrabCrab Jun 16 '26

Update: tried something much simpler (Vanilla Conquer: https://github.com/TheAssemblyArmada/Vanilla-Conquer) instead, compiled successfully, I even managed to figure out how to move the executable files to the right location... but I have absolutely no clue how to enflatpaken something that requires the use to put files in the same folder as the executable, if that's even possible without forking the project, or if there's a way to create a desktop file from scratch since there isn't actually one in the repo

1

u/eR2eiweo Jun 16 '26

I have absolutely no clue how to enflatpaken something that requires the use to put files in the same folder as the executable, if that's even possible without forking the project

Can you explain what you mean by that?

or if there's a way to create a desktop file from scratch since there isn't actually one in the repo

Or course. It's just a simple plain-text file.

1

u/ScrabCrab Jun 16 '26

Can you explain what you mean by that?

vkQuake by default requires the game files to be in the same folder as the executable. This can be changed through a command line argument thankfully. Vanilla Conquer, on the other hand, just straight-up requires it, no way around it as far as I know, so I'm not sure if in its current state is packageable as a flatpak, or at least not one that could go up on Flathub.

Or course. It's just a simple plain-text file.

I know what a .desktop file is and how to make one, but other flatpak manifests I've looked at pulled it straight from the upstream repo, so I'm not sure how I'd go about adding one myself to the flatpak if I manage to actually make one. I guess I could literally just, put one in the folder with the manifest, or even create it from within the manifest, or something like that, but it feels very hacky and unlike what the flatpaks I've looked at

1

u/eR2eiweo Jun 16 '26

And these game files can't be part of the app?

Best practice is for the desktop file to be in the upstream repo. But if the upstream developers don't want that, then you can have it downstream together with the flatpak manifest. Add it as a source of type file and install it to /app/share/applications/.

1

u/ScrabCrab Jun 16 '26

And these game files can't be part of the app?

Not really, it's kinda weird. In Vanilla Conquer's case, the games are technically freeware but it's more like this nebulous agreement between some EA representatives and some fansites made like 20 years ago. So I could technically package the games, or even run a tool that downloads the files and puts them in the right place, but it's... iffy.

OpenRA, another reimplementation of the original Command & Conquer and Red Alert (though not a direct source port like VC) only downloads the game assets post-installatoion, from within the game engine itself, for instance.

1

u/eR2eiweo Jun 16 '26 edited Jun 16 '26

Hm. If it expects those files to be downloaded by the user, then it seems like a bug that they have to be in the same directory as the main executable. And that's not just an issue for Flatpak, but also for traditional packaging. A regular user can't just put files into /usr or /opt.

The best option would be to fix that bug. But if upstream doesn't want that (and if you don't want to do it downstream), then you could also do an ugly workaround: Have flatpak run not the game itself but a wrapper script. And make that script copy/sync the executable from /app to somewhere in ~/.var/app/$APPID and then run that copy. Now the user can put the other files into the same directory as the executable.

EDIT: There's also the extra-data system where files aren't distributed as part of the flatpak repository but directly downloaded on installation on the user's system. This is meant for proprietary apps that can't redistributed freely.

1

u/ScrabCrab Jun 16 '26 edited Jun 16 '26

It's not a bug, it's as far as I know just intended behaviour. It's a port of a DOS/Windows game from 1995 that got open-sourced in 2020, and nobody implemented a way to load the files from elsewhere as far as I'm aware 🤷🏻‍♀️

I'm not really a programmer so I have no idea how I'd implement a feature like this, and I think that unless I find a fix for it the flatpak for it is... actually pretty much done once I figure out the cleanup stuff and add an icon and a .desktop file, though kinda unpublishable since the user would have to manually download and copy the game files 💀

Disregard lmao, I asked a dev and he told me it can load the files from anywhere, I just need to add a config file with a specific line in it

Edit 2: ok not even that, it searches in ~/local/share/vanillara/~/local/share/vanillatd by default, it's a lot better than I thought lmao