logoalt Hacker News

danudeytoday at 6:45 PM0 repliesview on HN

Noticed that when I build this it ends up with direct linking against a half-dozen libraries it doesn't actually use, at least on Ubuntu. Fixed it by replacing the linking commands with this:

    exe_mod.linkSystemLibrary("gtk-4", .{ .use_pkg_config = .no });
    exe_mod.linkSystemLibrary("gobject-2.0", .{});
In my case, at least, this doesn't change the full library tree because gtk-4 still links against all of the libraries that are removed from this binary's list, but it does mean that programs which calculate dependencies, like dpkg-shlibdeps, won't report spurious "required" dependencies when analyzing the binary.

When building on Ubuntu 26.04, the binary no longer directly links against lib{pango, cairo, pangocairo, cairo-gobject, harfbuzz, gdk_pixbuf, graphene, gio, vulkan}.

Can't create an account on the site so I figured I'd post this here. If you're going for absolute minimalism this seems like another step in the right direction for anyone building on a more 'gratuitous' GTK build (such as Ubuntu's)