Packaging Ghostty for Flatpak/Flathub #3201
Replies: 11 comments 29 replies
-
This should be a discussion since there isn't a directly actionable result from this. 😄 |
Beta Was this translation helpful? Give feedback.
-
As an alternative solution, it might be deemed viable to host a custom repository (ideally on the Ghostty website) and allow users to install the repository with a flatpakref. |
Beta Was this translation helpful? Give feedback.
-
There is no point in packaging this as a Flatpak until Ghostty gets a solution like Ptyxis which runs an agent on the host. As far as I know, that does currently not exist. |
Beta Was this translation helpful? Give feedback.
-
There appears to be another issue with using
The way I can reproduce this is as follows: #!/usr/bin/env bash
set -e
VERSION=1.0.0
ARCHIVE=ghostty-source.tar.gz
wget "https://release.files.ghostty.org/${VERSION}/${ARCHIVE}"
tar -xf "${ARCHIVE}"
rm "${ARCHIVE}"
cd ghostty-source
ZIG_GLOBAL_CACHE_DIR=vendor ./nix/build-support/fetch-zig-cache.sh
zig build --system vendor/p |
Beta Was this translation helpful? Give feedback.
-
I managed to get things to build, albeit in a way that's not suitable for Flathub: The code for this proof of concept is found in https://github.com/yorickpeterse/ghostty-flatpak. To build, run the following: bash deps.sh
flatpak-builder --disable-rofiles-fuse --force-clean --user --install-deps-from=flathub --repo=repo --install builddir org.ghostty.ghostty.yml The
|
Beta Was this translation helpful? Give feedback.
-
There seems to already be a manifest and Flatpak integration in the repo, but it's a bit broken and no longer builds:
|
Beta Was this translation helpful? Give feedback.
-
For those interested in Flatpak/Flathub support, this is currently blocked by #3616. Help with said issue would be greatly appreciated 😃 |
Beta Was this translation helpful? Give feedback.
-
While I like to chime in on having a Flatpak, I also want to point to notes from another terminal emulator that recommends native packaging over Flatpak: https://wezfurlong.org/wezterm/install/linux.html?h=flatpak#installing-on-linux-via-flathub |
Beta Was this translation helpful? Give feedback.
-
Natively installed terminal apps like Btop don't open from the app launcher when I have Ptyxis as a flatpak. |
Beta Was this translation helpful? Give feedback.
-
dont know if this might help, but you could download all dependencies before the build starts. I did the same here for prusa slicer: https://github.com/flathub/com.prusa3d.PrusaSlicer/blob/d32b6e63bb7b6b690ac40749d462898c62a6d141/com.prusa3d.PrusaSlicer.yml#L97 |
Beta Was this translation helpful? Give feedback.
-
https://github.com/yorickpeterse/ghostty-flatpak is now in a sort of OK state. That is, we pre-build an archive containing the dependencies and then host that using a GitHub release. It's a bit of a hack, but it's the most reliable way of providing the dependencies such that we can use this for a future Flathub package. Unfortunately, the resulting Flatpak application isn't terribly useful. Due to the Flatpak integration being broken, the application runs in its own environment. While it does have access to the file system, it won't be able to properly run host executables as various directories in As such, there's no point in submitting the package to Flathub at this stage. Thus, until the linked issue is resolved there's nothing more I can do. |
Beta Was this translation helpful? Give feedback.
-
I'm working on packaging Ghostty for Flatpak/Flathub. This brings some challenges with it, such as Flathub not allowing network access during the build process. The packaging guidelines outline some steps to take to build from a local package cache. Unfortunately, this introduces the following problems:
zig build --system
the-Demit-docs
option is implied. This is unnecessary for Flatpak but results in build errors because Pandoc isn't installed in the sandboxFor problem one I created the following script to remove large redundant directories (e.g. some dependencies include 40 MiB worth of screenshots or 50 MiB test directories):
rm -rf vendor/p/*/{test,Test,screenshots,result,doc,data}
This isn't ideal, but it ends up cutting the directory/archive size in half, though the resulting 200 MiB is still too large to include directly into a repository somewhere (and Flatpak doesn't support Git LFS for build sources). Ideally Ghostty release provide an archive containing just the dependencies such that this can be added as an extra dependency.
For problem two it appears there's no sensible solution right now. Probably the best option is to allow
-Demit-docs=false
to override the default implied by--system
.Current state
I've set up https://github.com/yorickpeterse/ghostty-flatpak which contains a proof of concept. The build process isn't suitable for Flathub because it requires network access, but it at least produces what appears to be a working Flatpak for Ghostty. To make this suitable for Flathub, Ghostty needs to properly support offline builds which currently isn't the case, and the dependencies need to be published somewhere such that they can be downloaded during the build process.
See #3201 (comment) for more details.
Related issues
Beta Was this translation helpful? Give feedback.
All reactions