From 50d42093b515ad32244029b7ef27300b3f2873f3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 25 Mar 2021 21:22:23 -0400 Subject: [PATCH 1/2] Make testsuite fail if we lack pixbuf loaders Add a test that requires that we have png and jpeg loaders. --- testsuite/gdk/meson.build | 1 + testsuite/gdk/pixbuf.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 testsuite/gdk/pixbuf.c diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build index cc3125de37..5216d7a518 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -11,6 +11,7 @@ tests = [ 'encoding', 'keysyms', 'memorytexture', + 'pixbuf', 'rectangle', 'rgba', 'seat', diff --git a/testsuite/gdk/pixbuf.c b/testsuite/gdk/pixbuf.c new file mode 100644 index 0000000000..592f5d0d32 --- /dev/null +++ b/testsuite/gdk/pixbuf.c @@ -0,0 +1,31 @@ +#include + +int +main (int argc, char *argv[]) +{ + GSList *formats; + gboolean have_png, have_jpeg; + + have_png = FALSE; + have_jpeg = FALSE; + + formats = gdk_pixbuf_get_formats (); + + for (GSList *l = formats; l; l = l->next) + { + GdkPixbufFormat *format = l->data; + const char *name; + + name = gdk_pixbuf_format_get_name (format); + + if (strcmp (name, "png") == 0) + have_png = TRUE; + else if (strcmp (name, "jpeg") == 0) + have_jpeg = TRUE; + } + + if (!have_png || !have_jpeg) + return 1; + + return 0; +} From 2496ab09027803c8215a25ab4abc098bbc0af97b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 25 Mar 2021 22:52:30 -0400 Subject: [PATCH 2/2] Be explicit when building gdk-pixbuf subproject We require png and jpeg loaders. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f4e61aea07..e25dec77c4 100644 --- a/meson.build +++ b/meson.build @@ -384,7 +384,7 @@ pangocairo_dep = dependency('pangocairo', version: pango_req, fallback : ['pango', 'libpangocairo_dep']) pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req, fallback : ['gdk-pixbuf', 'gdkpixbuf_dep'], - default_options: ['man=false']) + default_options: ['png=true', 'jpeg=true', 'builtin_loaders=png,jpeg', 'man=false']) epoxy_dep = dependency('epoxy', version: epoxy_req, fallback: ['libepoxy', 'libepoxy_dep']) harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false,