1DOLLY 72PACKAGE glib3REQUIRES HOST runtime@04REQUIRES HOST dso@05REQUIRES HOST threads@067891011121314FROM /v0.1.7/demos/tools/Dollyfile-tools-build 10f0bb40fc327b66565fb4439808c0fd06fe344684885eef70e1fccb4472af5815USE /v0.1.7/demos/tools/Dollyfile-meson fb60ceced3a0491525af8579957675061f8748cf2c7949189fb95e95543b547816USE /v0.1.7/demos/zero-ad/Dollyfile-pkgconf fdb291181297a70fc73950b9122322458fa73450d2f713b931eeefe0f46f6f0217USE /v0.1.7/demos/tools/Dollyfile-xz d07bf61b88901661d5f75bc5000003f0df152c88dad282c46e57bd55f3a5adbb18USE /v0.1.7/demos/tools/Dollyfile-tar 2caf674d1e2c6fada2d9a0556f72fb087f0b7920642ccd28671dd98459b1863419USE /v0.1.7/demos/tools/Dollyfile-binaryen e9018a3b0f85a39af18aac559e63a2fa0b376dac189a97fa930c1f5c56e29fef20INSTALL /v0.1.7/demos/python/Dollyfile-libffi 249d61ea3501e8bc465e6457194353bb773fef2bc59731ef3b22fc7e1781b8c421INSTALL /v0.1.7/demos/gtk/Dollyfile-pcre2 c37187fa08409cb1d8be6d1c6e129868435718ae83619a768132b56dd81606e822INSTALL /v0.1.7/Dollyfile-zlib 8de0bd7abb3a8237405fbbe378e6565c995a24694e5a3b55ef24873c5786bdb52324REQUIRES HEADER ffi25REQUIRES HEADER pcre226REQUIRES HEADER zlib27REQUIRES LIB ffi28REQUIRES LIB pcre2-829REQUIRES LIB z30REQUIRES TOOL cc31REQUIRES TOOL grep32REQUIRES TOOL meson33REQUIRES TOOL mv34REQUIRES TOOL patch35REQUIRES TOOL pkg-config36REQUIRES TOOL sed37REQUIRES TOOL tar38REQUIRES TOOL wasm-opt39REQUIRES TOOL xz4041SOURCE /v0.1.7/dist/static/gtk/glib-2.90.1.tar.xz 93c941aa17d5eb1d53fe838365f29a8b4e539c222a256d974ec8f30fc413e396 /tmp/glib.tar.xz42SOURCE /v0.1.7/dist/static/gtk/glib-dolly.patch f7cf8e258bd3cedd3ed89eeecd2b4cd98e9d90f6d308857895b843e9684d1d54 /tmp/glib-dolly.patch43SLOP CWD /tmp xz -dc glib.tar.xz | tar -xf -44SLOP patch -p1 -d /tmp/glib-2.90.1 -i /tmp/glib-dolly.patch454647SLOP meson setup /tmp/glib-build /tmp/glib-2.90.1 --wrap-mode=nodownload --prefix=/usr --libdir=lib \48 --buildtype=release -Ddefault_library=static -Dtests=false -Dintrospection=disabled -Dnls=disabled \49 -Dselinux=disabled -Dxattr=false -Dlibmount=disabled -Dman-pages=disabled -Ddtrace=disabled \50 -Dsystemtap=disabled -Dsysprof=disabled -Dlibelf=disabled -Dglib_debug=disabled51SLOP meson compile -C /tmp/glib-build && meson install --no-rebuild -C /tmp/glib-build52SLOP sed 's/^Libs: \(.*\)$/Libs: \1 --dolly-cast-emulation/' /usr/lib/pkgconfig/gobject-2.0.pc > /tmp/gobject.pc && \53 mv /tmp/gobject.pc /usr/lib/pkgconfig/gobject-2.0.pc5455SLOP CWD /usr/bin for script in glib-mkenums glib-genmarshal gdbus-codegen gtester-report; do \56 sed '1s|.*|#!/usr/bin/python3|' $script > /tmp/$script && mv /tmp/$script $script; done57SLOP CWD /usr/bin for program in glib-compile-resources glib-compile-schemas gio gresource gsettings; do \58 wasm-opt --fpcast-emu $program -o $program.emulated && mv $program.emulated $program; done5960616263FILE /tmp/glib-check.c6465666768 G_DECLARE_FINAL_TYPE(Probe, probe, PROBE, OBJECT, GObject)69 struct _Probe { GObject parent; int seen; };70 G_DEFINE_FINAL_TYPE(Probe, probe, G_TYPE_OBJECT)71 static guint touched, weighed;72 static void probe_class_init(ProbeClass *klass) {73 (void)klass;74 touched = g_signal_new("touched", PROBE_TYPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_INT);75 weighed = g_signal_new("weighed", PROBE_TYPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,76 G_TYPE_INT, 3, G_TYPE_INT, G_TYPE_DOUBLE, G_TYPE_STRING);77 }78 static void probe_init(Probe *self) { self->seen = 0; }79 static void on_touched(Probe *self) { self->seen = 1; }80 static int on_weighed(Probe *self, int number, double scale, const char *word, gpointer data) {81 (void)self;82 return number * (int)scale + (int)strlen(word) + GPOINTER_TO_INT(data);83 }84 static gint by_number(gconstpointer left, gconstpointer right) { return GPOINTER_TO_INT(left) - GPOINTER_TO_INT(right); }85 static gpointer twice(gpointer data) { return GINT_TO_POINTER(GPOINTER_TO_INT(data) * 2); }86 static gboolean quit(gpointer loop) { g_main_loop_quit(loop); return G_SOURCE_REMOVE; }87 int main(void) {88 Probe *probe = g_object_new(PROBE_TYPE, NULL);89 int weight = 0;90 g_signal_connect(probe, "touched", G_CALLBACK(on_touched), NULL);91 g_signal_connect(probe, "weighed", G_CALLBACK(on_weighed), GINT_TO_POINTER(1));92 g_signal_emit(probe, touched, 0, 7);93 g_signal_emit(probe, weighed, 0, 20, 2.0, "go", &weight);94 GList *list = g_list_sort(g_list_prepend(g_list_prepend(NULL, GINT_TO_POINTER(2)), GINT_TO_POINTER(1)), by_number);95 list = g_list_sort(list, by_number);96 GThread *thread = g_thread_new("twice", twice, GINT_TO_POINTER(21));97 GMainLoop *loop = g_main_loop_new(NULL, FALSE);98 g_timeout_add(10, quit, loop);99 g_main_loop_run(loop);100 char *contents = NULL;101 gboolean read = g_file_load_contents(g_file_new_for_path("/tmp/glib-check.c"), NULL, &contents, NULL, NULL, NULL);102 if (probe->seen != 1 || weight != 43 || GPOINTER_TO_INT(list->data) != 1 ||103 GPOINTER_TO_INT(g_thread_join(thread)) != 42 || !read || !strstr(contents, "GLIB-OK")) return 1;104 return puts("GLIB-OK") < 0;105 }106SLOP cc -O1 -pthread /tmp/glib-check.c -o /tmp/glib-check $(pkg-config --cflags --libs gio-2.0) && \107 /tmp/glib-check | grep -qx GLIB-OK108109EXPORTS LIB glib-2.0 /usr/lib/libglib-2.0.a110EXPORTS LIB gobject-2.0 /usr/lib/libgobject-2.0.a111EXPORTS LIB gio-2.0 /usr/lib/libgio-2.0.a112EXPORTS LIB gmodule-2.0 /usr/lib/libgmodule-2.0.a113EXPORTS LIB gthread-2.0 /usr/lib/libgthread-2.0.a114EXPORTS HEADER /usr/include/glib-2.0115EXPORTS HEADER /usr/lib/glib-2.0/include116EXPORTS HEADER /usr/include/gio-unix-2.0117EXPORTS FILE glib-pkgconfig /usr/lib/pkgconfig/glib-2.0.pc118EXPORTS FILE gobject-pkgconfig /usr/lib/pkgconfig/gobject-2.0.pc119EXPORTS FILE gio-pkgconfig /usr/lib/pkgconfig/gio-2.0.pc120EXPORTS FILE gio-unix-pkgconfig /usr/lib/pkgconfig/gio-unix-2.0.pc121EXPORTS FILE gmodule-pkgconfig /usr/lib/pkgconfig/gmodule-2.0.pc122EXPORTS FILE gmodule-export-pkgconfig /usr/lib/pkgconfig/gmodule-export-2.0.pc123EXPORTS FILE gmodule-no-export-pkgconfig /usr/lib/pkgconfig/gmodule-no-export-2.0.pc124EXPORTS FILE gthread-pkgconfig /usr/lib/pkgconfig/gthread-2.0.pc125EXPORTS TOOL glib-compile-resources126EXPORTS TOOL glib-compile-schemas127EXPORTS TOOL glib-mkenums128EXPORTS TOOL glib-genmarshal129EXPORTS TOOL gdbus-codegen130EXPORTS TOOL gio131EXPORTS TOOL gresource132EXPORTS TOOL gsettings133EXPORTS FOLDER glib-data /usr/share/glib-2.0134135SLOP mkdir -p /usr/share/licenses/glib && cp /tmp/glib-2.90.1/LICENSES/LGPL-2.1-or-later.txt /usr/share/licenses/glib/COPYING136FILE /usr/share/licenses/glib/COPYING137FILE /usr/share/man/cat1/glib.1138 GLib 2.90 inside Dolly: GLib, GObject and GIO for programs the cc package139 builds, and their tools.140 141 cc -pthread prog.c -o prog $(pkg-config --cflags --libs gio-2.0)142 GObject's pkg-config file adds --dolly-cast-emulation:143 GObject calls functions through casts144 glib-compile-resources, glib-compile-schemas, glib-mkenums,145 glib-genmarshal, gdbus-codegen as upstream's146 147 Upstream's documentation: https://docs.gtk.org/glib/148