flatpak
flatpak copied to clipboard
supporting local path in --extra-data
I'm using flatpak to run various games using the linux installers from GOG. These installers can sometimes be quite large, and seem to be a good use case for the extra-data option.
However, extra-data currently only supports http(s) addresses, and these installers are not freely available for download. Being able to refer to local paths would make it possible to use flatpak to run these games without having to keep a full copy of the game in the (possibly local) repository.
I don't see how you could use these outside your own machine though. That doesn't seem very useful.
This is probably overkill for a limited use-case. But flatpak could expose a way for users to select local data.
Any plans to revisit this now, when i386 multiarch extension has been added? I would love to get rid of these packages shipped by my distro, but I need it for games from Humble Bundle/GOG stores.
The extra-data files are downloaded to BASE_DIR/extra-data/SHASUM/
And flatpak will skip the download if the file is already there.
So you can just put the file there inside a directory with the corresponding checksum. In my case BASE_DIR is ~/.local/share/flatpak/
Is there any problem with adding this feature? I thinks it's critical - how else we could supply extra-data at install time which is not accessible over http? It's crucial functionality for various open-source installers for proprietary software, such as mentioned GOG games. As such, the installers themselves could be published on Flathub or other repositories, but they would be useless without this feature. Besides the trick @manuq provided (thinks for this!), I see two possibilities, neither of which work for now:
- add
pathproperty for "extra-data" type - add "extra-data" source support for --extra-sources=SOURCE-DIR option:
When downloading sources (archives, files, git, bzr, svn), look in this directory for pre-existing copies and use them instead of downloading.
I use python3 -m http.server to ease testing of apply-extra, when the extra-data is too large or original source is too slow.
Unfortunately, right now absence of this feature prevents my flatpak to be accepted: https://github.com/flathub/flathub/pull/994#issuecomment-492452901. This is very sad for me because I put much efforts into this. So I'm asking devs, please, consider to implement this feature. @manuq
Seems the restriction with http uris only in --extra-data was done intentionally due security reasons: https://github.com/flatpak/flatpak/blob/2b939282859143b0a86beed90574a791e877d4e1/common/flatpak-dir.c#L4798
I wonder if we could softening it by allowing file URIs with only certain dirs here, e.g XDG_DOWNLOAD_DIR?
@bam80: I agree with @TingPing on user experience. Rather, it is about adding a specific filesystem permission to an app, at least if it cannot work with the document portal. This seems to be more of a portal thing. There is already a discussion about this: https://github.com/flatpak/xdg-desktop-portal/discussions/1405.