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

Flatpak support #347

Merged
merged 8 commits into from
Feb 21, 2025
Merged

Flatpak support #347

merged 8 commits into from
Feb 21, 2025

Conversation

caesarw
Copy link
Contributor

@caesarw caesarw commented Feb 16, 2025

This pull request adds Flatpak packaging to the project (closes #184). Currently, the build works locally on my branch (which comes with fixes for desktop entry and metadata files).

Changelog

  1. Added a Flatpak manifest for the project
  2. Added a submodule to access shared components for building Flatpak package
  3. Updated the meson build file to standardize the icon installation path
  4. Updated some metadata files to include proper package name/ID with reverse DNS.

Testing

To build it locally, first install flatpak-builder, then run the builder:

flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --install builddir moe.tsuna.tsukimi.yml

This will build the package, export it to local repo in folder repo, and install it in your local Flatpak installation.

To run linter on the manifest, first install org.flatpak.Builder with Flatpak, then run the linter:

flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest moe.tsuna.tsukimi.yml

Todos

  • The project owner needs to update the web contents of the domain tsuna.moe so that it does not result in a 521. During Flathub submission process, the Flatpak manifest linter will automatically detect the accessibility of the domain name to ensure the domain name belongs to the project maintainer, and a 521 status will make it think that the domain name is not accessible.
  • (WIP) Update the current GitHub Actions workflows to push updates to Flathub manifest repo automatically (mainly for generating cargo sources). The manifest repo will automatically regenerate Cargo sources when a tag is released from the upstream.
  • There still a lot to work on the manifest file to further optimize the package (automatic version checker, update deps).

@Kosette
Copy link
Collaborator

Kosette commented Feb 17, 2025

If tsukimi.png been renamed, these should also be changed to avoid breaking.

cp $GITHUB_WORKSPACE/resources/icons/tsukimi.png share/icons/

cp $GITHUB_WORKSPACE/resources/icons/tsukimi.png share/icons/

@tsukinaha
Copy link
Owner

Thanks for your PR! Looks like Ive overlooked many things, sorry about that.

  • The project owner needs to update the web contents of the domain tsuna.moe so that it does not result in a 521. During Flathub submission process, the Flatpak manifest linter will automatically detect the accessibility of the domain name to ensure the domain name belongs to the project maintainer, and a 521 status will make it think that the domain name is not accessible.

Domain tsukimi.tsuna.moe has always been valid, but I forgot to set up the root domain resolution. Now it will redirect to the domain above.

@caesarw
Copy link
Contributor Author

caesarw commented Feb 17, 2025

Now it will redirect to the domain above.

It's showing a 404 GitHub page now.

* currently the build is working locally using a fork of upstream
@tsukinaha
Copy link
Owner

It's showing a 404 GitHub page now.

oh, there is a little issue. and now?

@caesarw caesarw closed this Feb 19, 2025
@caesarw caesarw reopened this Feb 19, 2025
@caesarw
Copy link
Contributor Author

caesarw commented Feb 19, 2025

This pull request is now considered ready for review.

The manifest repo is hosted at: https://github.com/caesarw/flathub/tree/tsukimi-submission. To run a test build locally before merging, you need to do the following:

  1. Clone the manifest and its submodules.

  2. In moe.tsuna.tsukimi.yml, replace:

        sources:
          - type: git
            url: "https://github.com/caesarw/tsukimi.git"
            tag: v0.19.3
            x-checker-data:
              type: git
              version-scheme: semantic
              tag-pattern: "^v([\\d.]+)$"

    with:

        sources:
          - type: git
            url: "https://github.com/caesarw/tsukimi.git"
            branch: flatpak
  3. Regenerate cargo-sources.json with https://github.com/flatpak/flatpak-builder-tools (already included in the manifest repo):

    python3 flatpak-builder-tools/cargo/flatpak-cargo-generator.py /path/to/my/tsukimi/fork/Cargo.lock -o cargo-sources.json
  4. Run flatpak-builder

    flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --install builddir moe.tsuna.tsukimi.yml
  5. If everything works correctly, you will have the flatpak installed.

These steps are required for a successful build because this pull request has not yet been merged. Once it's merged, no modifications to the manifest are needed.

@caesarw caesarw marked this pull request as ready for review February 19, 2025 16:28
caesarw and others added 2 commits February 20, 2025 10:15
Copy link
Owner

@tsukinaha tsukinaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works pretty well overall.
I just fixed some i18n issues that were caused by the app itself. But it looks like the app icon is broken in app. Do you have any idea?

* fixed issues with FFmpeg extension
* fixed about dialog icon missing
@caesarw
Copy link
Contributor Author

caesarw commented Feb 20, 2025

But it looks like the app icon is broken in app.

Fixed in bb30ea4 (#347).

Signed-off-by: tsukinaha <sakuovds@gmail.com>
@tsukinaha
Copy link
Owner

LGTM, I think we are ready to merge

@tsukinaha tsukinaha merged commit 3ce20df into tsukinaha:main Feb 21, 2025
3 checks passed
@tsukinaha
Copy link
Owner

Merged, thank you!
Are we ready to submit to Flathub now?

@caesarw
Copy link
Contributor Author

caesarw commented Feb 21, 2025

Are we ready to submit to Flathub now?

Yes. You can track the progress here.

@caesarw
Copy link
Contributor Author

caesarw commented Feb 24, 2025

The submission got delayed because there has been an issue on linking at the very end of compilation of tsukimi.

Specifically, the LLVM linker was able to find libmpv when gst was manually compiled and installed in the current version of the manifest; however, when the manually compiled gst was removed and switched to the gst that's built into the org.gnome.Sdk/Platform, the linker (both lld and mold) will complain libmpv not found.

Any help will be appreciated.

Update: fixed it. I'll open a new pull request when the patch is ready.

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

Successfully merging this pull request may close these issues.

Flatpak Packaging
3 participants