How to provide binaries for both aarch64 (Arm64) and x86_64 ("Regular 64 bit")?

I’m maintaining a Flatpak that installs a binary, so it simply downloads the x86_64 binary and has flathub.json specify "only-arches": ["x86_64"]. Recently upstream started making arm64 binaries I want to distribute on Flatpak as well, but I don’t know how. Any general documentation/guidance on how to do this? I know I can set env vars depending on the arch, like

build-options": {
  "arch": {
    "aarch64": {
      "env" : {
        "RUNTIME": "linux-arm64"
      }
    },
    "x86_64": {
      "env" : {
        "RUNTIME": "linux-x64"
      }
    }
  }
}

But I don’t know how to only download one of the binary sources depending on that. Or should I download both sources anyways? Not sure, that’s why I’m here :smiley:

1 Like

Figured out some good stuff:

  • You can specify which source is downloaded depending on the arch
  • Combining this with dest-filename lets everything be handled easily

Relevant code changes to get what I wanted: Merge pull request #8 from flathub/armbinaries · flathub/org._2009scape.Launcher@d819ad9 · GitHub

Assuming this doesn’t go against some standard/best practices, I think it’s the best solution

Edit: Flathub staff set this to the question answer, so that seems to be it :smiley: