-
Notifications
You must be signed in to change notification settings - Fork 31
486 add linux to flat hub #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Excited to see this release 🎉 |
org.asgardex.desktop.yml
Outdated
@@ -0,0 +1,29 @@ | |||
id: org.asgardex.desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the application ID be something like com.asgardex.asgardex-desktop
? asgardex.com is the project's domain, and the Flathub rules also say not to end an ID with .desktop
.
https://docs.flathub.org/docs/for-app-authors/requirements#application-id
- The ID must not end in generic terms like
.desktop
or.app
. It's fine to repeat the application name in such cases.
https://docs.flathub.org/docs/for-app-authors/requirements#control-over-domain-or-repository
- The domain must be directly related to the project or the application being submitted and the author or the developer or the project must have control over the domain. The corresponding URL must be reachable over HTTP(S).
com.asgardex.asgardex-desktop.yml
Outdated
@@ -0,0 +1,29 @@ | |||
id: com.asgardex.asgardex-desktop | |||
runtime: org.freedesktop.Platform | |||
runtime-version: '22.08' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
org.freedesktop.Platform
only has 'a maintenance period of two years.' 22.08 is already EOL.
https://docs.flatpak.org/en/latest/available-runtimes.html#freedesktop
https://freedesktop-sdk.gitlab.io/documentation/updating-sdk/release-notes/
com.asgardex.asgardex-desktop.yml
Outdated
- name: electron-dependencies | ||
buildsystem: simple | ||
build-commands: | ||
- npm install -g [email protected] | ||
- cp -R $(npm root -g)/electron /app/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of redundantly installing and bundling Electron, is it possible to just use the already-packaged Electron BaseApp, with the steps outlined here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah definitely
com.asgardex.asgardex-desktop.yml
Outdated
- --device=dri | ||
- --socket=pulseaudio | ||
- --share=network | ||
- --filesystem=home |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's actually no reason this needs read/write access to the whole home directory, is there? All user-imported files just go through the file picker portal, right?
https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access
Since flatpak gives the sandboxed app its own $XDG_CONFIG_HOME
, if Electron uses $XDG_CONFIG_HOME
to determine the appData directory, everything should just work without any permissions or code changes at all: STORAGE_DIR will end up as ~/.var/app/com.asgardex.asgardex-desktop/config/ASGARDEX/storage/
.
https://www.electronjs.org/docs/latest/api/app#appgetpathname
asgardex-desktop/src/main/api/const.ts
Lines 7 to 8 in 74c1ddf
export const APP_DATA_DIR = path.join(app?.getPath('appData') ?? './testdata', APP_NAME) | |
export const STORAGE_DIR = path.join(APP_DATA_DIR, 'storage') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are more than welcome to help get this PR completed. As displayed this is not my area of expertise 😮💨.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would but I only have read-only permissions here 😅
Just deleting the entire --filesystem=home
line should be fine though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an issue with dependencies: the line that runs yarn install --immutable
looks like it fails in the Fetch step, because in the build sandbox there is no network access. The only way to download dependencies is to declaratively specify them as sources, which get downloaded before the build sandbox runs.
Other projects like yarn-flatpak-demo and DOS Browser additionally make use of the obsolete yarn --offline
option and the yarn-offline-mirror
config. But their repos use Yarn Classic, while Asgardex uses Yarn Modern, which removed those, so copying the same solution wouldn't work here.
(YARN_ENABLE_OFFLINE_MODE=1 looks like it might be relevant? But it doesn't solve the problem.)
The right solution is probably using a tool called flatpak-node-generator
to pin all the dependencies, which get specified as 'sources' in the syntax that flatpak understands (generated-sources.json
), so that flatpak-builder
will simply download all your dependencies beforehand.
Looking into it, combining Yarn & flatpak is actually currently hard to do 'the right way,' building from source, because the existing tooling only supports Yarn Classic (Yarn 1). There's been a PR open since 2021 that'll add support for Yarn 2 and Yarn 3, but even it doesn't add support for Yarn 4 (what asgardex currently uses): flatpak/flatpak-builder-tools#252 (comment) The workaround would be to have flatpak download already-built .js/.css bundles, copy them where the Electron BaseApp will run them, and skip any real build process entirely (for now). |
Co-authored-by: dynst <[email protected]>
Co-authored-by: dynst <[email protected]>
Co-authored-by: dynst <[email protected]>
No description provided.