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.
This commit is contained in:
Mitchell Hashimoto
2025-03-19 10:12:45 -07:00
parent bd315c8394
commit 7b8c2232d3
6 changed files with 236 additions and 92 deletions

View File

@@ -108,6 +108,12 @@ in
# Localization
gettext
# We need these GTK-related deps on all platform so we can build
# dist tarballs.
blueprint-compiler
libadwaita
gtk4
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# My nix shell environment installs the non-interactive version
@@ -146,9 +152,6 @@ in
libXrandr
# Only needed for GTK builds
blueprint-compiler
libadwaita
gtk4
gtk4-layer-shell
glib
gobject-introspection