Skip to content
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

add upstream distribution sources for linux + flatpak package #559

Closed
wants to merge 5 commits into from

Conversation

getchoo
Copy link

@getchoo getchoo commented Aug 10, 2023

this pr adds some files good for downstream packagers of theseus, including desktop and metainfo files; a flatpak package has been created as well. this should replace the current appimage and deb packages, as it is a universal way to install apps on linux, as well as has the proper dependencies needed for not only the app, but minecraft as well (even including narrator support!)

part of #497

TODO

  • create workflows for building flatpak
  • add downstream packaging policies
    • i was thinking of making it in the README of the distribution/ folder
    • an example of this for prism can be found here
    • this could expanded to include things such as recommended descriptions, app naming (using modrinth app over theseus for example), and what exactly to include in packages (i.e., the cli component, theseus_playground, etc)
  • ensure flatpak can be properly distributed on the website
  • (optional) allow building offline
    • the rust side is already compiled offline. the issue here is with node
    • this needs to be done for the package to be accepted into flathub
    • one approach to this is using an unofficial script to strip sources from pnpm's lockfile. this has been already here, though the script is not public (thanks for pointing this out @orowith2os !)
    • another approach as mentioned on the discord is to use npm. i would rather not do this as it seems all of the maintainers here prefer pnpm, and it's only really a problem for this flatpak package - plus it could be worked around with the script mentioned above

future work

these are things not required for flathub or a working flatpak package, but should be looked into later (or maybe during this pr if we get things figured out fast :p)

  • improve metainfo
    • proper version history (or at least the current version) should be provided, most likely with an edit to the file during build time
    • screenshots should be provided for the app
  • publishing on flathub
    • this is blocked by the offline build issue as mentioned above
    • maybe we should wait for a stable release?
  • using gnome 44 sdk/runtime
    • tauri currently uses many outdated dependencies, such as webkitgtk, librsvg, and libsoup that are only available in the (out of support) gnome 42 runtime. this isn't great, but there isn't much we can do about it until tauri updates
    • see this comment. we will need to wait until tauri 2.0 releases

@getchoo getchoo marked this pull request as draft August 10, 2023 19:25
@intergrav intergrav mentioned this pull request Aug 10, 2023
@blt-r
Copy link

blt-r commented Aug 11, 2023

You shouldn't use outdated and unsupported runtime. The right way to do this is to ship libwebki2gtk-4.0. Yes, it bloats the package size, but requiring a whole runtime, which no other app uses is a lot more bloated.

here's what i've put together for a modrinth app flatpak: https://github.com/blt-r/modrinth-app-flatpak. I haven't added all the dependencies that minecraft might use, but it works.

Also, I don't think publishing to flathub is optional. Just distributing the bundle is terrible user experience, it won't even recive updates. Setting up a custom flatpak repo is better, but it requires a lot of effort, and still worse the just having it on flathub. Do you know anything about that pnpm dependency script written for flathub/flathub#3876? it seems like there was no progress since april. If there is no news on that, I still think it would be better to (at least temporarily) commit some other lockfile to the repo

@getchoo
Copy link
Author

getchoo commented Aug 11, 2023

You shouldn't use outdated and unsupported runtime. The right way to do this is to ship libwebki2gtk-4.0.

that isn't the only dependency here that isn't supported by tauri; and considering the amount of other vendored dependencies, it kinda breaks the point of using the gnome 44 runtime imo for both build times and storage space for users. sure 42 is EOL, but it's not exactly uncommon to use EOL runtimes in situations like these were the dependencies are so old - it's also completely allowed by flathub afaik.

Yes, it bloats the package size, but requiring a whole runtime, which no other app uses is a lot more bloated.

multiple packages still use 42, and others are being created with it. the elk pr you mentioned later is an example of this

Also, I don't think publishing to flathub is optional

i never intended it to be, and i don't think anyone else had this idea either. it's the reason i put under "future work," it should be the end goal here. i just think it's a good idea to get this shipped to linux users ASAP - even without auto updates as it's currently the same situation for the debs and appimages - since this package actually works and on all distros.

Setting up a custom flatpak repo is better, but it requires a lot of effort, and still worse the just having it on flathub

this could be something to look into, but honestly i doubt it will be that long until we can submit this into flathub. i don't think it would be worth the effort for something that would be very temporary

Do you know anything about that pnpm dependency script written for flathub/flathub#3876?

yes, i mentioned this in the original comment. i'm going to contact the OP soon and hopefully get a hold of the script. otherwise, like you said, another lockfile could be commited to the repository. i prefer the former, but it's up to the maintainers and the OP ofc

@blt-r
Copy link

blt-r commented Aug 11, 2023

that isn't the only dependency here that isn't supported by tauri

No, it is the only one. libwebkit2gtk-4.0.so and libwebkit2gtk-4.1.so are provided by the same package, you just need to build it with -DUSE_SOUP2=ON, to output 4.0, the rest is the same, The only two additional dependencies are libsoup-2.4 and libwebkit2gtk-4.0, it is definitely not worth it to use outdated runtime to get them.

I've looked through other tauri apps on flatpak, and most of them use gnome 44, I've seen only one which uses 42 (and also the zone.elk.Elk, but it is still a draft).

Using outdated runtime is a bad idea, also because, it won't get any security patches, and users will be exposed to all vulnerabilities in old packages.

I know the compile times take a lot of time, but you only need to do that once on your machine, and then who cares how much CI takes.

As for bundle size, I think most of the people don't have gnome 42. For most people, depending on gnome 42 will be a lot worse than having a bigger bundle size.

i never intended it to be

Oh, so "(optional) allow building offline" meant that it is optional for this PR to get merged, I see.

Also, upstream uses com.modrinth.theseus for application id (even the config folder is ~/.config/com.modrinth.theseus), So it probably should be used here as well.

@MagmaBro123
Copy link

that isn't the only dependency here that isn't supported by tauri

No, it is the only one. libwebkit2gtk-4.0.so and libwebkit2gtk-4.1.so are provided by the same package, you just need to build it with -DUSE_SOUP2=ON, to output 4.0, the rest is the same, The only two additional dependencies are libsoup-2.4 and libwebkit2gtk-4.0, it is definitely not worth it to use outdated runtime to get them.

I've looked through other tauri apps on flatpak, and most of them use gnome 44, I've seen only one which uses 42 (and also the zone.elk.Elk, but it is still a draft).

Using outdated runtime is a bad idea, also because, it won't get any security patches, and users will be exposed to all vulnerabilities in old packages.

I know the compile times take a lot of time, but you only need to do that once on your machine, and then who cares how much CI takes.

As for bundle size, I think most of the people don't have gnome 42. For most people, depending on gnome 42 will be a lot worse than having a bigger bundle size.

i never intended it to be

Oh, so "(optional) allow building offline" meant that it is optional for this PR to get merged, I see.

Also, upstream uses com.modrinth.theseus for application id (even the config folder is ~/.config/com.modrinth.theseus), So it probably should be used here as well.

@getchoo ^

@getchoo getchoo force-pushed the flatpak branch 2 times, most recently from 633aa84 to fc0b7b8 Compare August 13, 2023 10:26
@getchoo
Copy link
Author

getchoo commented Aug 18, 2023

sorry it's been a while! i ended up bumping the runtime to 44, and as expected build times in ci skyrocketed

...this would probably be ok still, however compiling webkit still causes github actions to oom (see here). i can't compile it on my machine either for the same reason, so i don't really think this is viable. i'm reverting the changes to go back to the gnome 42 runtime and when tauri is updated we can bump it to 44.

@getchoo getchoo force-pushed the flatpak branch 2 times, most recently from c54fe2a to 39f10d8 Compare August 18, 2023 21:26
@Enderteck
Copy link

Hi is a flatpak release still coming ?

I'm starting to get frustrated with the AppImage and it looks like this pr isn't getting ready. Is progress still hpenning in another issue/pr ?

@Danik1601
Copy link

Hi is a flatpak release still coming ?

I'm starting to get frustrated with the AppImage and it looks like this pr isn't getting ready. Is progress still hpenning in another issue/pr ?

AFAIK they are waiting for Tauri 2.0.

Also check out flathub/flathub#4950

@MagmaBro123
Copy link

Hi is a flatpak release still coming ?
I'm starting to get frustrated with the AppImage and it looks like this pr isn't getting ready. Is progress still hpenning in another issue/pr ?

AFAIK they are waiting for Tauri 2.0.

Also check out flathub/flathub#4950

image

@Enderteck
Copy link

Nice, good flathubbot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

8 participants