Commit Graph

258 Commits (main)

Author SHA1 Message Date
Uzair Aftab 07578d5e3f nix: replace deprecated system with stdenv.hostPlatform.system 2025-12-15 18:59:34 +01:00
Jeffrey C. Ollie 8386159764
nix vm tests: add test for ssh-terminfo shell integration feature 2025-11-20 08:30:09 -06:00
Jeffrey C. Ollie f26a6b949c
nix vm tests: sync ghostty user with other tests 2025-11-20 08:30:09 -06:00
Jeffrey C. Ollie debec946da
nix vm tests: refactor to make gnome vm node builder reusable 2025-11-20 08:30:08 -06:00
Jeffrey C. Ollie c77bbe6d7e
nix vms: make base vm more suitable for tests 2025-11-20 08:30:08 -06:00
Jeffrey C. Ollie ca8313570c
nix: add vm-based integration tests 2025-11-20 08:30:08 -06:00
Mitchell Hashimoto a315f8f32e
nix: add ucs-detect
This makes `ucs-detect` available in our Nix environment so that we can
run tests on our Unicode support. In the future, I'd like to modify our
CI to run this too.

This also adds a `./test/ucs-detect.sh` script that runs `ucs-detect`
with consistent options that match the upstream test styles.
2025-11-06 09:22:18 -08:00
Jeffrey C. Ollie 1caab0c208
nix: make sure zon2nix uses Zig 0.15 in generated files (#9220) 2025-10-15 11:56:07 -07:00
Jeffrey C. Ollie c91bfb9dd5
bump version for development (#9218) 2025-10-15 11:55:30 -07:00
Mitchell Hashimoto f0eb46ea26
Add update-mirror Nu script to ease mirror updating for deps
This adds a new script we can manually run that downloads all the files
that need to be uploaded to the mirror and updates our build.zig.zon.
The upload still happens manually [by me] but this simplifies the task
greatly.
2025-10-03 07:39:41 -07:00
Mitchell Hashimoto 87b77e1980
ci: cleanup 2025-10-03 07:10:43 -07:00
Mitchell Hashimoto 32bf37e5e4
setup basic doxygen for docs
We may not stick with Doxygen, but it gives us something to start with.
2025-09-23 15:51:27 -07:00
Jeffrey C. Ollie d4bc73a9d6
update to the latest zon2nix 2025-09-20 17:02:24 -05:00
Mitchell Hashimoto 1201bc27d2
bump the version for development 2025-09-15 11:01:14 -07:00
Mitchell Hashimoto 510f4e474c
Set version to 1.2.0 2025-09-15 08:25:54 -07:00
azhn 928f5492dc Fix name of `check-zig-cache.sh` in documentation for updating the zig cache hash 2025-09-13 06:54:56 +10:00
Jeffrey C. Ollie bb78adbd93
devshell: add poop 2025-09-04 23:44:23 -05:00
Mitchell Hashimoto ee573ebd36
ai: add `gh-issue` command to help diagnose GitHub issues
This enables agents (namely Amp) to use `/gh-issue <number/url>` to 
begin diagnosing a GitHub issue, explaining the problem, and suggesting
a plan of action. This action explicitly prompts the AI to not write
code.

I've used this manually for months with good results, so now I'm
formalizing it in the repo for other contributors.

Example diagnosing #8523:

https://ampcode.com/threads/T-3e26e8cc-83d1-4e3c-9b5e-02d9111909a7
2025-09-04 13:56:50 -07:00
Jeffrey C. Ollie a18332828a
nix: update zon2nix
- Builds with Zig 0.15 now (but still works just fine with Zig
  0.14 projects).
- Fixes a double-free if nix-prefetch-git can't be found or errors out
- Adds support for generating Flatpak package metadata natively.
2025-08-23 21:31:00 -05:00
Jeffrey C. Ollie 3dc45fcd55
devshell: add deps that allow GTK to load SVG resources
GTK dynamically loads librsvg when it needs to convert a SVG-only icon
(or any other SVG-only resource) for display. This PR adds the libraries
that GTK needs so that running programs from within the developer shell
can display those SVG resources.
2025-07-23 15:48:00 -05:00
Bryan Lee cbb3f6f64f
ci: add shellcheck linting for shell scripts
Add shellcheck to CI pipeline to ensure shell scripts follow best practices
and catch common errors. Fix existing shellcheck warnings in test scripts
to pass the new linting requirements.
2025-07-11 02:54:05 +08:00
Breno A. 0a1ade0158 pin GitHub Actions to specific SHAs 2025-07-06 06:59:50 -07:00
Mitchell Hashimoto f941a2185e
Revert "linux: add dbus and systemd activation services (#7433)"
Reverts two commits:

977cd530c7
820b7e432b

These break build from source on Linux for two reasons:

1.) The systemd user service needs to be installed in the `share`
prefix, not the `lib` prefix. This lets it get picked up in `~/.local`
but is also correct for just standard FHS paths.

2.) The `ghostty` path in the systemd user service needs to be absolute.
We should interpolate in the build install prefix to form an absolute
path.
2025-06-24 22:07:09 -04:00
Jeffrey C. Ollie 8824d11e1c
linux: add dbus and systemd activation services 2025-06-13 10:22:12 -05:00
Jeffrey C. Ollie 695e0b3e57
nix: temporarily remove snapcraft from the devshell 2025-05-26 11:43:52 -05:00
Jeffrey C. Ollie 9ad0e4675b
nix: keep symbols if we're building a debug package
also add CI tests to make sure debug symbols exist

Co-authored-by: Mitchell Hashimoto <m@mitchellh.com>
2025-05-19 18:52:51 -05:00
Jeffrey C. Ollie 8d0c3c7b7c
gtk: implement custom audio for bell 2025-05-13 10:01:54 -05:00
Mitchell Hashimoto d7256c71c4
ci: flatpak 2025-04-22 10:56:10 -07:00
trag1c f0ade53fd2 ci: add a script and workflow for requesting i18n review 2025-04-10 16:40:28 -07:00
Jeffrey C. Ollie 27978ef4d0
version bump for development 2025-03-26 23:29:15 -05:00
Mitchell Hashimoto 7b8c2232d3
build: distribute gresource c/h with source tarball
This introduces the concept of a "dist resource" (specifically a
`GhosttyDist.Resource` type). This is a resource that may be present in
dist tarballs but not in the source tree. If the resource is present and
we're not in a Git checkout, then we use it directly instead of
generating it.

This is used for the first time in this commit for the gresource c/h
files, which depend on a variety of external tools (blueprint-compiler,
glib-compile-resources, etc.) that we do not want to require downstream
users/packagers to have and we also do not want to worry about them
having the right versions.

This also adds a check for `distcheck` to ensure our distribution
contains all the expected files.
2025-03-19 11:52:03 -07:00
Jeffrey C. Ollie 648e0a06ab
CI: Add checks for blueprint compiler / Nix refactors
1. Refactored Nix devshell/package to make it easier to keep
   LD_LIBRARY_PATH & buildInputs in sync (plus make it easier to re-use
   in other Nix environment).
2. Added a CI job to ensure that Blueprints are formatted correctly and
   that they will compile using `blueprint-compiler` 0.16.0.
3. Reformatted all Blueprints with `blueprint-compiler format`.
2025-03-18 16:12:49 -05:00
Jeffrey C. Ollie 5cd8ebdafd
update zon2nix
Upstream is now mostly pure Zig and the build.zig.zon.* files are
generated directly by zon2nix. The JSON file is no longer used as an
intermediate file but is retained for downstream packager usage.
2025-03-16 01:09:52 -05:00
Mitchell Hashimoto 221f905a1c
pkg/glfw
Closes #6702

This removes our mach-glfw dependency and replaces it with an in-tree
pkg/glfw that includes both the source for compiling glfw as well as the
Zig bindings. This matches the pattern from our other packages.

This is based on the upstream mach-glfw work and therefore includes the
original license and copyright information.

The reasoning is stated in the issue but to summarize for the commit:

  - mach-glfw is no longer maintained, so we have to take ownership
  - mach-glfw depended on some large blobs of header files to enable
    cross-compilation but this isn't something we actually care about,
    so we can (and do) drop the blobs
  - mach-glfw blobs were hosted on mach hosts. given mach-glfw is
    unmaintained, we can't rely on this hosting
  - mach-glfw relied on a "glfw" package which was owned by another
    person to be Zig 0.14 compatible, but we no longer need to rely on
    this
  - mach-glfw builds were outdated based on latest Zig practices
2025-03-13 20:52:33 -07:00
Mitchell Hashimoto b123b14686
update zig2nix 2025-03-12 15:56:24 -07:00
Mitchell Hashimoto 3abbe6d3ba
nix: must not inject xcrun into PATH on macOS 2025-03-11 14:49:01 -07:00
Leah Amelia Chen 2f65f01fc8
gtk: add localization support, take 3 (#6004)
This is my third (!) attempt at implementing localization support. By
leveraging GTK builder to do most of the `gettext` calls, I can avoid
the whole mess about missing symbols on non-glibc platforms.

Added some documentation too for contributors and translators, just for
good measure.

Supersedes #5214, resolves the GTK half of #2357
2025-03-05 20:12:52 +01:00
Leah Amelia Chen 9360afd29f
gtk: add localization support, take 3
This is my third (!) attempt at implementing localization support.
By leveraging GTK builder to do most of the `gettext` calls, I
can avoid the whole mess about missing symbols on non-glibc platforms.

Added some documentation too for contributors and translators,
just for good measure.
2025-03-03 10:19:58 +01:00
Leah Amelia Chen a85651fe4f
gtk: implement quick terminal
Using `gtk4-layer-shell` still seems like the path of least resistance,
and to my delight it pretty much Just Works. Hurrah!

This implementation could do with some further polish (e.g. animations,
which can be implemented via libadwaita's animations API, and global
shortcuts), but as a MVP it works well enough.

It even supports tabs!

Fixes #4624.
2025-02-28 18:04:42 +01:00
Jeffrey C. Ollie 2ef042978d
nix: include libxml2 in nativeBuildInputs for xmllint 2025-02-23 15:17:18 -06:00
Mitchell Hashimoto 03d1240999
nix: use snapcraft only on Linux 2025-02-15 07:07:23 -08:00
Ken VanDine 0c3b873dde Merge remote-tracking branch 'origin/add_snap_package' into add_snap_package 2025-02-15 07:06:40 -08:00
Mitchell Hashimoto c7635201ab
Add snap to nix, add arm64 builders 2025-02-15 07:06:40 -08:00
Mitchell Hashimoto 4e8e2d9796
nix: snapcraft should only be installed on Linux 2025-02-14 14:52:36 -08:00
Mitchell Hashimoto f1f23e1c7d
Add snap to nix, add arm64 builders 2025-02-14 14:52:08 -08:00
Tim Culverhouse 9cb297202b cli: add +boo command
Add a `+boo` command to show the animation from the website. The data
for the frames is compressed during the build process. This build step
was added to the SharedDeps object because it is used in both
libghostty and in binaries.

The compression is done as follows:
- All files are concatenated together using \x01 as a combining byte
- The files are compressed to a cached build file
- A zig file is written to stdout which `@embedFile`s the compressed
  file and exposes it to the importer
- A new anonymous module "framedata" is added in the SharedDeps object

Any file can import framedata and access the compressed bytes via
`framedata.compressed`. In the `boo` command, we decompress the file and
split it into frames for use in the animation.

The overall addition to the binary size is 348k.
2025-02-14 14:46:18 -08:00
Mitchell Hashimoto 8231ebb770
build: mirror most of our direct dependencies
This adds a new script `update-mirror.sh` which generates the proper
blob format for R2 (or any blob storage) to mirror all of our
dependencies.

It doesn't automate updating build.zig.zon but on an ongoing basis this
should be easy to do manually, and we can strive to automate it in the
future.

I omitted iTerm2 color themes because we auto-update that via CI and
updating all of the machinery to send it to our mirror and so on is a
pain. Additionally, this doesn't mirror transitive dependencies because
Zig doesn't have a way to fetch those from a mirror instead (unless you
pre-generate a full cache like packagers but that's not practical for
day to day development).

It's hugely beneficial just to get most of our dependencies mirrored.
2025-02-14 10:06:15 -08:00
Jeffrey C. Ollie f32ad5216b build: generate a build.zig.zon.txt file for easy zig fetch scripting
This fixes a regression in 1.1.1/1.1.2 where our PACKAGING docs mention
using `fetch-zig-cache.sh` but it was removed. This commit adds it back,
generating its contents from the build.zig.zon file (via zon2nix which
we use for our Nix packaging).

For packagers, there are no dependency changes: you still need Zig and
POSIX sh. For release time, Ghostty has a new dependency on `jq` but
otherwise the release process is the same. The check-zig-cache.sh script
is updated to generate the new build.zig.zon.txt file.
2025-02-14 09:23:51 -08:00
Mitchell Hashimoto cdd287c88b
Add back `fetch-zig-cache.sh` for packaging
See the comment on more details, which also covers when and how we can
remove this.
2025-02-14 07:23:26 -08:00
Mitchell Hashimoto 52a5069dec
up versions for development 2025-02-13 15:31:14 -08:00