1DOLLY 72PACKAGE ghostty-gtk3REQUIRES HOST runtime@04REQUIRES HOST dso@05REQUIRES HOST pty@06REQUIRES HOST sockets@07REQUIRES HOST threads@089# Ghostty's GTK application at the pinned commit, built by Zig in Dolly over10# mesa-build: libadwaita, blueprint-compiler for its interface files, and11# Ghostty's own build.zig12# (ghostty-dolly.patch; its packages fetched on the host, prepare-ghostty.sh).13FROM /v0.1.4/demos/ghostty-gtk/Dollyfile-mesa-build 775cbfcdaec211053a16c9f5ba63d200fdf72b0f7e431e3b0d79af153ac9c5b714USE /v0.1.4/demos/zig/Dollyfile-zig-llvm b711a972e6cb15b85ae06efa77bea36a448dbc55b4d264d2a7b76c6e2ba1620c1516REQUIRES TOOL   c++17REQUIRES TOOL   cc18REQUIRES TOOL   cp19REQUIRES TOOL   gzip20REQUIRES TOOL   ln21REQUIRES TOOL   meson22REQUIRES TOOL   mkdir23REQUIRES TOOL   patch24REQUIRES TOOL   python325REQUIRES TOOL   sed26REQUIRES TOOL   tar27REQUIRES TOOL   xz28REQUIRES TOOL   zig2930# libadwaita, static. It carries its own copies of five of GTK's builder31# helpers under GTK's names, which a static link of both would hold twice:32# its build names its copies its own.33SOURCE /v0.1.4/dist/static/ghostty-gtk/libadwaita-1.10.0.tar.xz b1bf56239269d101a6391ad4553c910eff9cc6170b803916405477ef60a66c84 /tmp/ghostty-gtk/libadwaita.tar.xz34SLOP CWD /tmp/ghostty-gtk xz -dc libadwaita.tar.xz | tar -xf -35SLOP CWD /tmp/ghostty-gtk meson setup build-adw libadwaita-1.10.0 --wrap-mode=nodownload --prefix=/usr --libdir=lib \36  --buildtype=release -Ddefault_library=static -Dintrospection=disabled -Dvapi=false -Dtests=false \37  -Dexamples=false -Ddocumentation=false "-Dc_args=-D_gtk_builder_check_parent=adw_gtk_builder_check_parent -D_gtk_builder_prefix_error=adw_gtk_builder_prefix_error -D_gtk_builder_error_unhandled_tag=adw_gtk_builder_error_unhandled_tag -D_gtk_builder_parser_translate=adw_gtk_builder_parser_translate -Dgtk_buildable_child_deprecation_warning=adwgtk_buildable_child_deprecation_warning"38SLOP meson compile -C /tmp/ghostty-gtk/build-adw && meson install --no-rebuild -C /tmp/ghostty-gtk/build-adw3940# blueprint-compiler, which reads the typelibs itself41# (blueprint-compiler-dolly.patch: without PyGObject, where GObject42# Introspection keeps them); the typelibs are made outside (prepare-typelibs.sh).43SOURCE /v0.1.4/dist/static/ghostty-gtk/blueprint-compiler-0.18.0.tar.gz 703c7ccd23cb6f77a8fe9c8cae0f91de9274910ca953de77135b6e79dbff1fc3 /tmp/ghostty-gtk/blueprint-compiler.tar.gz44SOURCE /v0.1.4/dist/static/ghostty-gtk/blueprint-compiler-dolly.patch 1bc55ea4514276dbdef796a0b09ec68bb0a5654ddc3f5e380046c7042027dbec /tmp/ghostty-gtk/blueprint-compiler-dolly.patch45SOURCE /v0.1.4/dist/static/ghostty-gtk/typelibs.tar 8b2f355675773235ea066e1f769de01481974d8a9846c0c49ad72b3c40f3358a /tmp/ghostty-gtk/typelibs.tar46SLOP CWD /tmp/ghostty-gtk gzip -dc blueprint-compiler.tar.gz | tar -xf -47SLOP patch -p1 -d /tmp/ghostty-gtk/blueprint-compiler-v0.18.0 -i /tmp/ghostty-gtk/blueprint-compiler-dolly.patch48SLOP CWD /tmp/ghostty-gtk/blueprint-compiler-v0.18.0 python3 -c "import shutil, sysconfig; shutil.copytree('blueprintcompiler', sysconfig.get_paths()['purelib'] + '/blueprintcompiler')"49SLOP CWD /tmp/ghostty-gtk/blueprint-compiler-v0.18.0 sed -e 's/@VERSION@/0.18.0/' -e 's|@LIBDIR@|/usr/lib|' \50  -e 's|^#!/usr/bin/env python3|#!/usr/bin/python3|' -e 's|@MODULE_PATH@|/usr/lib/python3.14/site-packages|' \51  blueprint-compiler.py > /usr/bin/blueprint-compiler52SLOP tar -xf /tmp/ghostty-gtk/typelibs.tar -C /53SLOP blueprint-compiler --version5455# Zig hands a link to cc without the program's own flags, and asks cc for56# libc's headers with -Wp,-v, which Dolly's cc answers to -v. This cc passes57# all of it to Dolly's and gives Ghostty's link the rest: Binaryen's cast58# emulation (GObject calls through pointers of other types), the X libraries59# and Mesa's GLX, which libepoxy takes by a weak symbol, and libadwaita's60# resources, registered by constructors that wasm-ld keeps only for objects61# something keeps (an export does).62FILE /tmp/ghostty-cc/cc.c63    #include <spawn.h>64    #include <stdio.h>65    #include <stdlib.h>66    #include <string.h>67    #include <sys/wait.h>68    extern char **environ;69    static const char *const ghostty[] = {"--dolly-cast-emulation", "-Wl,--initial-memory=268435456",70      "-Wl,--undefined=glXGetProcAddressARB", "-Wl,--export=adw_get_resource",71      "-Wl,--export=adw_stylesheet_get_resource", "-L/usr/lib", "-lGL", "-lXext", "-lX11", "-lxcb",72      "-lXau", "-lz", "-ldolly-sockets", "-lm"};73    int main(int argc, char **argv) {74      int link = 1, program = 0;75      for (int i = 1; i < argc; i++) {76        if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "-E") || !strcmp(argv[i], "-S")) link = 0;77        if (!strcmp(argv[i], "-o") && i + 1 < argc) {78          const char *slash = strrchr(argv[i + 1], '/');79          program = !strcmp(slash ? slash + 1 : argv[i + 1], "ghostty.wasm");80        }81      }82      char **args = calloc((size_t)argc + sizeof(ghostty) / sizeof(*ghostty) + 1, sizeof(char *));83      size_t n = 0;84      args[n++] = link && program ? "/bin/c++" : "/bin/cc";85      for (int i = 1; i < argc; i++) args[n++] = strcmp(argv[i], "-Wp,-v") ? argv[i] : "-v";86      if (link && program) for (size_t i = 0; i < sizeof(ghostty) / sizeof(*ghostty); i++) args[n++] = (char *)ghostty[i];87      pid_t pid;88      int status;89      if (posix_spawn(&pid, args[0], NULL, NULL, args, environ) != 0) return perror(args[0]), 127;90      if (waitpid(pid, &status, 0) != pid) return 127;91      return WIFEXITED(status) ? WEXITSTATUS(status) : 128 + WTERMSIG(status);92    }93SLOP cc -O1 /tmp/ghostty-cc/cc.c -o /tmp/ghostty-cc/cc94# Ghostty's build finds libdolly-sockets and libdolly-pty under a prefix's lib.95SLOP mkdir -p /tmp/ghostty-prefix && ln -s /usr/lib/dolly/process /tmp/ghostty-prefix/lib9697SOURCE /v0.1.4/dist/static/ghostty-gtk/ghostty.tar.gz b3bd58bf3734ae0d7b5c509082f2a00f99658d292bbfeb0a2f5a8daf474adb22 /tmp/ghostty.tar.gz98SLOP gzip -dc /tmp/ghostty.tar.gz | tar -xf - -C /99# Without xmllint, GLib's resource compiler keeps the blanks of the interface100# files (it says so): it would run xmllint by fork.101SLOP CWD /tmp/ghostty PATH=/tmp/ghostty-cc:$PATH ZIG_LIBC=/usr/lib/zig/libc.txt zig build -Dapp-runtime=gtk -Doptimize=ReleaseFast \102  -Dgtk-wayland=false -Dsentry=false -Di18n=false -Demit-docs=false -Demit-terminfo=false -Demit-termcap=false \103  -Dversion-string=1.3.2-dev -fsys=freetype -fsys=harfbuzz -fsys=fontconfig -fsys=libpng -fsys=zlib \104  --search-prefix /tmp/ghostty-prefix --summary none105SLOP cp /tmp/ghostty/zig-out/bin/ghostty.wasm /usr/bin/ghostty106SLOP ghostty +version | grep -q 'Ghostty 1.3.2-dev'107108SLOP mkdir -p /usr/share/licenses/ghostty-gtk109SLOP cp /tmp/ghostty/LICENSE /usr/share/licenses/ghostty-gtk/ghostty-LICENSE110SLOP cp /tmp/ghostty-gtk/libadwaita-1.10.0/COPYING /usr/share/licenses/ghostty-gtk/libadwaita-COPYING111SLOP cp /usr/share/licenses/mesa/license.rst /usr/share/licenses/ghostty-gtk/mesa-license.rst112EXPORTS TOOL ghostty113FILE /usr/share/licenses/ghostty-gtk/ghostty-LICENSE114FILE /usr/share/licenses/ghostty-gtk/libadwaita-COPYING115FILE /usr/share/licenses/ghostty-gtk/mesa-license.rst116FILE /usr/share/man/cat1/ghostty.1117    ghostty: Ghostty's GTK application, built inside Dolly from the pinned118    commit, for an X server (the ghostty-x11 application starts one).119    120      ghostty                           a window with $SHELL in it121      ghostty --command=direct:/bin/slop --gtk-single-instance=false122      ghostty +version                  its version123      ghostty +help                     the actions and options124    125    It draws with Mesa's OpenGL in the program (softpipe, GLX over Xlib): set126    GDK_DEBUG=gl-glx GSK_RENDERER=cairo MESA_GL_VERSION_OVERRIDE=4.3127    MESA_GLSL_VERSION_OVERRIDE=430, as ghostty-x11 does.128    Upstream's documentation: https://ghostty.org/docs129