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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Flatpak support #347

wants to merge 4 commits into from

Conversation

caesarw
Copy link

@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).
  • 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
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
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
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