trilium icon indicating copy to clipboard operation
trilium copied to clipboard

(Feature request) Flatpak

Open jergao opened this issue 3 years ago • 14 comments

Preflight Checklist

  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe feature

Have a flatpak to support most Linux distros concurrently.

Additional Information

No response

jergao avatar Nov 14 '21 02:11 jergao

Help for this issue would be appreciated!

zadam avatar Nov 14 '21 10:11 zadam

I've managed to make a working flatpak based on the documentation. Just a couple things left:

  • Include a .desktop file and a metadata file in the trilium repo (I can open a PR)
  • Submit to flathub. I can do this but I may need some help if the reviewers have some questions as I'm not familiar with trilium's code

Note: This is the first time I've made a flatpak and I'm not very familiar with building electron apps but it seems to work

pssandhu avatar Feb 20 '22 09:02 pssandhu

Hi, do you have scripts (or whatever is needed) to build flatpak in some github repo?

zadam avatar Feb 20 '22 11:02 zadam

You can find all the files here. The build commands are in the yml file. They are adapted from the trilium build scripts. Please take a look and see if anything is missing or unnecessary.

It's also worth looking at the metainfo and .desktop as they're what users will see on flathub and in software managers.

pssandhu avatar Feb 20 '22 18:02 pssandhu

Hi, awesome work! I'm not sure if you are offering to maintain the Flathub releases in the future but I would be willing to do it for each release if not (and if it's a lot for @zadam to do on each release). I already have to keep an eye out for new releases so it wouldn't be much of a burden :p

In any case, glad to see this! Finally can use this on Fedora without converting the .deb file. :D

sigaloid avatar Feb 21 '22 00:02 sigaloid

Thanks for the offer. I assumed that if no one else was going to maintain it that I would do it. I don't mind if someone else wants to or we could do it together. An extra pair of hands is always good.

Updating the flathub release shouldn't be too much work (although I appreciate that it's still extra work on top of the current releases). Basically just have to update those files I linked to. I think the exact steps will be more clear once we have the first version on there.

pssandhu avatar Feb 21 '22 20:02 pssandhu

That works as well! I'm fine with whichever. I can also test the flatpak before an update is pushed if necessary. It's going to be my daily driver from now on as there is no package currently available on Fedora, so it wouldnt be a hassle to me. You did of course make the Flatpak build files so let me know what you decide. :)

sigaloid avatar Feb 22 '22 04:02 sigaloid

Just FYI I plan to take a look at this in the near future and if this can be fully automated, flatpak could be a part of the standard release process.

zadam avatar Feb 22 '22 22:02 zadam

Any updates?

sigaloid avatar Jul 22 '22 18:07 sigaloid

No, I got stuck. Flatpak was crashing on me and I didn't get beyond that point.

zadam avatar Jul 22 '22 21:07 zadam

I successfully got it working, is there a particular error message it printed or was it just crashing outright? Once you install org.freedesktop.Sdk.Extension.node16, org.electronjs.Electron2.BaseApp, and org.freedesktop.Platform, it should be as easy as the four files in @pssandhu 's repo. Here's what I had to do:

  1. Run flatpak-node-generator npm package-lock.json from https://github.com/flatpak/flatpak-builder-tools/tree/master/node
  2. Copy the generated-sources.json into the flathub directory, replacing the existing one
  3. Update com.github.zadam.trilium.yml in the Sources section to update the tag and the commit
  4. Run flatpak-builder build-dir com.github.zadam.trilium.yml --force-clean
  5. Run flatpak-builder --user --install --force-clean build-dir com.github.zadam.trilium.yml
  6. Start it with flatpak run com.github.zadam.trilium and ensure it's working

However, the flathub service takes care of building it. All you really need to do on each release is steps 1-3 and push to a repo.

If you're okay with it, I can submit the app on your behalf

sigaloid avatar Jul 24 '22 19:07 sigaloid

TBH, I don't remember the details.

But now, I followed your guide and got it working on the first try. Not sure what's different. I will give it a second try then, thanks!

zadam avatar Jul 24 '22 22:07 zadam

Awesome, can't wait to see it! No more Fedora/alien problems :smile:

sigaloid avatar Jul 24 '22 22:07 sigaloid

FYI, flathub PR has been submitted here: https://github.com/flathub/flathub/pull/3353

zadam avatar Jul 27 '22 22:07 zadam

This can be closed: https://flathub.org/apps/details/com.github.zadam.trilium

sigaloid avatar Aug 21 '22 01:08 sigaloid

Good work everyone, I'm glad this was able to be finished. I'll be moving over to the flatpak version as well.

pssandhu avatar Aug 21 '22 13:08 pssandhu

Will FlatHub also contain future versions of Trilium Notes or only v0.57.5?

Myzel394 avatar Jan 15 '23 19:01 Myzel394

The releases are getting published to repo, but it's not getting through to the website. This happened before and the problem was on the flatpack infra side which got resolved eventually.

zadam avatar Jan 15 '23 20:01 zadam