Skip to content

Fix flatpak packaging to a working state #6678

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

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

Conversation

alaviss
Copy link
Contributor

@alaviss alaviss commented Mar 12, 2025

This should make testing Flatpak builds a lot easier.

To build, enter flatpak/ directory and run:

flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

flatpak run -p org.flatpak.Builder \
  --repo=repo \
  builddir \
  com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.

@alaviss alaviss requested a review from a team as a code owner March 12, 2025 08:54
@alaviss alaviss force-pushed the push-qwtptnnownso branch from f4c1020 to 3284ae5 Compare March 12, 2025 22:24
@alaviss alaviss mentioned this pull request Mar 15, 2025
@alaviss alaviss force-pushed the push-qwtptnnownso branch from 0be3824 to 7276f07 Compare March 15, 2025 02:58
@alaviss
Copy link
Contributor Author

alaviss commented Mar 15, 2025

Rebased to Zig 0.14.0.

Due to #6734 and #6733, flatpak-builder will not be able to build Ghostty at the moment.

@alaviss alaviss force-pushed the push-qwtptnnownso branch 3 times, most recently from 7fdbf01 to a037432 Compare March 16, 2025 18:05
@alaviss
Copy link
Contributor Author

alaviss commented Mar 16, 2025

Rebased to main, flatpak build is now fully functional.

Comment on lines +43 to +51
<!--
TODO: Generate manifest location data.

Ref: https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines#manifest-location

<custom>
<value key="flathub::manifest">https://github.com/ghostty-org/ghostty/blob/<hash>/flatpak/com.mitchellh.ghostty.yml</value>
</custom>
-->

Choose a reason for hiding this comment

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

This isnt enforced by the flathub review process. At least I havent ran into this at all when publishing flatpak manifests to Flathub

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It sounds like a requirement if you're publishing straight from here to Flathub, though. At least I see that Firefox and OBS are following it.

@mitchellh
Copy link
Contributor

I'm trying to verify this so we can get it merged but I'm getting build errors locally:

Cache miss, checking out last cache hit
========================================================================
Building module ghostty in /home/mitchellh/code/go/src/github.com/ghostty-org/ghostty/flatpak/.flatpak-builder/build/ghostty-2
========================================================================
Updated Git hooks.
Git LFS initialized.
Note: switching to '4182b7fa42f27cf14a71dbdb54cfd82c5c6e3447'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 4182b7f switch zigimg ref to merged commit
Updated Git hooks.
Git LFS initialized.
Note: switching to '4a002763419a34d61dcbb1f415821b83b9bf8ddc'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 4a00276 Merge pull request 'fix removed b.host on v0.14.0-dev.2568+42dac40b3' (#25) from e0328eric/zg:master into master
Updated Git hooks.
Git LFS initialized.
fatal: unable to read tree (0ce4eca3560d5553b13263d6b6bb72e146dd43d0)
Error: module ghostty: Child process exited with code 128

Any ideas?

@alaviss
Copy link
Contributor Author

alaviss commented Mar 19, 2025

fatal: unable to read tree (0ce4eca3560d5553b13263d6b6bb72e146dd43d0)

Looks like it's zigimg again.

They force pushed their master branch so now the commit referenced is unreachable from default branch.

Maybe I'll have to fix the cache gen script to prefer downloading archives instead...

@alaviss alaviss force-pushed the push-qwtptnnownso branch from a037432 to 7e387a6 Compare March 21, 2025 07:19
@alaviss
Copy link
Contributor Author

alaviss commented Mar 21, 2025

Rebased and fixed the issue with zigimg. The flatpak should build correctly now.

@alaviss alaviss force-pushed the push-qwtptnnownso branch from 05a6719 to a878247 Compare March 24, 2025 15:59
@alaviss
Copy link
Contributor Author

alaviss commented Mar 24, 2025

Rebased to main and updated package cache.

@alaviss alaviss force-pushed the push-qwtptnnownso branch from a878247 to 6b436db Compare March 26, 2025 06:39
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
alaviss added 4 commits March 29, 2025 22:44
Flatpak will strip them out on its own into an extension package, useful
for debugging
This variant is built in Debug mode and is given a different desktop
file so it could be installed side-by-side with regular Ghostty.
* Added URLs to more resources
* Fixed developer ID
* Added device compatibility information
@alaviss alaviss force-pushed the push-qwtptnnownso branch from 6b436db to e20e99b Compare March 30, 2025 03:44
@alaviss
Copy link
Contributor Author

alaviss commented Mar 30, 2025

Rebased to main and dropped zigimg workaround, given that the fork's author committed to stop force pushing.

@yorickpeterse
Copy link
Contributor

Is there anything that's holding back this PR (or reviewing of it)? 😃

@00-kat
Copy link
Contributor

00-kat commented Apr 16, 2025

To quote Mitchell from Discord:

Its on me, I was ready to merge it before and just couldn't make it work locally. I have to run this locally to make sure it all works (so I can debug it one day if it doesn't) and then we hsould be good to go.

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.

9 participants